Problem
After upgrading to 7.4 (linuxmuster-tools7 7.4.13), linuxmuster-api.service
fails to start:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/linuxmusterApi/main.py", line 19, in <module>
from utils.checks import check_tmp_dir
File "/usr/lib/python3/dist-packages/linuxmusterApi/utils/checks.py", line 6, in <module>
from linuxmusterTools.passwords import PasswordRules
File "/usr/lib/python3/dist-packages/linuxmusterTools/passwords/__init__.py", line 1, in <module>
from .policy import *
File "/usr/lib/python3/dist-packages/linuxmusterTools/passwords/policy.py", line 21, in <module>
from linuxmusterTools.samba_util import DomainPasswordSettings, DomainPasswordSettingsManager
File "/usr/lib/python3/dist-packages/linuxmusterTools/samba_util/__init__.py", line 7, in <module>
from .dns import *
File "/usr/lib/python3/dist-packages/linuxmusterTools/samba_util/dns.py", line 4, in <module>
import pexpect
ModuleNotFoundError: No module named 'pexpect'
Root cause
usr/lib/python3/dist-packages/linuxmusterTools/samba_util/dns.py imports
pexpect directly, but pexpect is not listed in
usr/lib/python3/dist-packages/linuxmusterTools/requirements.txt:
configobj
python-ldap
pyyaml
smbprotocol==1.14.0
It happens to already be present as a transitive dependency pulled in by
linuxmuster-webui7's own separate requirements (aj -> pexpect), which
apparently masked this for consumers that get installed alongside webui7,
but any consumer that doesn't happen to pull it in some other way -
linuxmuster-api7 in this case - crashes on import.
Fix
Add pexpect to linuxmusterTools/requirements.txt so it's installed for
every consumer of the shared library, not just ones that happen to need it
transitively for an unrelated reason.
How this was found
Discovered while testing linuxmuster-release-upgrade idempotency (linuxmuster-base7 #191) on a real Ubuntu 26.04 test server upgrading from 7.3 to 7.4.
Problem
After upgrading to 7.4 (linuxmuster-tools7 7.4.13),
linuxmuster-api.servicefails to start:
Root cause
usr/lib/python3/dist-packages/linuxmusterTools/samba_util/dns.pyimportspexpectdirectly, butpexpectis not listed inusr/lib/python3/dist-packages/linuxmusterTools/requirements.txt:It happens to already be present as a transitive dependency pulled in by
linuxmuster-webui7's own separate requirements (aj -> pexpect), whichapparently masked this for consumers that get installed alongside webui7,
but any consumer that doesn't happen to pull it in some other way -
linuxmuster-api7in this case - crashes on import.Fix
Add
pexpecttolinuxmusterTools/requirements.txtso it's installed forevery consumer of the shared library, not just ones that happen to need it
transitively for an unrelated reason.
How this was found
Discovered while testing linuxmuster-release-upgrade idempotency (linuxmuster-base7 #191) on a real Ubuntu 26.04 test server upgrading from 7.3 to 7.4.