shantanoo-desai / komponist

A Composer for your favorite IoT/ IIoT container stacks with Ansible + Jinja2 + Docker Compose v2
GNU Affero General Public License v3.0
25 stars 2 forks source link

Error when encrypting Mosquitto users file on remote ARM device #69

Closed gintasjuk closed 1 year ago

gintasjuk commented 1 year ago

When executing ansible playbook generate_stack.yml on remote Raspberry PI device a following error occurs. If corresponding section in komponist/tasks/configure-mosquitto.yml is commented out, user files are properly generated (not encrypted) and stack can be successfully brought up (hence the rest seems to work).

TASK [Generating Users file (as plain-text)] *** ok: [192.168.2.201]

TASK [Encrypting the Users file using Mosquitto Docker Container] ** fatal: [192.168.2.201]: FAILED! => changed=false msg: 'Error connecting: Error while fetching server API version: request() got an unexpected keyword argument ''chunked'''

PLAY RECAP ***** 192.168.2.201 : ok=14 changed=2 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

shantanoo-desai commented 1 year ago

@gintasjuk This is a known bug which is caused by urllib3 v2 which is used by the docker python module.

please perform ansible-galaxy collection install community.docker and check if the collection's version is 3.4.5 (See https://github.com/ansible-collections/community.docker/blob/main/CHANGELOG.rst#bugfixes)

or use the requirements.txt file in the repo and perform pip install -r requirements.txt and it should do it for you

gintasjuk commented 1 year ago

Yes, urllib3 library on the target device was version 2.0.2. Downgraded to 1.26.15 and it solved the problem.