Issue installing GUI domain

Greetings.

I’m using Qubes release 4.2.0-alpha (R4.2).

I have following configuration.

  • Gigabyte X570 Gaming X motherboard
  • AMD Ryzen 7 3800X 8-Core Processor (which doesn’t have iGPU)
  • AMD Radeon RX 6750 XT

I’m trying to setup GPU GUI domain (sys-gui-gpu) according to official guide.

After running

sudo qubesctl --all state.highstate

There was an error about missing fedora-37-xfce template so I installed it

sudo qubes-dom0-update --enablerepo=qubes-template-itl-testing  qubes-template-fedora-37-xfce

Next I repeated command

sudo qubesctl --all state.highstate

There was warning notification that Blueman applet crashed but I think it’s not critical.
The main output is

[user@dom0 ~]$ sudo qubesctl --all state.highstate
/usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
/usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
[WARNING ] State for file: /etc/qubes/policy.d/45-sys-gui-gpu.policy - Neither 'source' nor 'contents' nor 'contents_pillar' nor 'contents_grains' was defined, yet 'replace' was set to 'True'. As there is no source to replace the file with, 'replace' has been set to 'False' to avoid reading the file unnecessarily.
local:
----------
          ID: sys-gui-gpu-template
    Function: qvm.template_installed
        Name: fedora-37-xfce
      Result: True
     Comment: Template fedora-37-xfce version 4.1.0 already installed
     Started: 10:31:38.121032
    Duration: 165.931 ms
     Changes:   
----------
          ID: dummy-psu-sender
    Function: pkg.installed
      Result: True
     Comment: All specified packages are already installed
     Started: 10:31:39.106974
    Duration: 278.714 ms
     Changes:   
----------
          ID: qubes-input-proxy-sender
    Function: pkg.installed
      Result: True
     Comment: All specified packages are already installed
     Started: 10:31:39.385797
    Duration: 15.374 ms
     Changes:   
----------
          ID: /etc/qubes/input-proxy-target
    Function: file.managed
      Result: True
     Comment: File /etc/qubes/input-proxy-target is in the correct state
     Started: 10:31:39.402543
    Duration: 34.36 ms
     Changes:   
----------
          ID: sys-usb-input-proxy
    Function: file.managed
        Name: /etc/qubes/policy.d/45-sys-gui-gpu.policy
      Result: True
     Comment: File /etc/qubes/policy.d/45-sys-gui-gpu.policy exists with proper permissions. No changes made.
     Started: 10:31:39.436992
    Duration: 0.844 ms
     Changes:   
----------
          ID: sys-gui-gpu
    Function: qvm.exists
      Result: True
     Comment: /usr/bin/qvm-check sys-gui-gpu None
     Started: 10:31:39.437901
    Duration: 162.575 ms
     Changes:   
----------
          ID: sys-gui-gpu-rpc
    Function: file.managed
        Name: /etc/qubes/policy.d/50-gui-sys-gui-gpu.policy
      Result: True
     Comment: File /etc/qubes/policy.d/50-gui-sys-gui-gpu.policy is in the correct state
     Started: 10:31:39.600863
    Duration: 2.196 ms
     Changes:   
----------
          ID: sys-gui-gpu-admin-local-rwx
    Function: file.append
        Name: /etc/qubes/policy.d/include/admin-local-rwx
      Result: True
     Comment: File /etc/qubes/policy.d/include/admin-local-rwx is in correct state
     Started: 10:31:39.603173
    Duration: 1.663 ms
     Changes:   
----------
          ID: sys-gui-gpu-admin-global-rwx
    Function: file.append
        Name: /etc/qubes/policy.d/include/admin-global-rwx
      Result: True
     Comment: File /etc/qubes/policy.d/include/admin-global-rwx is in correct state
     Started: 10:31:39.604911
    Duration: 1.244 ms
     Changes:   

Summary for local
------------
Succeeded: 9
Failed:    0
------------
Total states run:     9
Total run time: 662.901 ms
debian-11: SKIP (nothing to do)
fedora-37: SKIP (nothing to do)
whonix-gw-16: SKIP (nothing to do)
whonix-ws-16: SKIP (nothing to do)
/usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
fedora-37-xfce: OK
anon-whonix-old: SKIP (nothing to do)
backup: SKIP (nothing to do)
debian-11-dvm: SKIP (nothing to do)
default-mgmt-dvm: SKIP (nothing to do)
internet: SKIP (nothing to do)
sys-net: SKIP (nothing to do)
sys-whonix: SKIP (nothing to do)
vault-credentials: SKIP (nothing to do)
vault-gpg: SKIP (nothing to do)
vault-ssh: SKIP (nothing to do)
vault-wallets: SKIP (nothing to do)
/usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
vault-work: SKIP (nothing to do)
whonix-ws-16-dvm: SKIP (nothing to do)
work: SKIP (nothing to do)
sys-gui-gpu: ERROR (exit code 20, details in /var/log/qubes/mgmt-sys-gui-gpu.log)

Content of /var/log/qubes/mgmt-sys-gui-gpu.log

[user@dom0 ~]$ cat /var/log/qubes/mgmt-sys-gui-gpu.log
2023-04-26 10:32:22,846 calling 'state.highstate'...
2023-04-26 10:32:53,124 output: sys-gui-gpu:
2023-04-26 10:32:53,125 output: ----------
2023-04-26 10:32:53,125 output:           ID: /home/user/.config/autostart/nm-applet.desktop
2023-04-26 10:32:53,125 output:     Function: file.managed
2023-04-26 10:32:53,125 output:       Result: True
2023-04-26 10:32:53,125 output:      Comment: File /home/user/.config/autostart/nm-applet.desktop is in the correct state
2023-04-26 10:32:53,125 output:      Started: 10:32:52.686957
2023-04-26 10:32:53,125 output:     Duration: 48.722 ms
2023-04-26 10:32:53,125 output:      Changes:   
2023-04-26 10:32:53,125 output: ----------
2023-04-26 10:32:53,125 output:           ID: /home/user/.config/autostart/xscreensaver-autostart.desktop
2023-04-26 10:32:53,125 output:     Function: file.managed
2023-04-26 10:32:53,125 output:       Result: True
2023-04-26 10:32:53,125 output:      Comment: File /home/user/.config/autostart/xscreensaver-autostart.desktop is in the correct state
2023-04-26 10:32:53,125 output:      Started: 10:32:52.735752
2023-04-26 10:32:53,125 output:     Duration: 0.951 ms
2023-04-26 10:32:53,125 output:      Changes:   
2023-04-26 10:32:53,125 output: ----------
2023-04-26 10:32:53,125 output:           ID: /home/user/.config/autostart/qvm-start-daemon.desktop
2023-04-26 10:32:53,125 output:     Function: file.managed
2023-04-26 10:32:53,125 output:       Result: True
2023-04-26 10:32:53,125 output:      Comment: File /home/user/.config/autostart/qvm-start-daemon.desktop is in the correct state
2023-04-26 10:32:53,125 output:      Started: 10:32:52.736754
2023-04-26 10:32:53,125 output:     Duration: 0.987 ms
2023-04-26 10:32:53,125 output:      Changes:   
2023-04-26 10:32:53,126 output: ----------
2023-04-26 10:32:53,126 output:           ID: /rw/config/rc.local
2023-04-26 10:32:53,126 output:     Function: file.append
2023-04-26 10:32:53,126 output:       Result: False
2023-04-26 10:32:53,126 output:      Comment: An exception occurred in this state: Traceback (most recent call last):
2023-04-26 10:32:53,126 output:                 File "/var/tmp/.root_dd8a91_salt/pyall/salt/state.py", line 2171, in call
2023-04-26 10:32:53,126 output:                   ret = self.states[cdata["full"]](
2023-04-26 10:32:53,126 output:                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-04-26 10:32:53,126 output:                 File "/var/tmp/.root_dd8a91_salt/pyall/salt/loader.py", line 2105, in wrapper
2023-04-26 10:32:53,126 output:                   return f(*args, **kwargs)
2023-04-26 10:32:53,126 output:                          ^^^^^^^^^^^^^^^^^^
2023-04-26 10:32:53,126 output:                 File "/var/tmp/.root_dd8a91_salt/pyall/salt/states/file.py", line 6301, in append
2023-04-26 10:32:53,126 output:                   if __salt__["file.search"](
2023-04-26 10:32:53,126 output:                      ^^^^^^^^^^^^^^^^^^^^^^^^
2023-04-26 10:32:53,126 output:                 File "/var/tmp/.root_dd8a91_salt/pyall/salt/modules/file.py", line 3154, in search
2023-04-26 10:32:53,126 output:                   return replace(
2023-04-26 10:32:53,126 output:                          ^^^^^^^^
2023-04-26 10:32:53,126 output:                 File "/var/tmp/.root_dd8a91_salt/pyall/salt/modules/file.py", line 2530, in replace
2023-04-26 10:32:53,126 output:                   flags_num = _get_flags(flags)
2023-04-26 10:32:53,126 output:                               ^^^^^^^^^^^^^^^^^
2023-04-26 10:32:53,126 output:                 File "/var/tmp/.root_dd8a91_salt/pyall/salt/modules/file.py", line 1653, in _get_flags
2023-04-26 10:32:53,126 output:                   _flag = getattr(re, str(flag).upper())
2023-04-26 10:32:53,126 output:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-04-26 10:32:53,126 output:               AttributeError: module 're' has no attribute 'RE.MULTILINE'
2023-04-26 10:32:53,126 output:      Started: 10:32:52.737792
2023-04-26 10:32:53,126 output:     Duration: 3.248 ms
2023-04-26 10:32:53,126 output:      Changes:   
2023-04-26 10:32:53,126 output: 
2023-04-26 10:32:53,126 output: Summary for sys-gui-gpu
2023-04-26 10:32:53,127 output: ------------
2023-04-26 10:32:53,127 output: Succeeded: 3
2023-04-26 10:32:53,127 output: Failed:    1
2023-04-26 10:32:53,127 output: ------------
2023-04-26 10:32:53,127 output: Total states run:     4
2023-04-26 10:32:53,127 output: Total run time:  53.908 ms
2023-04-26 10:32:53,127 exit code: 20

I searched qubes-issues by keyword re.multiline and found this one but it’s closed saying that problem was fixed.
May be this problems are not related.
How could I fix this?

The error you see seems very similar to
the one described in the issue you linked @aon . The file.append command attempts to use an attribute that’s not available in the re module (RE.MULTILINE).

The issue was found to be caused by Salt itself, and a workaround was applied that removed the use of that file.append command. That was only a workaround, and it was applied to a different Salt formula than the one you are using.

I think it would be perfectly fine (and useful) for you to open a new issue in GitHub and mention that it is similar to the one you linked, while explaining that in your case it’s sys-gui-gpu that’s failing.

It may be possible to apply a similar workaround.