Nafta wasn’t the only source of turmoil and potential political trouble for Prime Minister Justin Trudeau this week.

The already overheated debate over expanding the Trans Mountain pipeline from Alberta to an oil tanker port in the Vancouver suburb of Burnaby became even hotter on Thursday when the Federal Court of Appeal slapped down the government for not conducting sincere and meaningful consultations with Indigenous people. The court also ordered the National Energy Board to look at the environmental effects of more tankers in the waters off British Columbia’s coast.

[Read: Canadian Court Halts Expansion of Trans Mountain Oil Pipeline]

Though the project is unpopular with many Liberal supporters, the government had solidly backed the expansion of the pipeline it is soon to purchase, in part as a way to get Alberta onside with its carbon tax program. So it wasn’t surprising to see an angry Rachel Notley, Alberta’s premier, appearing on television a few hours after the news broke to announce that her province’s government was pulling out of the carbon reduction program until construction workers actually start building the pipeline expansion.

But Ms. Notley, whose political fortunes also rest on the project, wasn’t the only person with tart words for Mr. Trudeau. Many Indigenous groups, who were the main applicants in the lawsuit, called on the prime minister to kill the expansion, as did environmentalists and politicians on the left.

Some are opposed because the pipeline mainly carries oil from Alberta’s oil sands, which they regard as a particularly polluting energy source. Others, including John Horgan, the premier of British Columbia, fear catastrophe if a tanker sinks or splits open off the province’s coast.