-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Problem: ModuleNotFoundError: No module named 'ansible' after upgrade to latest Semaphore release #2740
Comments
Hi @gitmarge I think problem in Python venv environment variable:
This done for security reason. It is a problem, I agree. I implemented page for setup of Semaphore: https://semaphoreui.com/install/binary/2_12/config. It is not complete. I improving it by the users feedback. And I think we need block "VENV settings". Thank you. |
Hello @fiftin Thanks for the reply. However I don't quite understand what would need to be done. I do not use a Python venv, does Semaphore need to be explicitely configured for this use case? The setup page is helpful for certain options, but entering a value in the
Or maybe I'm doing something wrong. But I'm still not quite sure what would need to be configured and where I would configure it. I put the environment variable
Also adding just one of these lines did not work. However I'm sure I am not intended to put these lines into the config and systemd service as is? Thank you very much for your help, I'm looking forward to some more insight and clarification. |
Hi @gitmarge My mistake, looks like you use Ansible installed with You should use system installed Ansible or use VENV. |
I see, thanks for coming back to me. Was this a recent change? Because it was working fine with Ansible installed with the In the meantime, I have rolled back the server to the state before the upgrade and it is working again. Once I upgrade Semaphore, I will make sure to install Ansible via Thanks again. |
@gitmarge hm, it is really strange... I don't know. Can you check environment variables like |
Issue
Upgraded Semaphore with the latest .deb package 2.12.5 on an Ubuntu server virtual machine after several months of running on older release without issues.
After installation with
sudo dpkg -i semaphore.deb
and service start, the website comes up and tasks can be executed, but fail immediately with the following message:
Updating Python environment (3.10), all packages and Ansible via pip did not help solve the issue, neither did a reinstall of the Ansible package.
Semaphore is configured to run as a systemd service without a Python venv. Service comes up without issues.
Impact
Ansible (task execution)
Installation method
Package
Database
MySQL
Browser
Chrome, Microsoft Edge
Semaphore Version
v2.12.5
Ansible Version
Logs & errors
No response
Manual installation - system information
5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Configuration
systemd service file:
Additional information
Running a simple playbook with different modules manually via the command line with user sema works perfectly fine
ansible-playbook -i ./inv pb.yml
One thing I noticed is that if I change the line
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/sema/.local/bin"
in the systemd service file to
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:~/.local/bin"
Semaphore crashes with the following message in the journalctl log, indicating the home directory is not set correctly with ~, however even if it finds the binaries the issue still stands:
The text was updated successfully, but these errors were encountered: