9462c9e466
send() requires a bytes-like object in Python 3, ensure the error message is encoded correctly. --- Some debugging notes might come in handy for the future here. This problem appeared in a fairly specific part of the test cases when setting "ansible_python_interpreter" to /usr/bin/python3. The remote streaming test has a task that is designed to fail [1]: - hosts: all tasks: - name: Remote shell task with python exception command: echo foo args: chdir: /remote-shelltask/somewhere/that/does/not/exist failed_when: false We see that Ansible ships over a payload and tries to run it, but it raises an exception very early. <192.168.122.1> SSH: EXEC ssh -C ... '/bin/sh -c '"'"'/usr/bin/python3 && sleep 0'"'"'' <192.168.122.1> Failed to connect to the host via ssh: Traceback (most recent call last): File "<stdin>", line 114, in <module> File "<stdin>", line 106, in _ansiballz_main ... File "/tmp/ansible_command_payload_tieedyzs/__main__.py", line 263, in main FileNotFoundError: [Errno 2] No such file or directory: '/remote-shelltask/somewhere/that/does/not/exist' When this task started, the Ansible task callbacks in the zuul_stream callback plugin have setup a thread that listens for the console output being sent by the remote zuul_console daemon started earlier in the playbook [2]. This listening thread is sitting in a recv() waiting for some streaming data to log [3]. There will be no remote log file for zuul_console to stream back, because this task failed before it even got started. What should happen is the "[Zuul] Log not found" message should be sent back and logic in [4] will match this and stop this thread. When this does *not* happen, such as when this send() raises an exception because of wrong data type, the task ends anyway and Ansible moves on to make the end-of-task callbacks in zuul_stream (actually there's a bunch of looping happening, but let's ignore those details). This ends up in _stop_streamers() [5] which attempts to join(30) the streaming thread. Under normal circumstances, this thread should be finished and the join() successful. However, because the target thread is stuck in a recv(), the 30-second timeout begins. The clue to this is in the logs you eventually get: [Zuul] Log Stream did not terminate So eventually, Zuul would have made progress here and given up on waiting for the thread to finish properly. However, 30 seconds is a long time to the unit-test and pushes the job over it's timeout. Thus your end result is that when using Python 3 Zuul aborts the job, and the test rather mysteriously fails! [1] |
||
---|---|---|
doc | ||
etc | ||
playbooks | ||
releasenotes/notes | ||
tests | ||
tools | ||
web | ||
zuul | ||
.coveragerc | ||
.dockerignore | ||
.gitignore | ||
.gitreview | ||
.mailmap | ||
.stestr.conf | ||
.zuul.yaml | ||
COPYING | ||
Dockerfile | ||
LICENSE | ||
MANIFEST.in | ||
README.rst | ||
TESTING.rst | ||
bindep.txt | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini |
README.rst
Zuul
Zuul is a project gating system.
The latest documentation for Zuul v3 is published at: https://zuul-ci.org/docs/zuul/
If you are looking for the Edge routing service named Zuul that is related to Netflix, it can be found here: https://github.com/Netflix/zuul
If you are looking for the Javascript testing tool named Zuul, it can be found here: https://github.com/defunctzombie/zuul
Getting Help
There are two Zuul-related mailing lists:
- zuul-announce
-
A low-traffic announcement-only list to which every Zuul operator or power-user should subscribe.
- zuul-discuss
-
General discussion about Zuul, including questions about how to use it, and future development.
You will also find Zuul developers in the #zuul channel on Freenode IRC.
Contributing
To browse the latest code, see: https://opendev.org/zuul/zuul To clone the latest code, use git clone https://opendev.org/zuul/zuul
Bugs are handled at: https://storyboard.openstack.org/#!/project/zuul/zuul
Suspected security vulnerabilities are most appreciated if first reported privately following any of the supported mechanisms described at https://zuul-ci.org/docs/zuul/user/vulnerabilities.html
Code reviews are handled by gerrit at https://review.opendev.org
After creating a Gerrit account, use git review to submit patches. Example:
# Do your commits
$ git review
# Enter your username if prompted
Join #zuul on Freenode to discuss development or usage.
License
Zuul is free software. Most of Zuul is licensed under the Apache License, version 2.0. Some parts of Zuul are licensed under the General Public License, version 3.0. Please see the license headers at the tops of individual source files.
Python Version Support
Zuul v3 requires Python 3. It does not support Python 2.
As Ansible is used for the execution of jobs, it's important to note
that while Ansible does support Python 3, not all of Ansible's modules
do. Zuul currently sets ansible_python_interpreter
to
python2 so that remote content will be executed with Python 2.