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

Make check target is failing in Jenkins pipeline #16266

Closed
kuisathaverat opened this issue Feb 12, 2020 · 6 comments · Fixed by #16382
Closed

Make check target is failing in Jenkins pipeline #16266

kuisathaverat opened this issue Feb 12, 2020 · 6 comments · Fixed by #16382
Assignees

Comments

@kuisathaverat
Copy link
Contributor

make check target is failing on the make update target

[2020-02-12T09:21:34.286Z] /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/journalbeat/build/python-env/bin/pip: line 3: import: command not found
[2020-02-12T09:21:34.286Z] /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/journalbeat/build/python-env/bin/pip: line 4: import: command not found
[2020-02-12T09:21:34.286Z] from: can't read /var/mail/pip._internal.cli.main
[2020-02-12T09:21:34.286Z] /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/journalbeat/build/python-env/bin/pip: line 9: syntax error near unexpected token `('
[2020-02-12T09:21:34.286Z] /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/journalbeat/build/python-env/bin/pip: line 9: `    sys.argv[0] = re.sub(r"(-script.pyw?|.exe)?$", "", sys.argv[0])'
[2020-02-12T09:21:34.286Z] /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/journalbeat/build/python-env/bin/pip: line 3: import: command not found
[2020-02-12T09:21:34.286Z] /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/journalbeat/build/python-env/bin/pip: line 4: import: command not found
[2020-02-12T09:21:34.286Z] from: can't read /var/mail/pip._internal.cli.main
[2020-02-12T09:21:34.286Z] /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/journalbeat/build/python-env/bin/pip: line 9: syntax error near unexpected token `('
[2020-02-12T09:21:34.286Z] /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/journalbeat/build/python-env/bin/pip: line 9: `    sys.argv[0] = re.sub(r"(-script.pyw?|.exe)?$", "", sys.argv[0])'
[2020-02-12T09:21:34.286Z] make[2]: *** [python-env] Error 2
[2020-02-12T09:21:34.286Z] Error: running "make update" failed with exit code 2
[2020-02-12T09:21:34.286Z] ../libbeat/scripts/Makefile:141: recipe for target 'check' failed
[2020-02-12T09:21:34.286Z] make[1]: *** [check] Error 2
[2020-02-12T09:21:34.286Z] make[1]: Leaving directory '/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/journalbeat'
[2020-02-12T09:21:34.286Z] Makefile:90: recipe for target 'check' failed
@jsoriano
Copy link
Member

@kuisathaverat I guess that this only affects mac? make check is executed in all PR and master builds on linux and it is passing now.
Can this be reproduced locally?
Can it be related to #16235?

@kuisathaverat
Copy link
Contributor Author

kuisathaverat commented Feb 17, 2020

It happens 5 days ago on a Linux box https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fbeats-beats-mbp/detail/PR-15548/13/pipeline/

locally I have similar error but not the same running it with Python 3 there is no issue.

@kuisathaverat
Copy link
Contributor Author

kuisathaverat commented Feb 17, 2020

Today we have a different error in the CI, this seems a fair error

[2020-02-17T14:00:15.756Z] 2020/02/17 14:00:15 Found Elastic Beats dir at /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats
[2020-02-17T14:00:16.329Z] Generated fields.yml for filebeat to /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/filebeat/build/fields/fields.all.yml
[2020-02-17T14:00:18.878Z] Traceback (most recent call last):
[2020-02-17T14:00:18.878Z]   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/filebeat/scripts/docs_collector.py", line 91, in <module>
[2020-02-17T14:00:18.878Z]     collect(beat_name)
[2020-02-17T14:00:18.878Z]   File "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/filebeat/scripts/docs_collector.py", line 42, in collect
[2020-02-17T14:00:18.878Z]     module_file += f.read()
[2020-02-17T14:00:18.878Z]   File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
[2020-02-17T14:00:18.878Z]     return codecs.ascii_decode(input, self.errors)[0]
[2020-02-17T14:00:18.878Z] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 516: ordinal not in range(128)
[2020-02-17T14:00:18.878Z] Error: running "/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/build/ve/linux/bin/python /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/filebeat/scripts/docs_collector.py --beat filebeat" failed with exit code 1
[2020-02-17T14:00:18.879Z] ../libbeat/scripts/Makefile:143: recipe for target 'check' failed
[2020-02-17T14:00:18.879Z] make[1]: *** [check] Error 1
[2020-02-17T14:00:18.879Z] make[1]: Leaving directory '/var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-15548/src/github.com/elastic/beats/filebeat'
[2020-02-17T14:00:18.879Z] Makefile:92: recipe for target 'check' failed
[2020-02-17T14:00:18.879Z] make: *** [check] Error 1

@kuisathaverat
Copy link
Contributor Author

about #16235, you can use the latest virtual environment if you use the Python 3 compatible, I mean, you install it for Python 3 only (pip3) and use it from Python 3 modules.

pip3 install virtualenv
python3 -m virtualenv  folder
pip3 install virtualenv
pip2 uninstall virtualenv
virtualenv  folder

@jsoriano
Copy link
Member

I managed to reproduce the encoding error locally with LANG=C make check but it works with any UTF-8 locales, e.g. with LANG=C.UTF-8 make check. So it seems that environment is different in original jobs and new pipelines. I am going to try to fix it so it works with and without UTF-8 locales.

It'd be also good to see the environment differences between both jobs.

@jsoriano jsoriano changed the title Make check target is failing Make check target is failing in Jenkins pipeline Feb 18, 2020
@kuisathaverat kuisathaverat self-assigned this Feb 18, 2020
@kuisathaverat
Copy link
Contributor Author

I finally found a solution on #16382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants