jolly-midnight-72759
11/10/2020, 3:24 PMbuildkite-agent@raulcicd:~/builds/raulcicd-chartbeat-net-1/chartbeat/lint-check$ /var/lib/buildkite-agent/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/bin/pants --level=debug version
Scrubbed PYTHONPATH=/home/ubuntu/superfly from the environment.
10:22:04.81 [DEBUG] acquiring lock: <pants.process.lock.OwnerPrintingInterProcessFileLock object at 0x7faddd0b92e8>
10:22:04.81 [DEBUG] releasing lock: <pants.process.lock.OwnerPrintingInterProcessFileLock object at 0x7faddd0b92e8>
10:22:04.81 [DEBUG] connecting to pantsd on port 44973 (attempt 1/3)
Failed to launch child `/var/lib/buildkite-agent/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/bin/pants`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
I thought it was apparmor at first, but I think I eliminated that as a cause by successfully running scripts in the same directory.jolly-midnight-72759
11/10/2020, 3:26 PMpantsd
daemon is running as buildkite-agent: buildki+ 31558 0.1 2.3 259972 46740 ? Sl 10:19 0:00 pantsd [/var/lib/buildkite-agent/builds/raulcicd-chartbeat-net-1/chartbeat/lint-check]
jolly-midnight-72759
11/10/2020, 3:28 PMpantsd
it is trying to connect to is different then the one that is running.jolly-midnight-72759
11/10/2020, 3:29 PM--no-pantsd
works for pants version
.jolly-midnight-72759
11/10/2020, 3:31 PMException message: 1 Exception encountered:
ProcessExecutionFailure: Process 'Find interpreter for constraints: CPython>=3.6' failed with exit code 102.
stdout:
stderr:
Could not find a compatible interpreter.
Examined the following interpreters:
1.) /usr/bin/python2.7 CPython==2.7.17
No interpreter compatible with the requested constraints was found:
Version matches CPython>=3.6
(Use --print-stacktrace to see more error details.)
buildkite-agent@raulcicd:~/builds/raulcicd-chartbeat-net-1/chartbeat/lint-check$ python3.6
Python 3.6.9 (default, Oct 8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
jolly-midnight-72759
11/10/2020, 3:34 PMinterpreter_constraints = ["CPython>=2.7.17,<3","CPython>=3.6.9,<4"]
interpreter_search_paths = ["<PYENV>", "<PATH>"]
hundreds-father-404
11/10/2020, 3:36 PM-ldebug
to see what Pants is choosing.enough-analyst-54434
11/10/2020, 3:36 PMraulcicd
sees python3.6 (presumably that's on the PATH
for raulcicd
) and buildkite-agent
doesn't, that provides the 1st clue.jolly-midnight-72759
11/10/2020, 3:37 PMbuildkite-agent
user.enough-analyst-54434
11/10/2020, 3:37 PMjolly-midnight-72759
11/10/2020, 3:37 PM/usr/bin/
which is where python
(aliased to python2
), python2
, python3
and python3.6
are all located.jolly-midnight-72759
11/10/2020, 3:39 PM--pantsd
I get the dreaded `103850.41 [DEBUG] connecting to pantsd on port 44973 (attempt 1/3)
Failed to launch child `/var/lib/buildkite-agent/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/bin/pants`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }` error.jolly-midnight-72759
11/10/2020, 3:39 PMjolly-midnight-72759
11/10/2020, 3:40 PMpantsd
and one is the failure to find python3.6
.jolly-midnight-72759
11/10/2020, 3:40 PMenough-analyst-54434
11/10/2020, 3:40 PMjolly-midnight-72759
11/10/2020, 3:41 PMenough-analyst-54434
11/10/2020, 3:41 PMjolly-midnight-72759
11/10/2020, 3:42 PMts/setup/bootstrap-Linux-x86_64/2.0.0_py36/bin/pants
File: /var/lib/buildkite-agent/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/bin/pants
Size: 306 Blocks: 8 IO Block: 4096 regular file
Device: 10302h/66306d Inode: 4614039 Links: 1
Access: (0775/-rwxrwxr-x) Uid: ( 999/buildkite-agent) Gid: ( 999/buildkite-agent)
Access: 2020-11-09 23:15:43.856779291 -0500
Modify: 2020-11-09 23:15:43.848783291 -0500
Change: 2020-11-09 23:15:43.848783291 -0500
Birth: -
jolly-midnight-72759
11/10/2020, 3:42 PMjolly-midnight-72759
11/10/2020, 3:42 PMenough-analyst-54434
11/10/2020, 3:42 PMhead -1
that "binary"?jolly-midnight-72759
11/10/2020, 3:43 PMno BUILDROOT
type errors.jolly-midnight-72759
11/10/2020, 3:43 PM/var/lib/buildkite-agent/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/bin/pants
is not a binary.jolly-midnight-72759
11/10/2020, 3:43 PM#!/var/lib/buildkite-agent/.cache/pants/setup/bootstrap-Linux-x86_64/pants.0KECIN/install/bin/python3.6
# -*- coding: utf-8 -*-
import re
import sys
from pants.bin.pants_loader import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
enough-analyst-54434
11/10/2020, 3:43 PMjolly-midnight-72759
11/10/2020, 3:44 PMenough-analyst-54434
11/10/2020, 3:44 PMjolly-midnight-72759
11/10/2020, 3:44 PMjolly-midnight-72759
11/10/2020, 3:44 PMjolly-midnight-72759
11/10/2020, 3:45 PMbuildkite-agent
.jolly-midnight-72759
11/10/2020, 3:46 PMenough-analyst-54434
11/10/2020, 3:47 PMjolly-midnight-72759
11/10/2020, 3:47 PMenough-analyst-54434
11/10/2020, 3:48 PMjolly-midnight-72759
11/10/2020, 3:48 PMenough-analyst-54434
11/10/2020, 3:49 PMenough-analyst-54434
11/10/2020, 3:50 PMjolly-midnight-72759
11/10/2020, 3:50 PMenough-analyst-54434
11/10/2020, 3:50 PMjolly-midnight-72759
11/10/2020, 3:51 PMjolly-midnight-72759
11/10/2020, 3:51 PMjolly-midnight-72759
11/10/2020, 3:52 PMhundreds-father-404
11/10/2020, 3:56 PMpython
, python2
, and python3
for the interpreter to run Pex, and test that they’re valid binaries. That all happens in parallel.jolly-midnight-72759
11/10/2020, 4:13 PMjolly-midnight-72759
11/10/2020, 4:14 PMhundreds-father-404
11/10/2020, 4:18 PMenough-analyst-54434
11/10/2020, 4:20 PM--pex-verbosity=9
?hundreds-father-404
11/10/2020, 4:21 PMhundreds-father-404
11/10/2020, 4:22 PMjolly-midnight-72759
11/10/2020, 4:26 PMpex-verbosity
?enough-analyst-54434
11/10/2020, 4:27 PMjolly-midnight-72759
11/10/2020, 4:30 PMenough-analyst-54434
11/10/2020, 4:31 PMenough-analyst-54434
11/10/2020, 5:14 PMFROM ubuntu:18.04
RUN apt update && apt upgrade -y && apt install -y locales language-pack-en
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
RUN apt install -y curl python python3-dev git vim build-essential unzip tar
I reproduce using:
$ docker run --rm -it raul:3.6
root@f1a736edc580:/# git clone <https://github.com/pantsbuild/example-python>
Cloning into 'example-python'...
remote: Enumerating objects: 329, done.
remote: Total 329 (delta 0), reused 0 (delta 0), pack-reused 329
Receiving objects: 100% (329/329), 74.15 KiB | 1.65 MiB/s, done.
Resolving deltas: 100% (197/197), done.
root@f1a736edc580:/# cd example-python
root@f1a736edc580:/example-python# ./pants fmt lint typecheck test ::
...
New virtual environment successfully created at /root/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36.
17:11:46.96 [INFO] initializing pantsd...
17:11:47.83 [INFO] pantsd initialized.
17:11:48.02 [INFO] No pyenv binary found. Will not use pyenv interpreters.
17:11:54.18 [INFO] Completed: Building docformatter.pex with 1 requirement: docformatter>=1.3.1,<1.4
17:11:54.53 [INFO] Completed: Format with docformatter - made no changes.
17:11:54.88 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/lib/python3.6/site-packages/pants/bin/local_pants_runner.py", line 289, in run
engine_result = self._run_v2()
File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/lib/python3.6/site-packages/pants/bin/local_pants_runner.py", line 195, in _run_v2
return self._maybe_run_v2_body(goals, poll=False)
File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/lib/python3.6/site-packages/pants/bin/local_pants_runner.py", line 217, in _maybe_run_v2_body
poll_delay=(0.1 if poll else None),
File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/lib/python3.6/site-packages/pants/init/engine_initializer.py", line 127, in run_goal_rules
goal_product, params, poll=poll, poll_delay=poll_delay
File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/lib/python3.6/site-packages/pants/engine/internals/scheduler.py", line 569, in run_goal_rule
self._raise_on_error([t for _, t in throws])
File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/2.0.0_py36/lib/python3.6/site-packages/pants/engine/internals/scheduler.py", line 539, in _raise_on_error
wrapped_exceptions=tuple(t.exc for t in throws),
Exception message: 1 Exception encountered:
ProcessExecutionFailure: Process 'Find interpreter for constraints: CPython>=3.6' failed with exit code 102.
stdout:
stderr:
Could not find a compatible interpreter.
Examined the following interpreters:
1.) /usr/bin/python2.7 CPython==2.7.17
No interpreter compatible with the requested constraints was found:
Version matches CPython>=3.6
(Use --print-stacktrace to see more error details.)
root@f1a736edc580:/example-python#
jolly-midnight-72759
11/10/2020, 5:36 PMenough-analyst-54434
11/10/2020, 5:46 PMenough-analyst-54434
11/10/2020, 6:36 PMhundreds-father-404
11/10/2020, 6:37 PM--python-path
to reduce # of changesjolly-midnight-72759
11/10/2020, 6:41 PMenough-analyst-54434
11/10/2020, 6:42 PMjolly-midnight-72759
11/10/2020, 6:43 PMPermissionDenied
error which started me down this path?jolly-midnight-72759
11/10/2020, 6:45 PM<PYENV>
comes before <PYPATH>
, yes?hundreds-father-404
11/10/2020, 6:45 PM--pantsd
is used.jolly-midnight-72759
11/10/2020, 6:46 PMPermissionDenied
. 🛒hundreds-father-404
11/10/2020, 6:47 PMAnd the reason I don’t see this bug on my mac is because <PYENV> comes before <PYPATH>, yes?The ordering doesn’t matter for
interpreter_search_paths
. It works on your mac because you have interpreters in two distinct directories, so you’re not hitting this edge case where the sibling interpreters to the current interpreter are not considered. The issue is that CI has everything in a single directory
(Which, again, should be fine. Pex bug)enough-analyst-54434
11/10/2020, 6:47 PMjolly-midnight-72759
11/10/2020, 6:48 PMenough-analyst-54434
11/10/2020, 6:48 PMjolly-midnight-72759
11/10/2020, 6:48 PMjolly-midnight-72759
11/10/2020, 6:48 PMldebug
only shows what I put in the first post of this thread.jolly-midnight-72759
11/10/2020, 6:49 PMjolly-midnight-72759
11/10/2020, 6:51 PMjolly-midnight-72759
11/10/2020, 6:51 PMwitty-crayon-22786
11/10/2020, 6:53 PMenough-analyst-54434
11/10/2020, 6:53 PMjolly-midnight-72759
11/10/2020, 8:45 PMDockerfile
.