Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

LOS ANGELES — The High Times Cannabis Cup, which features hip-hop stars, pot sales and a namesake produce competition, survived 30 years of the war on drugs only to face a more daunting challenge: bureaucracy in the era of legalization.

The San Bernardino, California, City Council late Wednesday denied High Times' application the needed approval to run the event, one of the largest of its kind in the nation.

The three-day pot festival in San Bernardino was at the last-minute mercy of state and local officials after new state regulations on marijuana, designed in part to implement the will of voters who wanted recreational cannabis in 2016, kicked in on Jan. 1. Since then, approval from local jurisdictions has been needed before the state will green light such gatherings.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The 6-0 city council vote to deny High Times a permit means Cannabis Cup and its estimated 20,000 attendees would effectively have to go cannabis-free at the event held annually around April 20, better known to marijuana enthusiasts as 4/20.

A customer checks a strain of marijuana at the High Times Harvest Cup, a spin-off of the popular Cannabis Cup, in San Bernardino in November 2017. Richard Vogel / AP

A representative for the publication told the council that if the plug was pulled, High Times might have to offer refunds for tickets, which ranged from $60 up to $420. She also said it was possible the music portion of the festival could carry on as planned.

The Cannabis Cup boasted headline rappers Nas, Lil Wayne, 2 Chainz, Rick Ross and others as part of its lineup. Normally fans would also be able to purchase exotic strains of marijuana at booths at the venue, the National Orange Show Events Center.

Earlier Wednesday, High Times publicist Jon Cappetta indicated to NBC News that he expected the permitting process would be smooth sailing despite the last-minute scramble. And Lori Ajax, chief of the California Bureau of Cannabis Control, said in an email to the city that the event would be allowed by her agency if the council gave its blessing.

But council members Virginia Marquez and John Valdivia expressed deep reservations about the legality of the event — city legal staffers said applicants are supposed to receive local approval 60 days before the start of a festival in order to get state approval — and so they offered a successful motion to deny the marijuana portion of the festival.

The SoCal Cannabis Cup is this Friday - Sunday in San Bernardino! Vendors, music, See you there. Tickets & info at https://t.co/z3bf2G7Cth #SoCal #HighTimes #CannabisCup pic.twitter.com/Tz170Brhsh — High Times (@HIGH_TIMES_Mag) April 18, 2018

Earlier this week the state Bureau of Cannabis Control issued a warning to so-called 4/20 festivals hoping to slip below the regulatory radar: Participating in an unlicensed 4/20 event or selling marijuana without a permit "may lead to civil penalties for unlicensed commercial cannabis activity."

A High Times representative at the city council meeting blamed a lack of "clear guidance" on the part of the state, but the mayor and other council members noted that Californians approved legal recreational pot nearly a year and a half ago. And Councilwoman Bessine L. Richard said High Times has been selling tickets to the festival for months.

It's not the first time the Cannabis Cup has run afoul of local authorities. In 2013 a festival scheduled for Los Angeles was forced to find a new home in San Bernardino after organizers said they faced opposition from the Los Angeles Police Department. Then, in 2016, the flagship 4/20 event was moved from the Denver area to San Bernardino after officials in Adams County, Colorado, rejected the festival.