The chronically glitchy computer system that forms the backbone of Pennsylvania's medical marijuana program crashed Thursday morning, causing several dispensaries to halt sales and turn away patients.

The software company MJ Freeway was awarded a $10.4 million contract by the Pennsylvania Department of Health in 2017 to trace all of the state's medical cannabis commerce from "seed to sale." The Denver-based company tracks every plant that is grown, every sale that is recorded, and every patient and medical practitioner who participates in the program in Pennsylvania.

But MJ Freeway software has been plagued by hacks, hiccups, and data breaches since the launch of the program, according to users.

"There have been many issues with the MJ Freeway software that have affected our ability to operate our business, but this isn't about us or an inconvenience, it's about the patients across the state of Pennsylvania that have been prevented from getting their medicine and that is simply unacceptable," said Trent Hartley, cofounder of Cresco Yeltrah, which operates a grow house and three dispensaries in Western Pennsylvania.

"Can you imagine going to a Walgreens or CVS to get your medicine and being told you couldn't get it because the computer system was down?"

A spokeswoman for MJ Freeway said an "enhancement" to the software was released overnight.

"It made it a better system," said Jeannette Horton. "But sometimes when that happens, it triggers other stuff — things running slowly and timing out. It was different from client to client. It's not ideal."

John Collins, Pennsylvania director of the Office of Medical Marijuana, said the glitches were likely due to the system update.

"Our system is unique in that it not only tracks medication but also registers sales," Collins said. "This is new to growers and dispensaries that may have operations in other states. There can be technical issues as there are when updates are pushed out."

More than a half-dozen marijuana growers and dispensary owners say they have wrestled with the software since the first day of medical marijuana sales in February, when shipments were delayed because cultivators couldn't get the system to record the product as it was leaving the grow houses.

"All our patients have been pretty understanding, but it's become a bit of a running joke with them. When the process is slow, they say 'Oh, is MJ Freeway down again?'" said Rob Stanley, store manager of Restore Integrative Wellness Center in Philadelphia's Fishtown neighborhood. "I don't know what the software is when I go to the Gap to buy a pair of jeans, but everyone knows about MJ Freeway."

Many growers and dispensary owners are reluctant to speak about their problems on the record, fearing reprisals from the state Health Department. Several of those growers and shop owners are waiting to learn whether they will be awarded permits to operate more dispensaries. They fear that complaining will jeopardize their chances of winning new permits which are valued at tens of millions of dollars apiece.

"It's a nightmare we've been living with for nearly a year," said one dispensary owner, who did not want to be identified. "The entire system is broken. We can't receive goods. We can't sell to anyone. People are disgusted."

Horton, the MJ Freeway spokeswomen, said "clients reported system issues including slowdowns and errors" at 4 a.m. Philadelphia time on Thursday. By 2:15 p.m. the platform returned to being "fully operational and running at normal speed," said Horton. "The system did not go down. Performance issues caused lag times and some pages did not show up-to-date info."

She said dispensaries could record sales temporarily with "paper and pen."

But the state on Wednesday explicitly prohibited dispensaries from making sales unless the transactions were recorded in the MJ Freeway system.

"They're not supposed to use paper, it's a diversion issue," said Health Department spokeswoman April Hutcheson. "It's a security issue."

But many dispensaries have been doing just that, using Microsoft Excel and old-fashioned accounting paper — what they call "emergency kits" — to record the arrival of the medicines and note sales to patients for the last six months.

Dispensaries were obligated to buy the equipment that runs the MJ Freeway system at a cost of about $10,000.

MJ Freeway was awarded the $10.4 million contract, though it scored lower on technical merits than its rivals. Despite at least two "catastrophic hacks," data breaches, and other glitches, MJ Freeway won because it undercut the competition by several million dollars, bid documents show.