semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Problem: passlib not installed in "latest" docker version

Open mtraunau opened this issue 1 year ago • 8 comments

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

mtraunau avatar Dec 22 '24 10:12 mtraunau

Same Issue, same output

ansible to the rescue

  • name: Need a dependency for semaphore ansible.builtin.pip: name: passlib

tuplink avatar Jan 18 '25 14:01 tuplink

Hello, same issue for me with the latest version.

Someone have a permanent fix ?

ksourdrille avatar Jan 28 '25 08:01 ksourdrille

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! :)

mhtalci avatar Feb 15 '25 22:02 mhtalci

Other temporary fix :

Add a task on localhost to install passlib before the execution of others task using passlib

ksourdrille avatar Feb 20 '25 07:02 ksourdrille

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"

fiftin avatar Feb 23 '25 22:02 fiftin

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

Thanoonazad avatar Mar 19 '25 21:03 Thanoonazad

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

roozbehk avatar Apr 12 '25 21:04 roozbehk

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.

raskx avatar May 05 '25 13:05 raskx