Skip to content

fix(fleet): wait for apt-daily/unattended-upgrades instead of failing on the apt lock - #58

Merged
ralyodio merged 1 commit into
mainfrom
fix/apt-lock-wait
Oct 14, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/apt-lock-wait

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Fleet upgrade on chovy1 failed with E: Could not get lock /var/lib/apt/lists/lock. It is held by process … (apt-get) because apt-daily/unattended-upgrades was mid-run; by hand a minute later it worked.

The apt upgrade step now:

  • waits (up to 10 min, polling every 5s) while any apt/apt-get/dpkg process is running, printing one line that it is waiting (unattended-upgr is excluded because its shutdown helper idles forever);
  • passes -o DPkg::Lock::Timeout=600 to both apt-get update and apt-get upgrade for any remaining race.

Tested: fleet-core vitest 137/137, sh -n on the generated script, and a stub-pgrep run that waits two polls and then runs both apt-get commands.

🤖 Generated with Claude Code

… on the apt lock

A fleet upgrade that landed while apt-daily held /var/lib/apt/lists/lock
failed with 'Could not get lock' (chovy1), though the same command worked by
hand a minute later. The apt step now waits up to 10 minutes for running
apt/apt-get/dpkg processes and passes DPkg::Lock::Timeout=600 to apt-get.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit d8f0e34 into main Oct 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant