For the past few weeks, Daniel Davies has felt like he’s living out the plot of a Kafka story: trapped inside a bureaucracy seemingly hell-bent on his undoing.

Since December, Davies has been happily plying his trade as a sports and medical massage therapist in the compact office he’s leasing from ActivSpace on 18th Street in the Mission District.

ActivSpace rents offices to hundreds of small businesses at that location — marriage counselors, hairstylists, acupuncturists, psychotherapists, clothiers, tattoo artists, and at least one “intuitive counselor,” who claims to have been “voted San Francisco’s best psychic of 2009.” The company has similar multi-office locations in Berkeley, Seattle and Portland.

But two weeks, ago, Davies arrived at his office to find a violation notice from the Department of Public Health tacked to his door. His and similar violations at the building could result in a mass eviction of small entrepreneurs from ActivSpace who may be operating businesses that are illegal because they’re out of step with the building’s zoning.

The violation said Davies needed a health permit to work as a massage therapist inside ActivSpace, and he had 40 days to get one before he’d be forced to find a new place to work.

In all, 51 businesses at ActivSpace — 44 massage therapists and seven tattoo artists — received similar notices, according to the Department of Public Health, which also notified an ActivSpace vice president in Seattle of the violations.

Davies was surprised but unconcerned at first. He expected to fill out some paperwork at the Planning Department and pay a fee. But he quickly realized his problems were much worse: Planning officials, Davies said, told him that the ActivSpace building was zoned for light-industrial and manufacturing use — known as “production, design and repair” or PDR — not for massage businesses like his.

That meant no approval from the Planning Department. Without the health permit, he and dozens of other body workers might soon have to find a new place to work. Compounding the problem, Davies said that ActivSpace has asked the businesses to determine by Sunday whether they’ll be able to stay in the building.

Surrounded by similar professionals and with round-the-clock access to his office — and a rent of just $735 a month — the ActivSpace location is appealing to Davies, whose clients include tech executives and members of the San Francisco Ballet.

“It’s a really nice community. I was just super stoked to be in the Mission,” he said.

ActivSpace co-founder Jude Siddall declined to comment, referring inquiries to the company’s attorney, Steve Vettel at the law firm Farella Braun + Martel. Vettel said he had become aware of the issue on Wednesday.

“We received the notice, we’re aware of the situation and we’re evaluating the situation,” he said, declining to comment further.

The plight of ActivSpace’s massage workers was first reported by Mission Local. But the zoning issue for the body workers could prove to be the bleeding edge of even bigger problems for hundreds of ActivSpace’s tenants on 18th Street. Davies said ActivSpace’s management told him the building had around 300 offices.

By his estimation, only a quarter of those offices are occupied by light-industrial or manufacturing businesses — what the building is zoned for. That could mean that hundreds of small-business owners could technically be operating illegal businesses under the city’s zoning laws.

They’re not doing their due diligence and they’re waving people through the door with a smile on their face and a check in their pocket,” Davies said of his landlord.

The company was notified by city officials in 2004 that the units were to be rented for “arts activities, light manufacturing, and home and business services,” according to a document reviewed by The Chronicle.

Part of the problem appears to be the staggering complexity of the city’s planning codes and zoning laws. ActivSpace’s zoning might accommodate some businesses like nail salons or therapists, but there is a lack of clarity about what business might be unintentionally operating illegally in the building.

“It’s a zoning nightmare,” said Candace Combs, president of the Mission Creek Merchants Association, who has been working to wrangle support for the massage therapists.

She’s also the owner of In-Symmetry Spa, which does massage work but is not located inside ActivSpace. Combs also blames legislation passed by former Supervisor Katy Tang that tightened regulations on massage businesses in San Francisco. In an effort to root out prostitution and human trafficking inside illegal massage parlors, Combs said Tang’s “ridiculous” law has made it tough for legitimate massage businesses to operate.

Supervisor Hillary Ronen is considering amending Tang’s law in light of what’s happening at ActivSpace, she said Thursday.

It’s one of a number of legislative strategies her office is considering to help the massage therapists and tattoo artists in ActivSpace and any other business at risk of shuttering because of zoning issues. She’s asked ActivSpace tenants to attend a meeting at 2:30 p.m. Friday at 2730 21st St. so she can hear from business owners.

“I’m in the process of trying to figure out, with the city attorney’s office, how we can legislate to provide some protection to businesses that depend on this venue, without rewarding the landlord who, potentially, has knowingly violated the law,” Ronen said, in renting spaces to businesses that conflict with the building’s zoning.

“City officials have the power to spot-zone or re-zone or just figure this out,” Davies said. “It’s pushing bits of paper and pen. They have the power to say, ‘I can’t afford to have that many businesses go belly-up in this district.’”

Dominic Fracassa is a San Francisco Chronicle staff writer. Email: dfracassa@sfchronicle.com Twitter: @dominicfracassa