Across the state, ballots are waiting behind closed doors, and sometimes underground, for Election Day on Tuesday.

A vault malfunction in Barnstable delayed September’s primary voting, forcing the town to print new ballots and keep the polls open late. A locksmith finally got through to the unmarked ballots that evening after nine hours of work.

With the general election this Tuesday, Barnstable’s vault still hasn’t been repaired. But the new ballots are safe and secure.

“We have more than one vault here at Town Hall,” said Town Clerk Anne Quirk.

Like Barnstable, other Massachusetts cities and towns keep their ballots locked in vaults and keypad-guarded rooms ahead of elections. Multiple town clerks said they're the only staff with keys to their vaults, and locking up ballots is a commonsense measure, said Debra O’Malley, Director of Communications with the secretary of state’s office. With the permanent introduction of early and mail-in voting, O’Malley said many municipalities are also storing their already-cast ballots in vaults, as well.

In the leadup to a statewide election, the state government sends ballot information to a vendor, who prints ballots and ships them off to cities and towns, explained Angela Jack, the town clerk in Ashby.

In Acushnet, ballots arrived at town hall roughly three or four weeks before the election. Like other ballots across the state, they then spent time in a vault. Holyoke’s registrar of voters Brenna McGee said her city keeps unused ballots “locked in an election room that is alarmed.” She hasn’t had any vault issues in the past.

In Mashpee, Town Clerk Deb Kaye started working for the local government in the 1980s, when the town printed its own paper ballots.

“Back then, there were no machines,” she recalled. “You had a group of people that came in after 8 o’clock. They counted out their sheets into batches of 50. And it was a lot of fun. You got 25 bucks for it.”

Elections are administered differently nowadays — and Mashpee’s ballots are printed by the state. Right now, they’re sitting in — you guessed it — the town vault.

In the small town of Bernardston, just south of Brattleboro, Vt., officials had the locks on their vault replaced after they ran into problems with their keys. The vault is now all set for this election.

“That was before we even received all the ballots for this season, for this election,” said Town Clerk Christina Slocum-Wysk. “We made sure everything is working properly.”

The vault where ballots are stored in the basement of Brookline Town Hall has an advantage: it has two doors, so even if there’s an issue with one, there’s a second point of access. Town Clerk Ben Kaufman said he checked his locks after hearing about the mishap in Barnstable in September. Everything worked fine.

“We've never had issues with ballots before we send them out,” Kaufman said, noting that issues are more likely to happen afterwards.

“Sometimes voters will fill out a mailed ballot using all kinds of equipment,” the Brookline official said. “So we encourage our voters to use black ballpoint pens and avoid things like crayons or sharpies that can sometimes make the ballots difficult to read.”

Kaye in Mashpee isn’t worried about running into her neighbors’ kerfuffle. The troublesome vault in Barnstable was more than 60 years old; Mashpee’s was installed in 1997, she said.

“I trust my vault,” she said. “Nobody gets in.”