Problem: passlib not installed in "latest" docker version
Issue
When using function "password_hash", the following error occurs (on latest docker image, version "2.11.0-rc1"):
fatal: [xxxxx]: FAILED! =>
msg: Unable to encrypt nor hash, passlib must be installed. No module named 'passlib'. Unable to encrypt nor hash, passlib must be installed. No module named 'passlib'
Note: this can be fixed by manually changing into docker container and installing passlib like:
$ docker exec -it <container id> bash
$ pip install passlib
One additional question is, if a "rc" version should be tagged as "latest" because I would interpret the "latest" tag as latest stable version. Downgrading was not possible (likely because of the database being upgraded to 2.11).
Impact
Ansible (task execution)
Installation method
Docker
Database
MySQL
Browser
No response
Semaphore Version
v2.11.0-rc1
Ansible Version
No response
Logs & errors
No response
Manual installation - system information
No response
Configuration
No response
Additional information
No response
Same Issue, same output
ansible to the rescue
- name: Need a dependency for semaphore ansible.builtin.pip: name: passlib
Hello, same issue for me with the latest version.
Someone have a permanent fix ?
Temporary Fix:
If you’re encountering the error “Unable to encrypt nor hash, passlib must be installed. No module named ‘passlib’”, try the following steps to reinstall/downgrade Passlib on the semaphore container(semaphore-semaphore-1):
pip3 uninstall passlib
pip3 install passlib==1.7.1
Did work for me! :)
Other temporary fix :
Add a task on localhost to install passlib before the execution of others task using passlib
Hi @mhtalci, @ksourdrille
Looks like it is not documented, but you can use requirements.txt near the config.json. By default /etc/semaphore/requirements.txt.
This file will be used inside container lik:
pip3 install --upgrade -r "${SEMAPHORE_CONFIG_PATH}/requirements.txt"
Can you please fix this in the new version? semaphoreui/semaphore/deployment/docker/runner/Dockerfile => line 87 => pip3 install --upgrade pip ansible==${ANSIBLE_VERSION} boto3 botocore requests pywinrm passlib
Thank you
update docker compose file to include a mount for requirements.txt, this worked for me.
requirements.txt
passlib==1.7.1
docker-compose.yml
volumes:
- ./config/ansible.cfg:/etc/ansible/ansible.cfg
- ./config/requirements.txt:/etc/semaphore/requirements.txt
passlib is required to create user passwords in ansible. Which is a really frequent operation. I think passlib should be added by default in every future docker image update. At now I should manually install it everytime container is recreated.