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

qubes-db does not work after qubes-db package upgrade, breaks qubes-whonix and tb-updater package #2497

Closed
adrelanos opened this Issue Dec 7, 2016 · 14 comments

Comments

Projects
None yet
3 participants
@adrelanos
Member

adrelanos commented Dec 7, 2016

Processing triggers for qubes-whonix (1:5.7-1) ...
Failed connect to local daemon
Traceback (most recent call last):
  File "/usr/lib/qubes-whonix/replace-ips", line 233, in <module>
    main(sys.argv[1:])
  File "/usr/lib/qubes-whonix/replace-ips", line 204, in main
    if whonix_mode() == 'gateway':
  File "/usr/lib/qubes-whonix/replace-ips", line 79, in whonix_mode
    qubes_vm_type = subprocess.check_output(['qubesdb-read', '/qubes-vm-type']).rstrip()
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['qubesdb-read', '/qubes-vm-type']' returned non-zero exit status 1
dpkg: error processing package qubes-whonix (--unpack):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libglib2.0-0:amd64 (2.42.1-1+b1) ...
Errors were encountered while processing:
 qubes-whonix

Impact: Not great but by rerunning sudo apt-get dist-upgrade the upgrade process eventually completes.

Workaround: I should probably push a Whonix stable upgrade to ignore qubes-db failures?

Long term: Will it be possible in future to restart qubes-db without failure?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 7, 2016

Member

Looks like qubes-db service is stopped because it's being updated too. qubes-db service in VM can be started/stopped/restarted normally. Is it possible to order qubes-whonix config step (trigger step?) after qubes-db config step (so service will be back running)?

Member

marmarek commented Dec 7, 2016

Looks like qubes-db service is stopped because it's being updated too. qubes-db service in VM can be started/stopped/restarted normally. Is it possible to order qubes-whonix config step (trigger step?) after qubes-db config step (so service will be back running)?

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 7, 2016

Member

Dunno. Maybe a debian/control Depends: qubesdb would do? (Or perhaps even a Pre-Depends: is required.) qubes-whonix depending on qubesdb seems sane.

(https://www.debian.org/doc/debian-policy/ch-relationships.html)

Should I depend on qubesdb or qubesdb-vm package?

Member

adrelanos commented Dec 7, 2016

Dunno. Maybe a debian/control Depends: qubesdb would do? (Or perhaps even a Pre-Depends: is required.) qubes-whonix depending on qubesdb seems sane.

(https://www.debian.org/doc/debian-policy/ch-relationships.html)

Should I depend on qubesdb or qubesdb-vm package?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 7, 2016

Member
Member

marmarek commented Dec 7, 2016

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 7, 2016

Member

This also breaks tb-updater during apt-get upgrades.

I wonder if debian/pkg-name.triggers could be somehow converted to systemd units. Because then we wouldn't have this issue. qubesdb already orders itself very early.

Member

adrelanos commented Dec 7, 2016

This also breaks tb-updater during apt-get upgrades.

I wonder if debian/pkg-name.triggers could be somehow converted to systemd units. Because then we wouldn't have this issue. qubesdb already orders itself very early.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 8, 2016

Member

Not sure about that. But even if possible, that would need to be asynchronous (to really wait until qubes-db is started again), which means update may still do something after apt-get finishes. apt-get -y dist-upgrade && poweroff will break things.

Member

marmarek commented Dec 8, 2016

Not sure about that. But even if possible, that would need to be asynchronous (to really wait until qubes-db is started again), which means update may still do something after apt-get finishes. apt-get -y dist-upgrade && poweroff will break things.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 8, 2016

Member

There are also various trigger configurations. But I cannot make head or tail of it.
http://man7.org/linux/man-pages/man5/deb-triggers.5.html

Posted two questions on debian-mentors. (Not yet in archive.)

  • Can debian/pkg.triggers wait for another package's systemd unit file?
  • Convert debian/pkg-name.triggers into systemd unit file?
Member

adrelanos commented Dec 8, 2016

There are also various trigger configurations. But I cannot make head or tail of it.
http://man7.org/linux/man-pages/man5/deb-triggers.5.html

Posted two questions on debian-mentors. (Not yet in archive.)

  • Can debian/pkg.triggers wait for another package's systemd unit file?
  • Convert debian/pkg-name.triggers into systemd unit file?

@andrewdavidwong andrewdavidwong added this to the Release 3.2 updates milestone Dec 8, 2016

adrelanos added a commit to adrelanos/qubes-whonix that referenced this issue Dec 9, 2016

adrelanos added a commit to adrelanos/qubes-whonix that referenced this issue Dec 9, 2016

adrelanos added a commit to Whonix/qubes-whonix that referenced this issue Dec 9, 2016

adrelanos added a commit to Whonix/qubes-whonix that referenced this issue Dec 9, 2016

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 9, 2016

Member

qubes-whonix 5.7.2-1 was added to Whonix jessie-proposed-updates and testers repository.

Member

adrelanos commented Dec 9, 2016

qubes-whonix 5.7.2-1 was added to Whonix jessie-proposed-updates and testers repository.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 10, 2016

Member

debian/control Depends: qubesd-vm fixed this. No longer breaking during apt-get dist-upgrade.

Member

adrelanos commented Dec 10, 2016

debian/control Depends: qubesd-vm fixed this. No longer breaking during apt-get dist-upgrade.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 10, 2016

Member

So, closeable?

Member

marmarek commented Dec 10, 2016

So, closeable?

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 10, 2016

Member

follow up issue for Qubes:
#2509


Setting up qubes-core-agent (3.2.13-1+deb8u1) ...
[...]
Job for qubes-whonix-network.service failed. See 'systemctl status qubes-whonix-network.service' and 'journalctl -xn' for details.
Setting up libqubesdb (3.2.3-1+deb8u1) ...
Setting up qubesdb (3.2.3-1+deb8u1) ...
Setting up qubesdb-vm (3.2.3-1+deb8u1) ..

Not breaking anything [at the moment as that script stays as is], but not great, and looking bad. So desirable to fix. I guess it is happening during a "long" systemd start command during debian postinst so there is a good chance #2509 would fix it.


Setting up tb-updater (3:3.7.9-1) ...
Job for tb-updater-first-boot.service failed. See 'systemctl status tb-updater-first-boot.service' and 'journalctl -xn' for details.
Failed connect to local daemon
  • tb-updater-first-boot.service failing is cosmetic.
  • tb-updater updating Tor Browser in TemplateVM /var/cache/tb-binary is broken which is not critical (in AppVM Tor Browser updates still working; manual run of update-torbrowser in TempalteVM still working), but I want to fix that. Probably by no longer using qubesdb-read but rather /var/run/qubes/this-is-templatevm (qubesdb-read only as fallback for Qubes R3.1 compatibility). [Because tb-updater is a generic package, a dependency on qubesdb-vm would not be great.]
Member

adrelanos commented Dec 10, 2016

follow up issue for Qubes:
#2509


Setting up qubes-core-agent (3.2.13-1+deb8u1) ...
[...]
Job for qubes-whonix-network.service failed. See 'systemctl status qubes-whonix-network.service' and 'journalctl -xn' for details.
Setting up libqubesdb (3.2.3-1+deb8u1) ...
Setting up qubesdb (3.2.3-1+deb8u1) ...
Setting up qubesdb-vm (3.2.3-1+deb8u1) ..

Not breaking anything [at the moment as that script stays as is], but not great, and looking bad. So desirable to fix. I guess it is happening during a "long" systemd start command during debian postinst so there is a good chance #2509 would fix it.


Setting up tb-updater (3:3.7.9-1) ...
Job for tb-updater-first-boot.service failed. See 'systemctl status tb-updater-first-boot.service' and 'journalctl -xn' for details.
Failed connect to local daemon
  • tb-updater-first-boot.service failing is cosmetic.
  • tb-updater updating Tor Browser in TemplateVM /var/cache/tb-binary is broken which is not critical (in AppVM Tor Browser updates still working; manual run of update-torbrowser in TempalteVM still working), but I want to fix that. Probably by no longer using qubesdb-read but rather /var/run/qubes/this-is-templatevm (qubesdb-read only as fallback for Qubes R3.1 compatibility). [Because tb-updater is a generic package, a dependency on qubesdb-vm would not be great.]
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 10, 2016

Member

Probably by no longer using qubesdb-read but rather /var/run/qubes/this-is-templatevm (qubesdb-read only as fallback for Qubes R3.1 compatibility). [Because tb-updater is a generic package, a dependency on qubesdb-vm would not be great.]

Yes, this would be a good solution. If you'd like to keep R3.1 compatibility, check for any /var/run/qubes/this-is-* - if there is none, fallback to qubesdb-read, otherwise proceed with /var/run/qubes/this-is-templatevm

Member

marmarek commented Dec 10, 2016

Probably by no longer using qubesdb-read but rather /var/run/qubes/this-is-templatevm (qubesdb-read only as fallback for Qubes R3.1 compatibility). [Because tb-updater is a generic package, a dependency on qubesdb-vm would not be great.]

Yes, this would be a good solution. If you'd like to keep R3.1 compatibility, check for any /var/run/qubes/this-is-* - if there is none, fallback to qubesdb-read, otherwise proceed with /var/run/qubes/this-is-templatevm

adrelanos added a commit to adrelanos/tb-updater that referenced this issue Dec 14, 2016

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 14, 2016

Member

Yes.

tb-updater is designed not to break upgrading (exit 0) when run from postinst but not from chroot. However, the tool for detection of chroot, ischroot is buggy.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685034

Do we have a more reliable way to detect chroot?

Member

adrelanos commented Dec 14, 2016

Yes.

tb-updater is designed not to break upgrading (exit 0) when run from postinst but not from chroot. However, the tool for detection of chroot, ischroot is buggy.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685034

Do we have a more reliable way to detect chroot?

adrelanos added a commit to adrelanos/tb-updater that referenced this issue Dec 14, 2016

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 16, 2016

Member

Various enhancements were backported and pushed to Whonix 13 stable branch.
https://github.com/Whonix/tb-updater/commits/Whonix13

This is now in Whonix jessie-proposed-updates and testers repository.

Member

adrelanos commented Dec 16, 2016

Various enhancements were backported and pushed to Whonix 13 stable branch.
https://github.com/Whonix/tb-updater/commits/Whonix13

This is now in Whonix jessie-proposed-updates and testers repository.

@adrelanos adrelanos changed the title from qubes-db does not work after qubes-db package upgrade, breaks qubes-whonix package to qubes-db does not work after qubes-db package upgrade, breaks qubes-whonix and tb-updater package Dec 16, 2016

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 18, 2016

Member

This is now also in Whonix jessie (stable) repository. Therefore, close please.

Member

adrelanos commented Dec 18, 2016

This is now also in Whonix jessie (stable) repository. Therefore, close please.

@marmarek marmarek closed this Dec 18, 2016

adrelanos added a commit to Whonix/tb-updater that referenced this issue Dec 19, 2016

adrelanos added a commit to Whonix/tb-updater that referenced this issue Dec 19, 2016

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