NICE, Calif. — An abandoned recreational vehicle was the first clue. In this hamlet two hours north of San Francisco and barely a mile from the largest natural freshwater lake in the state, the trailer sat on a hill, hidden from the main drag. Behind it rose a flimsy fence, tall enough to shield its bounty: 50 marijuana plants in hastily constructed wooden boxes.

“This is common,” said Michael Lockett, the chief building official here in Lake County, giving a tour of the now-derelict plot, where a pipe ran from a stream to a large water tank.

It was just one of hundreds of illegal marijuana operations in Lake County, officials said, some of which have been diverting water for thousands of plants.

The scene has been repeated across Northern California. Amid the state’s crippling drought, many communities are fighting not the mere cultivation of cannabis — which is legal in the state, though subject to myriad restrictions — but the growers’ use of water. Marijuana is a thirsty plant, and cultivating it at a time when California residents are subject to water restrictions has become a sticky issue.