Skip to content

staging's test_grsecurity_paxtest fails because unattended-upgrades is running #7410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
legoktm opened this issue Jan 10, 2025 · 2 comments · Fixed by #7418
Closed

staging's test_grsecurity_paxtest fails because unattended-upgrades is running #7410

legoktm opened this issue Jan 10, 2025 · 2 comments · Fixed by #7418
Labels
noble Ubuntu Noble related work

Comments

@legoktm
Copy link
Member

legoktm commented Jan 10, 2025

Description

In test_grsecurity_paxtest we install paxtest if it isn't already. Sometimes it fails if unattended-upgrades is still running and holding the dpkg lock. In 6214f53 I added a stop of unattended-upgrades first, but that doesn't seem to have worked given it failed since then.

E + where 100 = CommandResult(command=b"sudo /bin/sh -c 'apt-get update && apt-get install -y paxtest'", exit_status=100, stdout=b"Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease\nHit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease\nHit:3 http://security.ubuntu.com/ubuntu focal-security InRelease\nHit:4 https://apt-test.freedom.press/ focal InRelease\nErr:4 https://apt-test.freedom.press/ focal InRelease\n The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 545E94503FAB65AB\nReading package lists...\n", stderr=b"W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://apt-test.freedom.press/ focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 545E94503FAB65AB\nW: Failed to fetch https://apt-test.freedom.press/dists/focal/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 545E94503FAB65AB\nW: Some index files failed to download. They have been ignored, or old ones used instead.\nE: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 6231 (unattended-upgr)\nE: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?\n").rc

We could check stdout to see this failure and then retry after waiting? Or more aggressively wait for the dpkg lock to be open before running.

https://serverfault.com/questions/221871/how-do-i-check-to-see-if-an-apt-lock-file-is-locked may have ideas.

@legoktm legoktm moved this to Ready to go in SecureDrop dev cycle Jan 10, 2025
@legoktm legoktm added the noble Ubuntu Noble related work label Jan 14, 2025
@legoktm
Copy link
Member Author

legoktm commented Jan 14, 2025

Tagging as noble related because we're planning to use a similar mechanism to stop unattended-upgrades from running during the noble migration.

I wonder if this is intentional because unattended-upgrades.service contains KillMode=process, which is documented as allowing "processes to escape the service manager's lifecycle and resource management, and to remain running even while their service is considered stopped and is assumed to not consume any resources".

@legoktm
Copy link
Member Author

legoktm commented Jan 16, 2025

I think we could just try this a few times in a loop while checking if the error message says u-u is holding the lock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noble Ubuntu Noble related work
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant