← Back to issue list

apt auto refresh sometimes interferes with my snap builds

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1852618
Type
issue
State
open
Author
~pengale
Labels
Created
Updated
Closed

Current evaluation

snapcraft build fails with dpkg lock error when background apt auto-refresh in multipass VM holds the lock; reporter suspects their own ppa/apt update in a part may be self-inflicted; open 2482 days, 0 comments, no labels, no maintainer interaction.

Suggested action: close stale

Reason: Issue is 2482 days old with zero comments, no labels, and no maintainer interaction. The reporter explicitly notes it may be self-inflicted (adding a PPA and running apt update in a part) and that re-running the build works. The repo's spread test infrastructure already masks unattended-upgrades.service in test VMs (snapcraft/templates/test/spread/.extension), indicating the project is aware of background apt interference in VMs. The underlying race between background apt processes and snapcraft's apt calls is an environmental/usage issue rather than a snapcraft code bug, and the reporter's own workaround (re-run) confirms it's transient.

Impact: 25 Quick Win: 16.25 Staleness: 95 Complexity: 35 Confidence: 60 Support Request: 70

Issue body

I'm running an issue where snapcraft fails with the following output: ----------------------- + snapcraft --debug Launching a VM. Installing build dependencies: libnuma-dev libnuma1 librados-dev librados2 librbd-dev librbd1 libvirt-dev libvirt0 python-pkg-resources python-setuptools python3-pkg-resourc es python3-setuptools E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it? Could not install all requested build packages: libnuma-dev libnuma1 librados-dev librados2 librbd-dev librbd1 libvirt-dev libvirt0 python-pkg-resources python-setuptools py thon3-pkg-resources python3-setuptools ----------------------- It looks like the multipass vm is busy running some automated apt tasks in the background, which means that the snapcraft script can't get a lock when installing packages. Everything works if I run snapcraft again from within the vm, though the error message is annoying to come back to after getting up to get a coffee, expecting the snap to loyally build itself while I am away. :-) This happens when building microstack, usually when I'm re-running a build after making changes (I don't think that I've seen this with a fresh build). My snapcraft yaml can be here: https://opendev.org/x/microstack/src/branch/master/snapcraft.yaml Note that I'm adding a ppa and running apt update as part of the build of the uca-sources part, so this may be a self inflicted wound. I'll experiment with ordering, but would appreciate advice on best practices for handling this situation, if my ppa shenanigans are at fault here ...

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 25
Quick Win: 16.25
Staleness: 95
Complexity: 35
Confidence: 60
Support Request: 70
close stale snapcraft build fails with dpkg lock error when background apt auto-refresh in multipass VM holds the lock; reporter suspects their own ppa/apt update in a part may be self-inflicted; open 2482 days, 0 comments, no labels, no maintainer interaction.
qwen/qwen3.6-35b-a3b
Staleness: 100
Complexity: 15
Confidence: 90
Support Request: 85
close stale User reports snapcraft failures due to apt lock conflicts in Multipass VMs. Issue is 6.7 years old, has zero comments, and describes a known background process race condition.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 35
Confidence: 90
Support Request: 75
close stale Snapcraft build fails due to dpkg lock contention from background apt tasks in Multipass VM. Open for ~6.7 years with no maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 35
Confidence: 90
Support Request: 75
close stale Snapcraft build fails due to dpkg lock contention from background apt processes in Multipass VM. Issue is over six years old, unlabelled, and has received no maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 25
Confidence: 90
Support Request: 80
close stale Snapcraft build fails due to dpkg lock contention from background apt processes in a Multipass VM. Open for over 6 years with no maintainer response or labels.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.