An immigration website that was supposedly overwhelmed by Americans wanting to flee to Canada because of a Trump presidency was more likely brought down by foreigners scrambling to get a basic travel document before a deadline.

CBC News has learned that the website for Immigration, Refugees and Citizenship Canada was already in trouble hours before Donald Trump's victory became clear on Nov. 8, the day of the U.S. presidential election.

That's because foreign travellers faced a Nov. 10 deadline to obtain so-called "electronic travel authorizations" online before they could fly into Canada. They apparently flooded the website before that deadline to pay $7 online for electronic delivery of the mandatory travel documents, known as eTAs.

Immigration and Citizenship Canada website

Technicians took more than 32 hours on Nov. 8-9, 2016 to fix Canada's immigration website, which was flooded with applications from travelers looking for transit documents before a key deadline.

The rush seemed to catch Canada's immigration officials off guard. By about 2 p.m. ET on Nov. 8 — even as Americans were still casting their ballots — the high volume of eTA traffic left the main website "degraded" with "temporary outages."

Technicians with Shared Services Canada were alerted to the problem, but didn't act immediately. It eventually took more than 32 hours to repair the website, by doubling the number of servers to six and increasing the processing capacity. The fix came less than two hours before the Nov.10 eTA deadline, likely frustrating eTA applicants for more than a day.

CBC News obtained internal reports and emails, through the Access to Information Act. They undermine the official version that the website "started to experience difficulties" only at 11 p.m. ET, when Trump's victory had become clear.

"It looks like the eTA is starting to experience significant volumes a few days earlier than planned," said a Shared Services Canada official, in an email written before any U.S. polling stations had even closed.

"The surge to the site seems to have happened sooner than planned," she repeated in a later email.

Although Shared Services Canada technicians were officially told about the web troubles at about 2 p.m. on Nov. 8, they did little to resolve the problems that afternoon.

Worsened through evening

"SSC has indicated that ticket is pending and there's nothing that can be done," an immigration official complained three hours later.

The website problems worsened through the evening, until it crashed.

Shared Services has also been blamed by RCMP Commissioner Bob Paulson for shoddy service that could have "catastrophic" consequences for police and the public.

"I do not understand why an incident started at 2:00 pm yesterday, clearly had public visibility, was not raised to critical, and subsequently the thing fell apart," a Shared Services Canada official said the next day in an email as the website remained overwhelmed.

Senior immigration officials, including aides within the minister's office, were "extremely upset with the lack of attention to this," says another email. Canadian airlines also expressed concern about the gummed-up eTA process.

'The exact cause of this increased traffic throughout this period is unknown.' - Shared Services Canada spokesperson

At the time of the incident, immigration spokespeople told reporters that half the traffic in the late evening came from computers registered in the United States, prompting a flurry of stories, including from CBC and other around the globe, suggesting that upset Americans were contemplating emigration to Canada following the surprise Trump victory.

More than three months later, Shared Services Canada says the reason for the surge in traffic is officially a mystery.

"The exact cause of this increased traffic throughout this period is unknown," spokesperson Caroline Perron said this week, in response to questions from CBC.

Electronic Travel Authorizations, or eTAs, have been available online since Aug. 1, 2015, but were voluntary until an amnesty period ended Nov. 10, 2016. They're not required by Canadian or American citizens, but most foreign travellers, who do not otherwise require a visa to come to Canada, now must obtain them.

No urgency

Perron noted the vast majority of applicants go through the main IRCC website to get to the separate eTA site, which itself did not crash on Nov. 8-9, 2016. She also said the department expected a surge in applications Nov. 10, not two days earlier.

"IRCC expected that some travellers flying to Canada on Nov. 10 would be caught unaware of the eTA requirement and could be applying last minute in order to make their flight," she said.

As for the slow response by technicians on the afternoon of Nov. 8, Perron said there appeared to be no urgency.

"At that time, there was no reason to believe the access to the website would be affected, as the website had faced periods of high traffic in the past and remained accessible," she said.

The released documents do cite the possibility that Americans dismayed by the Trump election results might have added to the website problems.  "As the evening progressed, the pressure was likely caused by election impacts," says one email.

Airport Travel

Internal emails obtained by CBC News show that federal officials were convinced that passengers seeking electronic travel authorization documents, or eTAs, were behind the gumming up of an immigration website. (Seth Wenig/Associated Press)

But another Shared Services Canada official cautioned on Nov. 9, a day after the website problems: "The root cause of the degradation has not yet been determined."

The eTA incident has similarities to another online problem last year, when government spokespeople suggested a census website run by Statistics Canada was simply overwhelmed on May 2 as Canadians enthusiastically participated in the exercise.

In fact, a CBC investigation showed that the website itself had design flaws and wasn't properly tested before going live.

Follow @DeanBeeby on Twitter