Skip to content
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

Python Warning @ dom0 update #7505

Closed
johnnyboy-3 opened this issue May 11, 2022 · 13 comments · Fixed by QubesOS/qubes-mgmt-salt-dom0-update#20
Closed

Python Warning @ dom0 update #7505

johnnyboy-3 opened this issue May 11, 2022 · 13 comments · Fixed by QubesOS/qubes-mgmt-salt-dom0-update#20
Labels
affects-4.1 This issue affects Qubes OS 4.1. C: mgmt C: updates diagnosed Technical diagnosis has been performed (see issue comments). P: major Priority: major. Between "default" and "critical" in severity. pr submitted A pull request has been submitted for this issue. r4.1-dom0-stable T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@johnnyboy-3
Copy link

Qubes OS release

R4.1

Brief summary

Manually updating dom0 by cli gives a python line buffering warning, and a bogus cache cleaning warning in the output

# sudo qubesctl --show-output state.sls update.qubes-dom0

[WARNING ] /usr/lib/python3.8/site-packages/salt/utils/files.py:396: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
  f_handle = open(*args, **kwargs)  # pylint: disable=resource-leakage

local:
----------
          ID: /etc/yum.repos.d/qubes-dom0.repo
    Function: file.replace
      Result: True
     Comment: No changes needed to be made
     Started: 09:20:44.495878
    Duration: 14.632 ms
     Changes:   
----------
          ID: /etc/yum.repos.d/qubes-templates.repo
    Function: file.replace
      Result: True
     Comment: No changes needed to be made
     Started: 09:20:44.510676
    Duration: 2.045 ms
     Changes:   
----------
          ID: update
    Function: cmd.run
        Name: if qubes-dom0-update --quiet --assumeyes --clean --action=clean expire-cache >/dev/null 2>&1; then
    echo "result=True comment='Cache cleaned'"
else
    echo "result=False comment='Could not clean cache'"
fi

      Result: True
     Comment: Cache cleaned
     Started: 09:20:44.514937
    Duration: 3851.347 ms
     Changes:   
----------
          ID: update
    Function: pkg.uptodate
      Result: True
     Comment: System is already up-to-date
     Started: 09:20:49.789651
    Duration: 203855.47 ms
     Changes:   

Summary for local
------------
Succeeded: 4
Failed:    0
------------
Total states run:     4
Total run time: 207.723 s

Steps to reproduce

Run sudo qubesctl --show-output state.sls update.qubes-dom0 in dom0 using terminal

Expected behavior

No warnings and a proper update message

Actual behavior

Python warning & bogus cache cleaning bash script except

@johnnyboy-3 johnnyboy-3 added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. labels May 11, 2022
@andrewdavidwong andrewdavidwong added needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. C: updates labels May 11, 2022
@andrewdavidwong andrewdavidwong added this to the Release 4.1 updates milestone May 11, 2022
@yanakieff
Copy link

I have the same problem.

Fresh 4.1 install, tried to update dom0 following the update Qubes doc page instructions.

Although after the python error nothing else happens until ctrl+c.

@andrewdavidwong andrewdavidwong added P: major Priority: major. Between "default" and "critical" in severity. and removed P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. labels May 31, 2022
@DemiMarie
Copy link

I think this is a bug in Salt but am not sure.

@yanakieff
Copy link

One correction.

If I wait a little bit longer I get the same log after the python warning.

With the difference it says that run time is far greater. Not 207 but 39000ms.

How can I update, can I use securely the next option from the update guide?

In dom0: qubes-dom0-update --clean -y

@tzwcfq
Copy link

tzwcfq commented Jun 3, 2022

I think this is a bug in Salt but am not sure.

Yes it is and it can be fixed for now like this:
saltstack/salt#57584 (comment)

If you’d like to have an example for where to apply this workaround: Simply modify the file.replace use in your SLS to include bufsize: file, e.g.

add_login_group_to_winbind_ssh_access_list:
file.replace:
- name: '/etc/security/pam_winbind.conf'
- pattern: '^(require_membership_of = )(.*)$'
- repl: '\1\2,append-new-group-to-line'
- bufsize: file

@andrewdavidwong andrewdavidwong added diagnosed Technical diagnosis has been performed (see issue comments). pr submitted A pull request has been submitted for this issue. and removed needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. labels Jun 3, 2022
@qubesos-bot
Copy link

Automated announcement from builder-github

The component mgmt-salt-dom0-update (including package qubes-mgmt-salt-dom0-update-4.1.9-1.fc32) has been pushed to the r4.1 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component mgmt-salt-dom0-update (including package qubes-mgmt-salt-dom0-update-4.1.9-1.fc32) has been pushed to the r4.1 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

@johnnyboy-3
Copy link
Author

So, this warning is still open. Unlike this issue?

@andrewdavidwong andrewdavidwong added needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. and removed diagnosed Technical diagnosis has been performed (see issue comments). labels Nov 28, 2022
@andrewdavidwong
Copy link
Member

andrewdavidwong commented Nov 28, 2022

@johnnyboy-3, just to confirm, you have qubes-mgmt-salt-dom0-update-4.1.9-1.fc32 or later, right?

I'm no longer seeing the Python warning.

@andrewdavidwong andrewdavidwong added the more info needed Requires more information before a diagnosis can be made or action can be taken. label Nov 28, 2022
@johnnyboy-3
Copy link
Author

johnnyboy-3 commented Dec 2, 2022

I think so:

# sudo dnf info qubes-mgmt-salt-dom0-update.noarch
Qubes OS Repository for Dom0                                                                                                                 0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'qubes-dom0-cached':
  - Curl error (37): Couldn't read a file:// file for file:///var/lib/qubes/updates/repodata/repomd.xml [Couldn't open file /var/lib/qubes/updates/repodata/repomd.xml]
Error: Failed to download metadata for repo 'qubes-dom0-cached': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Ignoring repositories: qubes-dom0-cached
Installed Packages
Name         : qubes-mgmt-salt-dom0-update
Version      : 4.1.9
Release      : 1.fc32
Architecture : noarch
Size         : 117 k
Source       : qubes-mgmt-salt-dom0-update-4.1.9-1.fc32.src.rpm
Repository   : @System
From repo    : qubes-dom0-cached
Summary      : Custom 'pkg' module that enables state files to install or update packages in dom0
URL          : http://www.qubes-os.org/
License      : GPL 2.0
Description  : Custom 'pkg' module that enables state files to install or update packages in dom0

btw: I didn't run qubes-dom0-update but sudo qubesctl --show-output state.sls update.qubes-dom0

@marmarek
Copy link
Member

marmarek commented Dec 2, 2022

There is qubes-mgmt-salt-dom0-update 4.1.10 in testing repository, which may fix this issue as a side effect too.
But, this specific warning should be gone already with the version you have. Maybe it's a different message? Can you paste it in full? And also, can you list versions of all qubes packages in dom0 (use rpm -qa 'qubes*' command)?

@johnnyboy-3
Copy link
Author

$ sudo qubesctl --show-output state.sls update.qubes-dom0
local:
----------
          ID: /etc/yum.repos.d/qubes-dom0.repo
    Function: file.replace
      Result: True
     Comment: No changes needed to be made
     Started: 08:31:07.461807
    Duration: 9.977 ms
     Changes:   
----------
          ID: /etc/yum.repos.d/qubes-templates.repo
    Function: file.replace
      Result: True
     Comment: No changes needed to be made
     Started: 08:31:07.471905
    Duration: 1.372 ms
     Changes:   
----------
          ID: update
    Function: cmd.run
        Name: if qubes-dom0-update --quiet --assumeyes --clean --action=clean expire-cache >/dev/null 2>&1; then
    echo "result=True comment='Cache cleaned'"
else
    echo "result=False comment='Could not clean cache'"
fi

      Result: True
     Comment: Cache cleaned
     Started: 08:31:07.474695
    Duration: 3445.53 ms
     Changes:   
----------
          ID: update
    Function: pkg.uptodate
      Result: True
     Comment: System is already up-to-date
     Started: 08:31:12.379858
    Duration: 200888.496 ms
     Changes:   

Summary for local
------------
Succeeded: 4
Failed:    0
------------
Total states run:     4
Total run time: 204.345 s

and

$ sudo qubes-dom0-update
Using sys-whonix as UpdateVM to download updates for Dom0; this may take some time...
No updates available

rpm -qa 'qubes*'

qubes-mgmt-salt-dom0-4.1.16-1.fc32.noarch
qubes-gpg-split-dom0-2.0.63-1.fc32.x86_64
qubes-menus-4.1.13-1.fc32.noarch
qubes-db-libs-4.1.13-1.fc32.x86_64
qubes-artwork-4.1.12-1.fc32.noarch
qubes-mgmt-salt-base-4.1.4-1.fc32.noarch
qubes-manager-4.1.25-1.fc32.noarch
qubes-gui-daemon-4.1.25-1.fc32.x86_64
qubes-mgmt-salt-dom0-qvm-4.1.4-1.fc32.noarch
qubes-desktop-linux-manager-4.1.15-1.fc32.noarch
qubes-core-admin-client-4.1.26-1.fc32.noarch
qubes-core-qrexec-4.1.18-1.fc32.x86_64
qubes-utils-libs-4.1.16-1.fc32.x86_64
qubes-release-notes-4.1-2.fc32.noarch
qubes-mgmt-salt-4.1.16-1.fc32.noarch
qubes-repo-templates-4.1.2-1.fc32.noarch
qubes-audio-dom0-4.1.25-1.fc32.x86_64
qubes-libvchan-xen-4.1.10-1.fc32.x86_64
qubes-core-dom0-linux-kernel-install-4.1.23-1.fc32.x86_64
qubes-db-dom0-4.1.13-1.fc32.x86_64
qubes-core-admin-addon-whonix-4.1.1-1.fc32.noarch
qubes-mgmt-salt-base-config-4.1.1-1.fc32.noarch
qubes-input-proxy-receiver-1.0.28-1.fc32.x86_64
qubes-mgmt-salt-config-4.1.16-1.fc32.noarch
qubes-core-qrexec-dom0-4.1.18-1.fc32.x86_64
qubes-mgmt-salt-dom0-virtual-machines-4.1.17-1.fc32.noarch
qubes-desktop-linux-common-4.1.13-1.fc32.noarch
qubes-anaconda-addon-4.1.8-1.fc32.noarch
qubes-usb-proxy-dom0-1.1.2-1.fc32.noarch
qubes-artwork-plymouth-4.1.12-1.fc32.noarch
qubes-dom0-meta-packages-4.1.21-1.fc32.noarch
qubes-db-4.1.13-1.fc32.x86_64
qubes-mgmt-salt-dom0-update-4.1.9-1.fc32.noarch
qubes-rpm-oxide-0.2.5-1.fc32.x86_64
qubes-input-proxy-1.0.28-1.fc32.x86_64
qubes-img-converter-dom0-1.2.12-1.fc32.x86_64
qubes-artwork-anaconda-4.1.12-1.fc32.noarch
qubes-mgmt-salt-admin-tools-4.1.16-1.fc32.noarch
qubes-template-fedora-36-xfce-4.0.6-202205270243.noarch
qubes-gui-dom0-4.1.25-1.fc32.x86_64
qubes-core-dom0-linux-4.1.23-1.fc32.x86_64
qubes-core-dom0-4.1.29-1.fc32.noarch
qubes-release-4.1-2.fc32.noarch
qubes-mgmt-salt-base-topd-4.1.3-1.fc32.noarch
qubes-input-proxy-sender-1.0.28-1.fc32.x86_64
qubes-audio-daemon-4.1.25-1.fc32.x86_64
qubes-utils-4.1.16-1.fc32.x86_64
qubes-pdf-converter-dom0-2.1.13-1.fc32.x86_64
qubes-core-qrexec-libs-4.1.18-1.fc32.x86_64

hope this helps.

@andrewdavidwong andrewdavidwong removed the more info needed Requires more information before a diagnosis can be made or action can be taken. label Dec 3, 2022
@marmarek
Copy link
Member

marmarek commented Dec 5, 2022

I don't see the python warning in this output, so, what is wrong?

@johnnyboy-3
Copy link
Author

I'm sorry - you are absolutely right.
I must have mixed up the python warning with

    Name: if qubes-dom0-update --quiet --assumeyes --clean --action=clean expire-cache >/dev/null 2>&1; then
echo "result=True comment='Cache cleaned'"

else
echo "result=False comment='Could not clean cache'"
fi

@andrewdavidwong andrewdavidwong added diagnosed Technical diagnosis has been performed (see issue comments). and removed needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. labels Dec 5, 2022
@andrewdavidwong andrewdavidwong added the affects-4.1 This issue affects Qubes OS 4.1. label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.1 This issue affects Qubes OS 4.1. C: mgmt C: updates diagnosed Technical diagnosis has been performed (see issue comments). P: major Priority: major. Between "default" and "critical" in severity. pr submitted A pull request has been submitted for this issue. r4.1-dom0-stable T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants