Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests on Travis fail with sequence item 1: expected a bytes-like object, str found #89

Closed
acompa opened this issue Jan 2, 2018 · 4 comments

Comments

@acompa
Copy link

acompa commented Jan 2, 2018

Our Travis tests have started failing after we bumped pifpaf version from 1.11.2 to 1.11.4. Some more information:

  • Tests are administered using tox. They pass on local development machines.
  • We have not changed our Travis configuration aside from installing the latest libraries.

Two of our jobs fail. The first, a py36 job, fails with this error message on Travis (with some paths edited):

py36 runtests: commands[0] | pifpaf run postgresql -- python -m coverage run -m pytest tests --ignore tests/my_test.py
ERROR [pifpaf] sequence item 1: expected a bytes-like object, str found
ERROR: InvocationError: '/home/travis/build/path/to/.tox/py36/bin/pifpaf run postgresql -- python -m coverage run -m pytest tests --ignore tests/my_test.py'

The second, py27, fails with this error:

py27 runtests: commands[0] | pifpaf run postgresql -- python -m coverage run -m pytest tests --ignore tests/my_test.py
ERROR [pifpaf] Unable to run command `/usr/lib/postgresql/10/bin/pg_ctl -o '-A trust' initdb': [Errno 2] No such file or directory
ERROR: InvocationError: '/home/travis/build/path/to/.tox/py27/bin/pifpaf run postgresql -- python -m coverage run -m pytest tests --ignore tests/my_test.py'
@jd
Copy link
Owner

jd commented Jan 3, 2018

This is unlikely related to 1.11.4, the diff since 1.11.2 does not concern anything else than Swift and Gnocchi drivers.

Can you run it with --debug to see what's going on?

Do you test with Python 2 and do you have the same error?

@acompa
Copy link
Author

acompa commented Jan 4, 2018

Yep, also tested with Python 2 (see the second code block in the initial message).

I see this when running Python 3 tests with --debug:

ERROR [pifpaf] Traceback (most recent call last):
  File "/home/travis/build/path/to/.tox/py36/lib/python3.6/site-packages/pifpaf/drivers/__init__.py", line 214, in _exec
    preexec_fn=os.setsid,
  File "/opt/python/3.6.3/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/opt/python/3.6.3/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: b'/usr/lib/postgresql/10/bin/pg_ctl': b'/usr/lib/postgresql/10/bin/pg_ctl'

It looks like pifpaf assumes PostgreSQL 10, which Travis only supports with a lot of work. Am I reading this debug correctly?

@sinemetu1
Copy link

I think this is a travis-ci image or pg_ctl issue. I was able to reproduce with this yaml: https://github.com/sinemetu1/test-pg-travis/blob/master/.travis.yml

And the corresponding travis build: https://travis-ci.org/sinemetu1/test-pg-travis/builds/325130012

I have no idea why pg_ctl --bindir is reporting /usr/lib/postgresql/10/bin.

@sinemetu1
Copy link

Here's the travis issue: travis-ci/travis-ci#9011

@jd jd closed this as completed Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants