A decade ago, Canada's oil sector was growing so fast it was predicted to become a global energy superpower, but a series of political missteps and formidable environmental activism has created a dysfunctional system requiring Opec-style government intervention to move its oil to market.
Canada produces 4.9 million barrels per day, more than any country other than the United States, Saudi Arabia and Russia, but the world's fourth largest producer has had to nationalise a pipeline and the province of Alberta is exploring buying trains to handle a glut of oil sitting in storage.
Canada's crisis coincides with big producers taking market share away from Opec members, mostly clustered in the Middle East. Global oil demand is expected to surpass 100 million bpd in 2019. The United States has driven exports to record highs on growing demand from China, India and other developing countries.
But Ottawa has failed under two governments to effectively counter the strategy of environmental activists to attack the oil sector's heart by choking its arteries - pipelines. Roughly 35 million barrels, twice the normal amount, of Western Canadian crude used to produce diesel, gasoline and jet fuel is stuck in storage.
The energy sector accounts for nearly 11 per cent of Canada's gross domestic product. However, Canadian oil trades at a fraction of global prices, costing the economy C$80 million (Dh216m) per day, the Alberta provincial government said.
Alberta took the unusual step this month of temporarily curtailing 325,000 bpd starting in January - in the aftermath of a retreat from the oil sands by global companies including ConocoPhillips and Statoil.
"It's become dire now because the writing is clearly on the wall. The issue is market access," said Jihad Traya, manager of energy advisory service HSB Solomon.
Prime Minister Justin Trudeau's government, facing an election next year, offered the oilpatch this week C$1.6 billion in aid. In May, Ottawa agreed to buy the Trans Mountain pipeline in hopes of pushing through an expansion to nearly triple capacity as other proposed lines languished.
In 2006, then-Prime Minister Stephen Harper boasted Canada would soon become an "energy superpower." Canada was producing 2.6 million bpd, which moved smoothly to US refineries through pipelines. Since then, production has nearly doubled, but pipeline growth has stalled.
Both Conservative Harper and Liberal Trudeau squelched opportunities to complete pipelines just as opposition to more lines multiplied. Two projects were killed, and legal setbacks have stymied the development of TransCanada Corp's Keystone XL and the government-owned Trans Mountain expansion.
A year after taking office in 2015 Mr Trudeau proposed a bargain aimed at satisfying both environmentalists and the oil industry - a national carbon-pricing plan to reduce Canada's emissions while approving pipeline expansions.
The strategy has inflamed both sides.
When a court overturned Ottawa's approval of the expansion of Trans Mountain in August, the deal was off and Alberta Premier Rachel Notley yanked support for Mr Trudeau's carbon plan just hours later.
Indigenous and environmental opposition to pipelines has forced MR Trudeau to push for tighter regulations on future pipelines. The changes are necessary to "depoliticise" the system, Natural Resources Minister Amarjeet Sohi said.
"We need to fix the broken system that we have now so we are able to build the pipeline capacity that is so necessary."
But Mr Trudeau has already shelved Enbridge's Northern Gateway proposal, which would have run through northern Alberta to the Pacific coast, and the National Energy Board in 2017 toughened its review of TransCanada's Energy East pipeline while it was underway.
Both projects are now dead. Alberta is seeking to buy rail cars to reduce the glut, and earlier this month, the province ordered producers to cut output after its oil fell to a discount of $52 per barrel from US oil in October.
Ms Notley told reporters earlier this month that people in Alberta can make profits from oil and gas, "but they need Ottawa to take the handcuffs off. We need rail. We need long-term support for getting that pipeline built."
Alberta's oil sands, a mixture of sand, water, clay and thick, heavy oil, became a compelling target for environmentalists as production expanded dramatically in the early 2000s.
The mining process scrapes away trees and vegetation across huge tracts of land, leaving a path of destruction captured in aerial images, while a different production method using steam consumes huge amounts of natural gas.
Clayton Thomas-Muller, an indigenous activist, said environmentalists grew frustrated trying to stop the industry's expansion through the Alberta Energy Regulator, but found a new strategy of opposing the pipelines.
They built wider coalitions, tapping into anger of Nebraska ranchers and drawing the attention of Hollywood celebrities such as director James Cameron.
Opponents of TransCanada's Keystone XL began protests at the White House in 2011, seeking arrest and attention. Then-US President Barack Obama finally rejected the project in 2015.
"Full credit to climate-change advocates, they kicked the snot out of Corporate Canada," said Tim Powers, a Conservative political strategist. He said Canadian resource companies have been too focused on the regulatory process, while climate-change advocates "laid out a better, more compelling narrative" to win public opinion.
US President Donald Trump resurrected Keystone XL in 2017. But both KXL and Trans Mountain remain in regulatory limbo after courts ruled in recent months that the US and Canadian governments failed to properly do their jobs.
The cases that overturned approvals for Northern Gateway and Trans Mountain led companies to question investment in Canada. The end result is a Canadian oil patch in retreat.
"My main fear is that other nations will continue to produce at market price and Canada will be left behind," said Duncan Au, chief executive of CWC Energy Services. The well drilling company has cut about 70 employees, or nearly 10 per cent, since the beginning of 2018.
"This is a made-in-Canada crisis," Mr Au said.