Systemcheck broken after last update

Systemcheck doesn’t work anymore on whonix workstation, using whonix stable proposed updates repository. Apt packages and dist upgrade are done without problems and there’s nothing to be updated, not sure what’s the problem. That’s what I get after running systemcheck gui.

ERROR: Check ‘privleapd --check-config’ result: System misconfiguration detected. No need to panic. This is not a severe issue. However, other tests may be affected due to this.

The following command:
privleapd --check-config ; echo $?
did not produce an empty output with an exit code of zero, indicating an unexpected result.

exit_code: 1

privilege_escalation_tool_output:
Error processing line 1 of /usr/lib/python3/dist-packages/distutils-precedence.pth: Traceback (most recent call last): File “”, line 192, in addpackage File “”, line 1, in File “”, line 1178, in _find_and_load File “”, line 1149, in _find_and_load_unlocked File “”, line 690, in _load_unlocked File “”, line 936, in exec_module File “”, line 1073, in get_code File “”, line 1130, in get_data PermissionError: [Errno 13] Permission denied: ‘/home/user/.local/lib/python3.11/site-packages/_distutils_hack/init.py’ Remainder of file ignored Traceback (most recent call last): File “/usr/bin/privleapd”, line 9, in from privleap import privleapd File “/usr/lib/python3/dist-packages/privleap/privleapd.py”, line 29, in import sdnotify # type: ignore ^^^^^^^^^^^^^^^ File “”, line 1178, in _find_and_load File “”, line 1149, in _find_and_load_unlocked File “”, line 690, in _load_unlocked File “”, line 936, in exec_module File “”, line 1073, in get_code File “”, line 1130, in get_data PermissionError: [Errno 13] Permission denied: ‘/home/user/.local/lib/python3.11/site-packages/sdnotify/init.py’
ERROR: Check ‘leaprun check-privleap’ result: System misconfiguration detected. No need to panic. This is not a severe issue. However, other tests may be affected due to this.

The following command:
leaprun check-privleap ; echo $?
did not produce an empty output with an exit code of zero, indicating an unexpected result.

exit_code: 0

privilege_escalation_tool_output:
Error processing line 1 of /usr/lib/python3/dist-packages/distutils-precedence.pth: Traceback (most recent call last): File “”, line 192, in addpackage File “”, line 1, in File “”, line 1178, in _find_and_load File “”, line 1149, in _find_and_load_unlocked File “”, line 690, in _load_unlocked File “”, line 936, in exec_module File “”, line 1073, in get_code File “”, line 1130, in get_data PermissionError: [Errno 13] Permission denied: ‘/home/user/.local/lib/python3.11/site-packages/_distutils_hack/init.py’ Remainder of file ignored
ERROR: Check ‘leaprun check-privleap-environment-variables’ result: System misconfiguration detected. No need to panic. This is not a severe issue. However, other tests may be affected due to this.

The following command:
leaprun check-privleap-environment-variables ; echo $?
did not produce an empty output with an exit code of zero, indicating an unexpected result.

exit_code: 0

privilege_escalation_tool_output:
Error processing line 1 of /usr/lib/python3/dist-packages/distutils-precedence.pth: Traceback (most recent call last): File “”, line 192, in addpackage File “”, line 1, in File “”, line 1178, in _find_and_load File “”, line 1149, in _find_and_load_unlocked File “”, line 690, in _load_unlocked File “”, line 936, in exec_module File “”, line 1073, in get_code File “”, line 1130, in get_data PermissionError: [Errno 13] Permission denied: ‘/home/user/.local/lib/python3.11/site-packages/_distutils_hack/init.py’ Remainder of file ignored
ERROR: Check ‘leaprun check-sudo’ result: System misconfiguration detected. No need to panic. This is not a severe issue. However, other tests may be affected due to this.

The following command:
leaprun check-sudo ; echo $?
did not produce an empty output with an exit code of zero, indicating an unexpected result.

exit_code: 0

privilege_escalation_tool_output:
Error processing line 1 of /usr/lib/python3/dist-packages/distutils-precedence.pth: Traceback (most recent call last): File “”, line 192, in addpackage File “”, line 1, in File “”, line 1178, in _find_and_load File “”, line 1149, in _find_and_load_unlocked File “”, line 690, in _load_unlocked File “”, line 936, in exec_module File “”, line 1073, in get_code File “”, line 1130, in get_data PermissionError: [Errno 13] Permission denied: ‘/home/user/.local/lib/python3.11/site-packages/_distutils_hack/init.py’ Remainder of file ignored
ERROR: ###############################################################################

systemcheck script bug.

No panic. Nothing is broken. Just some rare condition has been hit.

Try again later. There is likely a solution for this problem.

Please see News, Blog and User Help Forum.

Please report this bug!

identifier:

IDENTIFIER: systemcheck

exit_code: 0

error_cause: error_handler called with error_text:

(Tor Connection Result:)
(Technical information:)
(tor_bootstrap_percent: 0)
(tor_circuit_established: Error processing line 1 of /usr/lib/python3/dist-packages/distutils-precedence.pth: Traceback (most recent call last): File “”, line 192, in addpackage File “”, line 1, in File “”, line 1178, in _find_and_load File “”, line 1149, in _find_and_load_unlocked File “”, line 690, in _load_unlocked File “”, line 936, in exec_module File “”, line 1073, in get_code File “”, line 1130, in get_data PermissionError: [Errno 13] Permission denied: ‘/home/user/.local/lib/python3.11/site-packages/_distutils_hack/init.py’ Remainder of file ignored 1)
(tor_circuit_established_word: not established)
(tor_bootstrap_timeout_type: )
(tor_bootstrap_status: )
(check_socks_port_open_test: 22)
(systemcheck_tor_bootstrap_waited_seconds: 300)
(systemcheck_tor_bootstrap_wait_max: 300)

(whonix_firewall_status_word: consecutive_run)
(whonix_firewall_status_notification: consecutive run after boot)

(time_synchronization_status_word: success)
(time_synchronization_msg: Success.)

(anondate_issue: )
(anondate_recommendation: )

(anondate_debugging_information: )

For debugging, run:

systemcheck --debug

Clean the output and report to developers.

#########################################################################

1 Like

To make it a bit easier to read command output here, you can wrap text in “code fences”. Text written like:

```
this
```

turns into:

this

(Those are backtick characters, you can type them using the key directly to the left of the 1 key if you’re using a US English keyboard layout.)

As for the actual error itself, it looks like the core problem is that /home/user/.local/lib/python3.11/site-packages/_distutils_hack/init.py and /home/user/.local/lib/python3.11/site-packages/sdnotify/init.py aren’t readable by your user. There’s two strange things to note here:

  • For one, these Python libraries are in your local user account, they’re not the system-wide libraries privleap is designed to use.
  • For two, your user account appears to be unable to open files that your user should own, given that those files are in your home directory.

The following info will probably be helpful for debugging this:

  • Did you pip install anything recently? If so, what?
  • Open a new terminal and run echo $PYTHONPATH. What is the output from that command?
  • Run stat /home/user/.local/lib/python3.11/site-packages. What is the output of that command?
  • Run stat /home/user/.local/lib/python3.11/site-packages/sdnotify/init.py. What is the output of that command?
  • Run stat /home/user/.local/lib/python3.11/site-packages/_distutils_hack/init.py. What is the output of that command?

When all is said and done, you really shouldn’t be using user-local libraries to run privleap commands, that’s a potential security risk and can cause problems like this. We’ll probably push an update that will keep anything privleap-related from using user-local libraries in the near future. At the same time, you probably should be able to read the files Python is having problems reading. If you used chown or chmod on Python-related files in your home directory, maybe that’s why this issue is surfacing now?

1 Like

Thanks for explaining code fences. I didn’t install anything pip related lately.

for echo $PYTHONPATH , I get no output ;

for stat /home/user/.local/lib/python3.11/site-packages :

  File: /home/user/.local/lib/python3.11/site-packages
  Size: 12288     	Blocks: 24         IO Block: 4096   directory
Device: 8,3	Inode: 4594356     Links: 152
Access: (0755/drwxr-xr-x)  Uid: ( 1000/    user)   Gid: ( 1000/    user)
Access: 2025-04-30 21:09:43.426822707 +0000
Modify: 2025-04-26 16:35:48.669525671 +0000
Change: 2025-04-29 21:03:59.421647515 +0000
 Birth: 2024-11-24 09:29:30.017915854 +0000

stat /home/user/.local/lib/python3.11/site-packages/sdnotify/init.py

stat: cannot statx '/home/user/.local/lib/python3.11/site-packages/sdnotify/init.py': No such file or directory
zsh: exit 1     stat /home/user/.local/lib/python3.11/site-packages/sdnotify/init.py

stat /home/user/.local/lib/python3.11/site-packages/_distutils_hack/init.py

stat: cannot statx '/home/user/.local/lib/python3.11/site-packages/_distutils_hack/init.py': No such file or directory
zsh: exit 1     stat /home/user/.local/lib/python3.11/site-packages/_distutils_hack/init.py

In both folders I can see __ init __ , not sure if it can be helpful, I didn’t change anything with chmod lately

1 Like

Just fixed by simply renaming the two __ files to init.py , but I wonder what went wrong with the updating part.

1 Like

I think something is still wrong. When I do apt-get-update or upgrade-nonroot or similiar commands I get this error:

Error processing line 1 of /home/user/.local/lib/python3.11/site-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "<frozen site>", line 192, in addpackage
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'add_shim'

Remainder of file ignored
Error processing line 1 of /usr/lib/python3/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "<frozen site>", line 192, in addpackage
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'add_shim'

Remainder of file ignored

Not sure if it got fixed by just renaming or something is still wrong. I tried to remove the file “distutils-precedence.pth” and I don’t get that error anyway, still not sure if it’s the right thing to do.

1 Like

Maybe this environment variable will help as a temporary workaround.

export PYTHONNOUSERSITE=1

Permissions Fix might help.


Or (temporarily) deleting / moving the whole folder /home/user/.local/lib/python3.11 out of the way if you don’t need it.


To ignore user local python inside user home folder, we might be able to fix this by modifying all our python scripts shebang from:

#!/usr/bin/python3 -u

to:

#!/usr/bin/python3 -u -s

1 Like

Development comment:

Unfortunately, the kernel shebang mechanism does not support multiple command line arguments.

But

#!/usr/bin/python3 -su

will work.

Test script:

#!/usr/bin/python3 -su
#!/usr/bin/python3 -s
#!/usr/bin/python3 -u

import sys

def is_unbuffered():
    return sys.stdout.buffer.__class__.__name__ == "FileIO"

print("unbuffered (-u):", is_unbuffered())
print("no_user_site (-s):", sys.flags.no_user_site == 1)

Depending on the shebang, the flags will change as expected.

This is better than using a wrapper.

1 Like