SANTA ROSA, Calif. — California’s multibillion-dollar marijuana industry, by far the nation’s largest, is crawling out from the underbrush after voters opted to legalize cannabis in this month’s election. In Sonoma County alone, an estimated 9,000 marijuana cultivation businesses are operating in a provisional gray market, with few specific regulations, and are now looking to follow the path of the wine industry, which emerged from its own prohibition eight decades ago and rose to the global prominence it enjoys today.

But the bruising ordeals of one of the state’s largest cannabis companies, CannaCraft, have made many in the marijuana industry fearful, and they suggest a long and bumpy road from marijuana’s approval at the ballot box to the same on-the-ground acceptance enjoyed by wine and beer businesses.

CannaCraft produces medical marijuana products, which have been legal in the state for two decades, but operated in a kind of Wild West, unregulated market. In June, the company’s newly opened headquarters was raided by federal and local law enforcement officers, who said the process it used to make marijuana products was dangerous and illegal. The agents seized $5 million in equipment, inventory and cash. This year, company drivers have twice been stopped by the California Highway Patrol, and, in one case, 1,600 pounds of marijuana was seized.

The business’s troubles may be a sign of things to come after the drug’s broader legalization, as medical cannabis companies like CannaCraft continue to be whipsawed by the lack of clear state regulations and the glaring contradiction between a federal ban on marijuana and still-evolving state laws that should, in theory, shelter the companies from prosecution. Cannabis enterprises deal almost exclusively in cash because banks, fearing federal consequences, will not take their business.