SAN FRANCISCO — As the novel coronavirus rages on, few industries have experienced quite as many highs and lows as California’s cannabis industry.

Just a month ago, it looked like California’s weed trade was headed for a shutdown, which would have landed a devastating blow to many businesses that are already struggling. Then, state officials deemed pot “essential,” and many stores reported the biggest days of sales since recreational marijuana became legal. Now, a more sobering reality is setting in: The marijuana industry is unable to tap into a federal stimulus package or bank loans.

“There’s no money that’s going to be coming into the sector,” says Nicholas Kovacevich, CEO of KushCo Holdings, a major distributor to marijuana dispensaries. “All of these companies, including us, need to get profitable really quickly or risk running out of money.”

For industries like California’s pot business that were already on the brink, the coronavirus crisis represents a make-or-break moment. Many retailers and restaurants have shut in the past month for the stay-at-home order, unsure whether they’ll reopen when it’s over. Like grocers, the marijuana industry’s ability to operate during the pandemic offers a much-needed source of revenue. But for the pot business, the lack of a safety net, access to banking or the ability to tap into federal stimulus dollars means the tiniest misstep could lead to bankruptcy.

“We saw the potential to lose everything and then have the state or federal government not have our backs at all. It was very scary,” said Dave Wingard, who owns Flora Terra, a marijuana cultivator and dispensary in Santa Rosa, Calif., with his wife, Alicia. They had finally gotten their business up and running last fall after a year and a half of cutting through red tape.

On March 16, when many Americans were still trying to figure out whether the coronavirus was a big deal, six counties in the San Francisco Bay area ordered residents to “shelter in place,” effectively shutting down the economy that is home to Silicon Valley, including the cannabis industry.

For many Californians who rely on marijuana for everything from stress relief to treating post-traumatic stress disorder and cancer, the decision to bar marijuana businesses from operating was a blunder. The backlash was swift and deafening. Matt Haney, a San Francisco supervisor, voiced support on Twitter. “They shouldn’t be told to close. They obviously serve as pharmacies for a lot of people,” he said.

The next day, the San Francisco Department of Public Health reversed the decision, calling marijuana an “essential service.” Other states like Vermont, Illinois, Michigan and Colorado followed suit, allowing marijuana businesses to stay open during shutdowns.

“The fact that yesterday’s vice is considered today’s essential service suggests that we got the potential costs and benefits of marijuana use radically wrong,” said Joseph E. Kennedy, a law professor at the University of North Carolina. “It’s evidence of the schizoid attitude our society has toward drugs in general and toward marijuana in particular."

The designation by Bay Area governments was a major milestone for an industry that was ravaged by a war on drugs and survived years of turmoil since legalization. California was the first U.S. state to legalize medicinal marijuana in 1996, but the industry was marred by periodic crackdowns by federal law enforcement. In 2016, following Colorado and other states, voters approved recreational sales, prompting an investment boom. Many predicted that it would bring it out from the shadows, turning the once underground drug into an over-the-counter commodity.

The opposite happened. The state began heavily taxing the product, and local municipalities tacked on their own taxes and fees, which boosted prices. Many towns opted to block marijuana dispensaries from opening up nearby, choking the ability of legal operators to distribute their goods.

Tom Adler, owner of Wonder Extracts, which had been selling medicinal marijuana since the ’90s, says his business margins over the past two years were cut by 75 percent in part because of increased costs associated with regulation and high taxes — far from his “huge” expectations for the business when it was legalized four years ago.

With the drug legalized, underground dealers felt emboldened to expand their operations, setting up expansive delivery networks, undercutting the prices of legal pot and depriving the state of marijuana revenue. California initially expected about $1 billion in new tax revenue in 2018. It took in $342 million. Untaxed and unpoliced, black-market pot is estimated to be much larger than the legal trade in California.

Hampered by a morass of regulation, local opposition to stores and a thriving black market, many marijuana businesses have shuttered. The vaping crisis, which was linked to the marijuana business because the pens are a popular method for smoking pot, last fall scared away investors and sent pot stocks plummeting.

When the Bay Area designated dispensaries essential businesses and customers rushed to stock up, it created one of the few bright spots in the state’s economy.

The owner of Foggy Daze Delivery, who goes by the name Evrett, was so busy the day after the stay-at-home order that he became a delivery driver himself. He made 39 deliveries that day, driving all over San Francisco handing bags full of weed to grateful customers. “We genuinely believe we’re performing an essential service,” he said.

“The fact that they’re allowed to be open is huge,” said Fiona Ma, the California state treasurer who said she hopes marijuana will help buoy the state’s tax revenue, which is sure to be drastically down this year. “Obviously, it’s going to help,” she said. But she cautioned that the illicit marijuana business is likely also bustling, with even less enforcement because of stay-at-home orders.

Now, California’s cannabis workers have the undesirable distinction of being front-line workers during a pandemic operating on razor-thin margins and zero federal support.

Logistical hurdles such as setting up a drive-through operation — a public health requirement — and protecting employees from the virus have added costs. Meanwhile, business owners had to pay for extended sick leave for employees who aren’t working during the pandemic because of new requirements in the Families First Coronavirus Response Act.

Brandon Levine, owner of Mercy Wellness in Cotati, Calif., said when he received an alert on his mobile phone that cannabis stores will be limited to curbside delivery, he and his employees wasted no time getting to work designing a drive-through store in the parking lot. They stayed up until 1 a.m. setting it up.

“Our industry, the people in it are resilient and open-minded. We’re talking about cannabis here, so you have to be a little bit open-minded,” he said.

Last week, Rep. Ed Perlmutter of Colorado (D) said he is pushing to include marijuana businesses in the next federal stimulus package. Democratic Sens. Ron Wyden and Jeff Merkley, both of Oregon, are also supporting that change.

The industry has some unusual challenges when it comes to stopping germs. Unlike most businesses these days, the marijuana trade is heavily reliant on cash transactions because banks have largely shunned the sector.

Hard Car, a security company that caters to the marijuana business, performs a function that sounds arcane in the year 2020: In addition to distributing cannabis products, it transfers large sums of cash to the federal reserve for marijuana companies that can’t get a bank to serve them because of federal restrictions.

Todd Kleperis, the company’s co-founder, said he anticipated the coronavirus would be a problem and ordered 3,000 face masks and gloves for his workers early last month. Once Hard Car’s drivers are done with a delivery, drivers take off their masks and gloves and use hand sanitizer and clean the vehicles, some of which have air filters that can stop viruses. Drivers are told to regularly change their masks to avoid risking infection.

In Santa Rosa, the Wingards’ Flora Terra business saw an initial spike after the industry was deemed essential. Since then, they are seeing better revenue overall, but not enough.

That burden on small businesses is supposed to be compensated by the new federal stimulus bill that offers small businesses what is essentially free money to make up for added costs. But the Wingards won’t be eligible for that aid because the federal government deems their business illegal.

“I don’t know where it’s going to go,” Dave Wingard said. “It’s hard. It’s a tough business. … We’re going to try our best.”