The result has been legal limbo: People whose behavior would not now be considered illegal are sometimes unable to find work, get college loans, obtain professional licenses, or find decent housing because of the blot on their record.

Those who argue against expunging criminal records say people who violated the law should live with the consequences, regardless of subsequent legal changes.

“In all the other states, the process has been messy,” said Robert Mikos, a professor at Vanderbilt University who studies marijuana law and policy. “But whether people agree with what they did or not, California at least addressed it and there’s value in that.”

Even in California, there is significant variation in how counties are handling misdemeanor marijuana convictions. Some, like Fresno County, are dealing with them on a case-by-case basis, said Steve E. Wright, the county’s assistant district attorney. Jeff Rosen, district attorney of Santa Clara County, said he was working with the local public defender’s office to identify cases. And prosecutors in San Francisco and San Diego have been more proactive, with both cities planning to automatically dismiss misdemeanor convictions and to reduce felony convictions to misdemeanors.

In San Francisco, Mr. Gascón said he wanted to avoid putting people through a process that he said violates the spirit of legalization.

“A lot of people don’t even know they qualify, and I don’t think it’s the right thing to do to make people pay lawyers’ fees and jump through a bunch of hoops to get something they should be getting anyway,” he said.

In November 2016, California voters approved Proposition 64, which allowed adults 21 and older to buy or possess 28.5 grams of marijuana — about one ounce — or grow up to six plants at a private residence.