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

Updates fail when update proxy VM not already running #4096

Open
tasket opened this Issue Jul 17, 2018 · 8 comments

Comments

Projects
None yet
5 participants
@tasket

tasket commented Jul 17, 2018

Qubes OS version:

R4.0

Affected component(s):

Template updates


Steps to reproduce the behavior:

Initiate update procedure for any template whose update proxy is not already running. For example, whonix-ws when sys-whonix is not running.

Expected behavior:

Proxy comes online before update begins, or update waits for proxy to come online.

Actual behavior:

Many 'unable to retrieve' type errors until the update process fails. Update must be coordinated manually instead.

General notes:

The method by which the template's network dependency is satisfied is unlike the normal handling of an assigned netvm; the asynchronous nature doesn't lend itself to predictable updates with normal update clients such as apt, dnf, etc.


Related issues:

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 17, 2018

Member

Does it happen for non-whonix update proxy VMs too?

Member

marmarek commented Jul 17, 2018

Does it happen for non-whonix update proxy VMs too?

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jul 17, 2018

Member

Yes, because qvm-start logic does not analyze /etc/qubes-rpc/policy/qubes.UpdatesProxy.


Qubes-Whonix 14 addresses this and has code to wait which seems to work quite well.

https://github.com/Whonix/qubes-whonix/blob/master/etc/uwt.d/40_qubes.conf

But that is not pretty. I would prefer if Qubes would make update proxy VM start before the TemplateVM starts as it was the case in Qubes R3.2.

In case you want to test:


Related:
#3412

Member

adrelanos commented Jul 17, 2018

Yes, because qvm-start logic does not analyze /etc/qubes-rpc/policy/qubes.UpdatesProxy.


Qubes-Whonix 14 addresses this and has code to wait which seems to work quite well.

https://github.com/Whonix/qubes-whonix/blob/master/etc/uwt.d/40_qubes.conf

But that is not pretty. I would prefer if Qubes would make update proxy VM start before the TemplateVM starts as it was the case in Qubes R3.2.

In case you want to test:


Related:
#3412

@rustybird

This comment has been minimized.

Show comment
Hide comment
@rustybird

rustybird Jul 17, 2018

For non-Whonix templates, I only seem to have this problem when my system is under high load. I'd guess that dnf and maybe apt-get have some sort of (configurable?) minimum throughput or read timeout, so if the updates proxy VM takes too long to start, they give up on the connection. Without retrying - good thing that internet connections are 100% reliable.

I would prefer if Qubes would make update proxy VM start before the TemplateVM starts as it was the case in Qubes R3.2.

Could be pretty rough if you're starting the template for reasons other than installing software, e.g. to edit a configuration file. In the worst case, this would cause sys-net -> sys-firewall -> sys-whonix startup, maybe even a fourth VM if the updates proxy is running in a separate VM. People seemed to dislike that for clock sync (#3588).

For my Whonix templates, I've opted to disable the Whonix safety mechanism by enabling their whonix-secure-proxy qvm-service.

For non-Whonix templates, I only seem to have this problem when my system is under high load. I'd guess that dnf and maybe apt-get have some sort of (configurable?) minimum throughput or read timeout, so if the updates proxy VM takes too long to start, they give up on the connection. Without retrying - good thing that internet connections are 100% reliable.

I would prefer if Qubes would make update proxy VM start before the TemplateVM starts as it was the case in Qubes R3.2.

Could be pretty rough if you're starting the template for reasons other than installing software, e.g. to edit a configuration file. In the worst case, this would cause sys-net -> sys-firewall -> sys-whonix startup, maybe even a fourth VM if the updates proxy is running in a separate VM. People seemed to dislike that for clock sync (#3588).

For my Whonix templates, I've opted to disable the Whonix safety mechanism by enabling their whonix-secure-proxy qvm-service.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jul 17, 2018

Member

Could be pretty rough if you're starting the template for reasons other than installing software, [...]

Fair point. However, Qubes automatically starting dnf / apt-get for updating negates this.

Member

adrelanos commented Jul 17, 2018

Could be pretty rough if you're starting the template for reasons other than installing software, [...]

Fair point. However, Qubes automatically starting dnf / apt-get for updating negates this.

@rustybird

This comment has been minimized.

Show comment
Hide comment
@rustybird

rustybird Jul 17, 2018

However, Qubes automatically starting dnf / apt-get for updating negates this.

If you're opening the template for a quick edit, you have a leisurely ;) 5 minutes until qubes-update-check.timer kicks in. (I usually just disable the qubes-update-check qvm-service.)

However, Qubes automatically starting dnf / apt-get for updating negates this.

If you're opening the template for a quick edit, you have a leisurely ;) 5 minutes until qubes-update-check.timer kicks in. (I usually just disable the qubes-update-check qvm-service.)

@tasket

This comment has been minimized.

Show comment
Hide comment
@tasket

tasket Jul 17, 2018

In addition to whonix templates, a regular template will likely fail if its configured to redirect to an "update VM" that is also dependent on another netvm and they both have to start. For example, a logical combination is:
Mytemplate >> sys-update --> sys-vpn.

For the time being, I'm playing with parsing the qubes.UpdatesProxy policy from my qubes4-multi-update.py script -- though I wish I had a general solution that worked like Whonix 14. I'd rather have some way for the template to test the update proxy connection (hint...).

tasket commented Jul 17, 2018

In addition to whonix templates, a regular template will likely fail if its configured to redirect to an "update VM" that is also dependent on another netvm and they both have to start. For example, a logical combination is:
Mytemplate >> sys-update --> sys-vpn.

For the time being, I'm playing with parsing the qubes.UpdatesProxy policy from my qubes4-multi-update.py script -- though I wish I had a general solution that worked like Whonix 14. I'd rather have some way for the template to test the update proxy connection (hint...).

@tasket

This comment has been minimized.

Show comment
Hide comment
@tasket

tasket Jul 18, 2018

FWIW, I currently cannot reproduce the problem with regular templates after 3 tries (starting 2 upstream VMs each time).

The problem persists for Whonix, however. I am trying a workaround to trigger the update VM to start and then wait for it, like:

curl -s --connect-timeout 30 localhost:8082 >/dev/null
sleep 10s
# start update process...

tasket commented Jul 18, 2018

FWIW, I currently cannot reproduce the problem with regular templates after 3 tries (starting 2 upstream VMs each time).

The problem persists for Whonix, however. I am trying a workaround to trigger the update VM to start and then wait for it, like:

curl -s --connect-timeout 30 localhost:8082 >/dev/null
sleep 10s
# start update process...
@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Jul 21, 2018

Member

Also as far as I understand in Qubes R4, templates are started after being downloaded so they can process /etc/qubes/post-install.d/ (qvm-features-request mechanism) and then shut down. This needs to be kept in mind.

Member

adrelanos commented Jul 21, 2018

Also as far as I understand in Qubes R4, templates are started after being downloaded so they can process /etc/qubes/post-install.d/ (qvm-features-request mechanism) and then shut down. This needs to be kept in mind.

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