A funk has settled over the Alberta oil industry as low prices, pipeline system constraints, storage shortfalls, and limited rail shipping have combined in a perfect storm that is costing producers millions of dollars every day.

While the worst of the bad weather may dissipate in coming months, more production coming on-line from the oil sands could mean that sunny days are many months, if not several years, away.

Western Canadian Select is the benchmark price for oil sands heavy crudes that trades at a discount to West Texas Intermediate (WTI). That differential was fairly narrow through most of 2017, around $9 to $11 U.S. dollars, according to Kevin Birn, director of the Oil Sands Dialogue for IHS MarkIt.

“We think that was a reflection of a contraction in availability of heavy crude globally. So while we were swimming in light sweet crude driven by U.S. production, we’ve seen OPEC’s cut predominantly come from heavy crude,” Birn said.

“We’ve seen increasing demand for heavy crude because Russia is no longer exporting as much heavy product into Europe as well. And we’ve seen Venezuela basically imploding [while] Mexico’s been declining for a number of years. Canadian crudes were enjoying a premium.”

The good times ended in mid-November after the 550,000 barrels per day (bbl/d) Keystone pipeline leaked 5,000 barrels (bbl) in South Dakota and backed up the already full to bursting system.

“Toward the end of the year we saw pressure beginning to build on the system. As storage becomes [scarcer], people who own storage are obviously going to charge more for it and we think that’s contributing to the wide differentials at this point,” Birn said.

That differential reached the mid-$20 range in December and by Jan. 29 the spread was $28.05, even as the WTI broached $65. While American oil producers enjoyed revenues not seen since early 2015, their Canadian counterparts received a much lower price.

The solution to the pipeline backup would normally be higher shipments by rail, but two factors conspired to frustrate producers.

One, Canadian railways were already busy with other commodities, especially grain. Two, producers and traders were reluctant to lock themselves into the more expensive rail option (rail costs $10/bbl to $12/bbl to the U.S. Gulf Coast, while pipeline tolls are around $8/bbl) while at the same time the railways were demanding contracts to be at least a year long, sometimes more.

“Railroads are a complicated and efficient industry. What the producers are looking for is a more efficient mode of rail transport which is known as a unit train, which is a dedicated train of 104 tank cars with three engines that moves from point A to point B as quickly as possible,” Birn said.

While unit trains cost less for producers, railways are looking to cover the higher upfront costs since most Canadian freights move through the east and west coasts, meaning higher north and south traffic may require additional infrastructure. Longer contracts provide more security for the railways.

“Canadian producers are now at the mercy of rail given that current pipes are near capacity and production continues to grow as legacy oil sands projects ramp up,” Michael Tran, director of energy strategy at RBC Capital Markets, told Reuters. “This pricing underscores how fragile the Canadian energy industry is due to lack of pipeline takeaway capacity.”

Not all producers suffered equally. Some of the larger companies—like oil-sands giant Cenovus Energy’s (NYSE: CVE) 77,000 bbl/d Bruderheim rail terminal located near Edmonton—have their own oil-by-rail loading facilities.

“Having our own crude-by-rail loading facility also decreases the risk of having to compete for potentially expensive capacity during periods of pipeline constraint,” Reg Curren, Cenovus spokesman, said.

The 1.1 million bbl/d Energy East pipeline was cancelled by TransCanada Corp. (NYSE: TRP) last fall. Kinder Morgan’s (NYSE: KMI) 525,000 bbl/d Trans Mountain Expansion from Edmonton to the West Coast is facing fierce opposition from the British Columbia government and the city of Burnaby, which forced the company to push out the start of construction by 12 months.

Enbridge’s 395,000 bbl/d Line 3 replacement project won’t be completed until 2019. And TransCanada has yet to make a final investment decision on the 830,000 bbl/d Keystone XL project from Alberta to Nebraska that will open more access to Gulf Coast refineries.

That leaves the Canadian industry stuck with rail. Birn believes the dependence on the high cost option will linger for another two or three years.

“Line 3 is an expansion of the mainline; we don’t think that’s going to be big enough to pull all the surplus crude into pipeline. We could be seeing rail moving right through to 2021, which then relies on either Trans Mountain or Keystone being built,” he said.

“It’s a layer of uncertainty that a lot of jurisdictions don’t face. And it can complicate investment decisions in Canada because of it.”