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

Upgrading qubes-core-agent in debian-8 template error due to running two apt-gets simultaneously #1889

Closed
isislovecruft opened this Issue Apr 2, 2016 · 17 comments

Comments

Projects
None yet
5 participants
@isislovecruft

When I do:

sudo apt-get install qubes-core-agent

in my debian-8 template, it eventually somewhere calls an apt hook to restart the /etc/systemd/system/qubes-check-update.service systemd service. That service file has:

ExecStart=/bin/sh -c if [ -e /etc/debian_version ]; then apt-get -q update; fi 

...which will obviously fail if called from an apt hook, due to two simultaneous apt sessions being open (i.e. it can't get the dpkg lock). It fails and displays the following output:

Setting up qubes-core-agent (3.1.14-1+deb8u1) ...
Installing new version of config file /etc/NetworkManager/dispatcher.d/qubes-nmhook ...
Installing new version of config file /etc/apt/sources.list.d/qubes-r3.list ...
Installing new version of config file /etc/qubes-rpc/qubes.GetAppmenus ...
Installing new version of config file /etc/qubes-rpc/qubes.InstallUpdatesGUI ...
Installing new version of config file /etc/qubes-rpc/qubes.SetDateTime ...
Installing new version of config file /etc/qubes/iptables.rules ...
Leaving 'diversion of /etc/init/plymouth-shutdown.conf to /etc/init/plymouth-shutdown.conf.qubes-disabled by qubes-core-agent'
Leaving 'diversion of /etc/init/prefdm.conf to /etc/init/prefdm.conf.qubes-disabled by qubes-core-agent'
Leaving 'diversion of /etc/init/splash-manager.conf to /etc/init/splash-manager.conf.qubes-disabled by qubes-core-agent'
Leaving 'diversion of /etc/init/start-ttys.conf to /etc/init/start-ttys.conf.qubes-disabled by qubes-core-agent'
Leaving 'diversion of /etc/init/tty.conf to /etc/init/tty.conf.qubes-disabled by qubes-core-agent'
Leaving 'diversion of /etc/init/serial.conf to /etc/init/serial.conf.qubes-orig by qubes-core-agent'
Job for qubes-update-check.service failed. See 'systemctl status qubes-update-check.service' and 'journalctl -xn' for details.

Running systemctl status qubes-update-check.service shows:

user@debian-8:~  sudo systemctl status qubes-update-check.service
● qubes-update-check.service - Qubes check for VM updates and notify dom0
   Loaded: loaded (/lib/systemd/system/qubes-update-check.service; static)
   Active: failed (Result: exit-code) since Sat 2016-04-02 11:48:21 UTC; 41s ago
  Process: 2208 ExecStart=/bin/sh -c if [ -e /etc/debian_version ]; then apt-get -q update; fi (code=exited, status=100)
 Main PID: 2208 (code=exited, status=100)

Apr 02 11:48:20 debian-8 sh[2208]: Hit http://deb.qubes-os.org jessie...ges
Apr 02 11:48:20 debian-8 sh[2208]: Hit http://deb.qubes-os.org jessie/main...-en
Apr 02 11:48:21 debian-8 sh[2208]: Fetched 157 kB in 13s (12.0 kB/s)
Apr 02 11:48:21 debian-8 sh[2208]: E: Could not get lock /var/lib/dpkg/lock - op...le)
Apr 02 11:48:21 debian-8 sh[2208]: E: Unable to lock the administration director...it?
Apr 02 11:48:21 debian-8 systemd[1]: qubes-update-check.service: main process exi.../a
Apr 02 11:48:21 debian-8 systemd[1]: Failed to start Qubes check for VM updates a...0.
Apr 02 11:48:21 debian-8 systemd[1]: Unit qubes-update-check.service entered fail...e.
Hint: Some lines were ellipsized, use -l to show in full.
@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Apr 2, 2016

Member

Sounds very plausible. I'll be working on this.

Member

adrelanos commented Apr 2, 2016

Sounds very plausible. I'll be working on this.

@adrelanos adrelanos referenced this issue in marmarek/old-qubes-core-agent-linux Apr 2, 2016

Merged

fixed qubes-core-agent upgrading double package manager lock #66

@adrelanos

This comment has been minimized.

Show comment
Hide comment
Member

adrelanos commented Apr 2, 2016

Please check this out when convenient.

https://github.com/marmarek/qubes-core-agent-linux/pull/66

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Apr 13, 2016

Member

https://github.com/marmarek/qubes-core-agent-linux/pull/66#issuecomment-209089524

Not sure where discussion is best. In the ticket or in the pull request? I can imagine a number of people as subscribed to whole qubes-issues but not necessarily to all packages. So I guess discussion here is getting noticed by more people.

I think https://github.com/marmarek/qubes-core-agent-linux/pull/66 goes into the right direction, refactoring wise. But it does not actually solve this issue.

qubes-update-check.service -> upgrades-status-notify -> upgrades-installed-check -> apt-get update -> fail -> exit non-zero -> systemd recognized failed state.

The design of upgrades-status-notify and upgrades-installed-check make sense as is.

What about...

ExecStart=/usr/lib/qubes/upgrades-status-notify

--->

ExecStart=/usr/lib/qubes/upgrades-status-notify || true

?

Member

adrelanos commented Apr 13, 2016

https://github.com/marmarek/qubes-core-agent-linux/pull/66#issuecomment-209089524

Not sure where discussion is best. In the ticket or in the pull request? I can imagine a number of people as subscribed to whole qubes-issues but not necessarily to all packages. So I guess discussion here is getting noticed by more people.

I think https://github.com/marmarek/qubes-core-agent-linux/pull/66 goes into the right direction, refactoring wise. But it does not actually solve this issue.

qubes-update-check.service -> upgrades-status-notify -> upgrades-installed-check -> apt-get update -> fail -> exit non-zero -> systemd recognized failed state.

The design of upgrades-status-notify and upgrades-installed-check make sense as is.

What about...

ExecStart=/usr/lib/qubes/upgrades-status-notify

--->

ExecStart=/usr/lib/qubes/upgrades-status-notify || true

?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Apr 13, 2016

Member

Better ExecStart=-/usr/lib/qubes/upgrades-status-notify
Or maybe even instead of https://github.com/marmarek/qubes-core-agent-linux/pull/66, do
ExecStart=-/bin/sh -c 'if [ -e /etc/debian_version ]; then apt-get -q update; fi' ?
So the failure of apt-get update will not mark the service as failed.

Member

marmarek commented Apr 13, 2016

Better ExecStart=-/usr/lib/qubes/upgrades-status-notify
Or maybe even instead of https://github.com/marmarek/qubes-core-agent-linux/pull/66, do
ExecStart=-/bin/sh -c 'if [ -e /etc/debian_version ]; then apt-get -q update; fi' ?
So the failure of apt-get update will not mark the service as failed.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 14, 2016

Member

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.7-1.fc23 has been pushed to the r3.2 testing repository for the Fedora fc23 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.2-current-testing

Changes included in this update

Member

marmarek commented Jul 14, 2016

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.7-1.fc23 has been pushed to the r3.2 testing repository for the Fedora fc23 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.2-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 14, 2016

Member

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.7-1.fc24 has been pushed to the r3.2 testing repository for the Fedora fc24 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.2-current-testing

Changes included in this update

Member

marmarek commented Jul 14, 2016

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.7-1.fc24 has been pushed to the r3.2 testing repository for the Fedora fc24 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.2-current-testing

Changes included in this update

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jul 14, 2016

Member

I don't think this is fixed. #1889 (comment) still applies. Please reopen.

Member

adrelanos commented Jul 14, 2016

I don't think this is fixed. #1889 (comment) still applies. Please reopen.

@marmarek marmarek reopened this Jul 14, 2016

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 14, 2016

Member

Automated announcement from builder-github

The package qubes-core-agent_3.2.7-1+deb8u1 has been pushed to the r3.2 testing repository for the Debian jessie template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing jessie-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Jul 14, 2016

Automated announcement from builder-github

The package qubes-core-agent_3.2.7-1+deb8u1 has been pushed to the r3.2 testing repository for the Debian jessie template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing jessie-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 14, 2016

Member

Automated announcement from builder-github

The package qubes-core-agent_3.2.7-1+deb9u1 has been pushed to the r3.2 testing repository for the Debian stretch template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing stretch-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Jul 14, 2016

Automated announcement from builder-github

The package qubes-core-agent_3.2.7-1+deb9u1 has been pushed to the r3.2 testing repository for the Debian stretch template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing stretch-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 14, 2016

Member

Automated announcement from builder-github

The package qubes-core-agent_3.2.7-1+deb7u1 has been pushed to the r3.2 testing repository for the Debian wheezy template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing wheezy-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Jul 14, 2016

Automated announcement from builder-github

The package qubes-core-agent_3.2.7-1+deb7u1 has been pushed to the r3.2 testing repository for the Debian wheezy template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing wheezy-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 17, 2016

Member

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.8-1.fc23 has been pushed to the r3.2 testing repository for the Fedora fc23 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.2-current-testing

Changes included in this update

Member

marmarek commented Jul 17, 2016

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.8-1.fc23 has been pushed to the r3.2 testing repository for the Fedora fc23 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.2-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 17, 2016

Member

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.8-1.fc24 has been pushed to the r3.2 testing repository for the Fedora fc24 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.2-current-testing

Changes included in this update

Member

marmarek commented Jul 17, 2016

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.8-1.fc24 has been pushed to the r3.2 testing repository for the Fedora fc24 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r3.2-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 17, 2016

Member

Automated announcement from builder-github

The package qubes-core-agent_3.2.8-1+deb8u1 has been pushed to the r3.2 testing repository for the Debian jessie template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing jessie-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Jul 17, 2016

Automated announcement from builder-github

The package qubes-core-agent_3.2.8-1+deb8u1 has been pushed to the r3.2 testing repository for the Debian jessie template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing jessie-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 17, 2016

Member

Automated announcement from builder-github

The package qubes-core-agent_3.2.8-1+deb9u1 has been pushed to the r3.2 testing repository for the Debian stretch template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing stretch-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Jul 17, 2016

Automated announcement from builder-github

The package qubes-core-agent_3.2.8-1+deb9u1 has been pushed to the r3.2 testing repository for the Debian stretch template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing stretch-testing, then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 28, 2016

Member

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.9-1.fc23 has been pushed to the r3.2 stable repository for the Fedora fc23 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

Member

marmarek commented Jul 28, 2016

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.9-1.fc23 has been pushed to the r3.2 stable repository for the Fedora fc23 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 28, 2016

Member

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.9-1.fc24 has been pushed to the r3.2 stable repository for the Fedora fc24 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

Member

marmarek commented Jul 28, 2016

Automated announcement from builder-github

The package python2-dnf-plugins-qubes-hooks-3.2.9-1.fc24 has been pushed to the r3.2 stable repository for the Fedora fc24 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Aug 31, 2016

Member

Automated announcement from builder-github

The package qubes-core-agent_3.2.10-1+deb8u1 has been pushed to the r3.2 stable repository for the Debian jessie template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Member

marmarek commented Aug 31, 2016

Automated announcement from builder-github

The package qubes-core-agent_3.2.10-1+deb8u1 has been pushed to the r3.2 stable repository for the Debian jessie template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment