The Federal Court of Appeal decision quashing cabinet’s approval of the Trans Mountain pipeline expansion is a huge political setback for the Trudeau government. That it comes on the heels of the government’s reckless decision to buy the existing pipeline for $4.5-billion only complicates matters.

But it would be a mistake to conclude that Ottawa cannot salvage this snake-bitten project. With the proper response, Canada could end up with both a much-needed pipeline expansion and a clearer set of rules for approving projects of this kind.

At the moment, that probably looks like a long shot. Prime Minister Justin Trudeau has spent a lot of political capital on Trans Mountain and has little to show for it.

Story continues below advertisement

Mr. Trudeau believed he could earn the so-called “social license” to build a major fossil-fuel pipeline in the climate-change era by balancing its political negatives against a long list of more virtuous actions: establishing a national carbon tax, killing the Northern Gateway pipeline, banning tankers along the northern British Columbia coast, launching an expensive effort to protect other coastlines from spills and pushing hard on reconciliation.

It was a reasonable gambit, and to some degree it worked. The most recent polls show that more than half of Canadians support the Trans Mountain expansion. And why not – the new pipeline, running along an existing route, would transport Alberta crude to tidewater in a safe and efficient way, and reduce the fossil-fuel industry’s growing dependence on rail transportation.

The problem, as it turns out, is that Mr. Trudeau and his cabinet ministers weren’t wary enough of the approvals process that led them to greenlight the pipeline expansion. Or, perhaps more accurately, they knew it had problems but were hoping for the best.

Thursday’s ruling is not exactly a blanket condemnation of the National Energy Board, the regulatory agency that oversees energy projects that cross provincial or international borders, and whose report on Trans Mountain was the basis for the government’s approval of the project.

But the judges did find a fatal flaw in the NEB’s decision not to review project-related tanker traffic off the B.C. coast.

That meant the NEB didn’t take into account the potential impact of increased tanker traffic on the coastal environment and on a species of killer whales native to the area. As a result, the government “could not rely” on the board’s environmental assessment, the court said.

The court also said that, in its opinion, the NEB failed to adequately discharge its duty to consult all the Indigenous people affected by the pipeline expansion.

Story continues below advertisement

So the court quashed the cabinet’s approval. But it has not killed the project, by any means. The NEB can go back and redo its consultations and assessments, and re-submit its final report to cabinet.

And that’s good news. It will mean more delays. But there is no reason the NEB can’t meet the court’s requirement to properly assess the impact of increased tanker traffic. The NEB might even find that the mitigation efforts already undertaken by the federal government are adequate.

As for consultations with Indigenous people, the NEB clearly needs to do better. But no one should mistake the right to be duly consulted with a veto. As long as there is a meaningful effort to “grapple with the real concerns of the Indigenous applicants so as to explore possible accommodation of those concerns,” the project can go ahead – even if not every accommodation is made.

If there is a lesson to be taken from the Trans Mountain experience, it is that politic trade-offs and “social licences” aren’t enough to build pipelines. It’s the law that matters, and it has to be followed, but Canada’s current approvals regime is clearly not up to the task.

Mr. Trudeau put Canadian taxpayers in a pickle when he used their money to buy the Trans Mountain pipeline. He should still be able to get out of that one, as long as he pushes ahead with the project and makes sure the court’s requirements are met.

But until Canada has a reliable independent system for approving resource projects quickly, while respecting the environment and the duty to consult, we can expect more fiascos of this magnitude.