Closed Im0 closed 1 year ago
Running ansible-test integration --docker
at home works 100%. Currently trying to understand why this pipeline is failing.
Currently failing on: rabbitmq_publish : RabbitMQ basic publish test
with...
2022-10-20T02:44:53.8610439Z 02:35 [0;31mThe full traceback is:[0m
2022-10-20T02:44:53.8611781Z 02:35 [0;31m File "/tmp/ansible_rabbitmq_publish_payload_o04npdq8/ansible_rabbitmq_publish_payload.zip/ansible_collections/community/rabbitmq/plugins/module_utils/rabbitmq.py", line 143, in connect_to_rabbitmq[0m
2022-10-20T02:44:53.8613011Z 02:35 [0;31m self.connection = pika.BlockingConnection(parameters)[0m
2022-10-20T02:44:53.8613699Z 02:35 [0;31m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[0m
2022-10-20T02:44:53.8614251Z 02:35 [0;31m File "/usr/local/lib/python3.11/dist-packages/pika/adapters/blocking_connection.py", line 360, in __init__[0m
2022-10-20T02:44:53.8614836Z 02:35 [0;31m self._impl = self._create_connection(parameters, _impl_class)[0m
2022-10-20T02:44:53.8615295Z 02:35 [0;31m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[0m
2022-10-20T02:44:53.8615900Z 02:35 [0;31m File "/usr/local/lib/python3.11/dist-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection[0m
2022-10-20T02:44:53.8616598Z 02:35 [0;31m raise self._reap_last_connection_workflow_error(error)[0m
2022-10-20T02:44:53.8617069Z 02:35 [0;31mfatal: [testhost -> localhost]: FAILED! => {[0m
2022-10-20T02:44:53.8617467Z 02:35 [0;31m "changed": false,[0m
2022-10-20T02:44:53.8617840Z 02:35 [0;31m "invocation": {[0m
2022-10-20T02:44:53.8618211Z 02:35 [0;31m "module_args": {[0m
2022-10-20T02:44:53.8618605Z 02:35 [0;31m "auto_delete": false,[0m
2022-10-20T02:44:53.8619065Z 02:35 [0;31m "body": "Hello world from ansible module rabbitmq_publish",[0m
2022-10-20T02:44:53.8619493Z 02:35 [0;31m "cafile": null,[0m
2022-10-20T02:44:53.8619882Z 02:35 [0;31m "certfile": null,[0m
2022-10-20T02:44:53.8620282Z 02:35 [0;31m "content_type": "text/plain",[0m
2022-10-20T02:44:53.8620686Z 02:35 [0;31m "durable": false,[0m
2022-10-20T02:44:53.8621065Z 02:35 [0;31m "exchange": null,[0m
2022-10-20T02:44:53.8621459Z 02:35 [0;31m "exclusive": false,[0m
2022-10-20T02:44:53.8621833Z 02:35 [0;31m "headers": {},[0m
2022-10-20T02:44:53.8622207Z 02:35 [0;31m "host": null,[0m
2022-10-20T02:44:53.8622577Z 02:35 [0;31m "keyfile": null,[0m
2022-10-20T02:44:53.8622962Z 02:35 [0;31m "password": null,[0m
2022-10-20T02:44:53.8623331Z 02:35 [0;31m "port": null,[0m
2022-10-20T02:44:53.8623696Z 02:35 [0;31m "proto": null,[0m
2022-10-20T02:44:53.8624232Z 02:35 [0;31m "queue": "publish_test",[0m
2022-10-20T02:44:53.8624847Z 02:35 [0;31m "routing_key": null,[0m
2022-10-20T02:44:53.8625242Z 02:35 [0;31m "src": null,[0m
2022-10-20T02:44:53.8626204Z 02:35 [0;31m "url": "amqp://guest:***@localhost:5672/%2F",[0m
2022-10-20T02:44:53.8626798Z 02:35 [0;31m "username": null,[0m
2022-10-20T02:44:53.8627181Z 02:35 [0;31m "vhost": null[0m
2022-10-20T02:44:53.8627815Z 02:35 [0;31m }[0m
2022-10-20T02:44:53.8628154Z 02:35 [0;31m },[0m
2022-10-20T02:44:53.8628527Z 02:35 [0;31m "msg": "Connection issue: "[0m
2022-10-20T02:44:53.8628872Z 02:35 [0;31m}[0m
Trying to replicate build failure locally. Below worked fine:
ansible-test integration rabbitmq_publish --docker base
ansible-test integration rabbitmq_publish --docker ubuntu2004 --python 3.8
Looks like the failure is in docker devel, which, I assume is the development branch of ansible.
Docker devel now appears to be failing with the error below. I feel that this issue is unrelated to my changes.
https://dev.azure.com/ansible/community.rabbitmq/_build/results?buildId=57618&view=results
01:34 failed to register layer: ApplyLayer exit status 1 stdout: stderr: write /usr/bin/zstd: no space left on device
01:34 WARNING: Failed to pull docker image "quay.io/ansible/ubuntu2004-test-container:4.8.0". Waiting a few seconds before trying again.
01:38 ERROR: Host <ansible_test._internal.host_profiles.DockerProfile object at 0x7f9e7f636a90> job failed: Failed to pull docker image "quay.io/ansible/ubuntu2004-test-container:4.8.0".
Still having trouble replicating the issue in Docker devel Ubuntu 20.04
. In a normal container created with ansible-test shell --docker --python 3.9
first of all tried installing ansible devel with pip as this appeared to be what the CI pipeline did?
retry pip3.9 install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
Running ansible-test: ... PLAY RECAP ***** testhost : ok=56 changed=27 unreachable=0 failed=0 skipped=1 rescued=0 ignored=5
# ansible-test integration rabbitmq_publish --allow-destructive
Tried running ansible-test devel branch within a new container using GIT:
# ansible-test shell --docker --python 3.9
root@f819c30973c0:~/ansible_collections/community/rabbitmq$
cd /root
git clone https://github.com/ansible/ansible.git
mkdir clone
cd clone
git clone https://github.com/ansible/ansible.git
cd ~
cd ansible_collections/community/rabbitmq/
pip3.9 install --upgrade jinja2
python3.9 /clone/ansible/bin/ansible-test integration rabbitmq_publish --allow-destructive
The ansible-test environment from within the container:
root@f819c30973c0:~/ansible_collections/community/rabbitmq$ python3.9 /clone/ansible/bin/ansible-test env
ansible:
version: 2.15.0.dev0
docker:
executable: None
git: None
interpreters:
2.7: /usr/bin/python2.7
3.5: /usr/bin/python3.5
3.6: /usr/bin/python3.6
3.7: /usr/bin/python3.7
3.8: /usr/bin/python3.8
3.9: /usr/bin/python3.9
location:
cwd: /root/ansible_collections/community/rabbitmq
pwd: /root/ansible_collections/community/rabbitmq
platform:
datetime: 2022-10-24T03:20:14Z
platform: Linux-5.4.0-88-generic-x86_64-with-glibc2.27
python:
executable: /usr/bin/python3.9
version: 3.9.1
The testing worked...
PLAY RECAP *********************************************************************
testhost : ok=56 changed=27 unreachable=0 failed=0 skipped=1 rescued=0 ignored=5
Struggling to replicate the connectivity issues present in the devel ci pipeline results.
These CI failures are being fixed in #139 and given the other tests passed for this PR and this PR helps #139 I will merge this in.
Latest CI run has sanity issues corrected in #139 . The only issue I'm unsure about is the devel branch 20.04 issue which raises:
04:42 The full traceback is:
04:42 File "/tmp/ansible_rabbitmq_publish_payload_g0myw77x/ansible_rabbitmq_publish_payload.zip/ansible_collections/community/rabbitmq/plugins/module_utils/rabbitmq.py", line 143, in connect_to_rabbitmq
04:42 self.connection = pika.BlockingConnection(parameters)
04:42 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
04:42 File "/usr/local/lib/python3.11/dist-packages/pika/adapters/blocking_connection.py", line 360, in __init__
04:42 self._impl = self._create_connection(parameters, _impl_class)
04:42 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
04:42 File "/usr/local/lib/python3.11/dist-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection
04:42 raise self._reap_last_connection_workflow_error(error)
And struggling to replicate in home environment.
SUMMARY
Fixes #138
Updating to fix publishing to exchanges. Updating documentation examples. Queue and exchange options are now mutually exclusive.
ISSUE TYPE
COMPONENT NAME
module_utils/rabbitmq.py modules/rabbitmq_publish.py
ADDITIONAL INFORMATION
Notes are in #138 - This PR fixes up some of the logic when posting to an exchange. Previously if an exchange was specified but no queue, the module would also post the message to a random queue.