Deborah Madden, 62, of San Mateo, faced a federal charge of obtaining the cocaine from the laboratory in 2009 by means of fraud, misrepresentation, deception, forgery or subterfuge.
U.S. District Judge Susan Illston declared the mistrial after jurors told her following deliberations spread over four days that they could not reach a unanimous verdict.
Illston set a hearing for Oct. 12 to discuss future steps including a possible retrial.
Jurors leaving the courtroom, who declined to be identified, said they agreed that Madden took cocaine, but disagreed on whether prosecutors proved that she did so by means of deception.
"We couldn't agree on whether it was deceitful or misrepresentation," one juror said.
The jurors said they split by either a 10-2 or a 9-3 vote at various times in favor of conviction.
They said they couldn't agree on whether Madden's allegedly deceptive acts, such as restapling cocaine evidence envelopes and working extra hours at night, were for the purpose of taking cocaine or for other purposes, such as keeping her job.
Madden's pilfering of small amounts of cocaine in 2009 contributed to the Police Department's closure of the lab's narcotics analysis unit in 2010 and the San Francisco district attorney's dismissal of hundreds of criminal cases.
Defense attorney Paul DeMeester said after the mistrial, "We are very pleased there has not been a conviction.
"The decision is up to the U.S. attorney on whether there will be a retrial, but we hope for the best.
"Debbie has been through a lot in the past three years and we hope that these efforts will come to an end," he said.
U.S. Attorney's Office spokesman Jack Gillund declined to comment Wednesday.
During the trial, DeMeester conceded to the jury that Madden had taken cocaine, but argued that prosecutors hadn't proved the element of deception required for a conviction on the federal charge.
"There's nothing scheming or fraudulent about it. She's just taking what's in front of her when she works," DeMeester told the jury in his closing argument on Monday.
Prosecution evidence in the trial took three days last week. The defense presented no witnesses and instead relied on the argument that prosecutors hadn't proved their case.
In a taped interview played for the jury, Madden admitted to police investigators in 2010 that she took small amounts of cocaine at least five times between October and December 2009, but maintained she took only trace amounts spilled during weighing.
She said she began taking cocaine to try to control an alcohol problem.
Prosecutors presented evidence at the trial that analysts at the California Department of Justice reweighed 200 evidence envelopes prepared at the lab's drug unit in 2009 and found that eight appeared to be missing cocaine.
Two each showed a loss about 3 grams of cocaine since their initial weighing at the lab and the others each lacked less than a gram, according to the evidence.
In a separate state case, Madden was convicted in San Mateo County Superior Court in 2011 of possessing 0.09 grams of cocaine found in a search of her home in March 2010. She was sentenced to undergo drug counseling.
Madden was a civilian employee at the laboratory in offices at the former Hunters Point Naval Shipyard for 29 years.
She went on leave and entered an alcohol and drug rehabilitation program in December 2009 and retired permanently in March 2010.
U.S. prosecutors stepped into the case and obtained a grand jury indictment on the federal charge in 2011 after the California attorney general's office announced it would not file state charges in connection with the laboratory because of insufficient evidence.
The charge of obtaining a federally controlled drug by fraud or deception is sometimes used to prosecute doctors and pharmacists who falsify records to acquire prescription drugs for their own use or for friends, DeMeester told the jury.
The cocaine-fraud charge also contained a lesser included charge of simple possession of cocaine in violation of federal law. DeMeester conceded at the trial that the evidence supported a conviction on that charge.
But the jurors were told they could not consider the lesser charge unless they reached a not-guilty verdict on the main count.
The fraud charge carried a potential sentence of up to four years in prison upon conviction, while the possession charge had a maximum sentence of one year.
Jurors initially informed Illston in a note Wednesday morning that they were at an impasse on the fraud charge and asked whether they could go on to render a verdict on the possession charge.
After the judge told them they could not do so, the jurors continued deliberating and then told the court at about 2 p.m. that they could not reach a verdict.