flat-zoo-31952
09/13/2021, 6:41 PMFailed to launch child `/home/.../.cache/bootstrap-Linux-x86_64/2.6.1rc3_py39/bin/pants`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
Even going to the resolved bin directory in my shell and running ./pants
fails with the same error. Any idea what might be going on? What's it trying to launch internally there?witty-crayon-22786
09/13/2021, 6:58 PMpants
script trying to use the venv that it created containing pantswitty-crayon-22786
09/13/2021, 6:59 PMwitty-crayon-22786
09/13/2021, 6:59 PMwitty-crayon-22786
09/13/2021, 7:00 PMset -x
to the top of the pants
script for more info.flat-zoo-31952
09/13/2021, 7:02 PMflat-zoo-31952
09/13/2021, 7:02 PMflat-zoo-31952
09/13/2021, 7:03 PM./pants
shell script, that's the little python launcher scriptflat-zoo-31952
09/13/2021, 7:04 PM❯ ./python -c 'from pants.bin.pants_loader import main; main()'
Failed to launch child `-c`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
happy-kitchen-89482
09/13/2021, 7:17 PMulimit -n 10000
in the container?flat-zoo-31952
09/13/2021, 7:22 PM❯ ulimit -n
524288
flat-zoo-31952
09/13/2021, 7:25 PMflat-zoo-31952
09/13/2021, 7:25 PMpants.bin.pants_loader:main
doeswitty-crayon-22786
09/13/2021, 7:32 PMmain()
method… it seems like there is likely an issue with the python in the virtualenv.witty-crayon-22786
09/13/2021, 7:32 PMpython
is a symlink to some other pythonwitty-crayon-22786
09/13/2021, 7:33 PMflat-zoo-31952
09/13/2021, 7:35 PMflat-zoo-31952
09/13/2021, 7:39 PM./python -m pex --help
works fine (in the $VIRTUALENV/bin directory)flat-zoo-31952
09/13/2021, 7:42 PM❯ ./python (realpath pants)
Failed to launch child `/home/pants-home/.cache/bootstrap-Linux-x86_64/pants.fRK9AN/install/bin/pants`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
flat-zoo-31952
09/13/2021, 7:43 PM❯ ./python -m pants
Failed to launch child `/home/pants-home/.cache/bootstrap-Linux-x86_64/pants.fRK9AN/install/lib64/python3.9/site-packages/pants/__main__.py`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
flat-zoo-31952
09/13/2021, 7:44 PMflat-zoo-31952
09/13/2021, 7:47 PMwitty-crayon-22786
09/13/2021, 7:47 PMflat-zoo-31952
09/13/2021, 7:47 PM./pants --version --no-pantsd
works finewitty-crayon-22786
09/13/2021, 7:48 PMflat-zoo-31952
09/13/2021, 7:49 PM❯ ps axu | grep pantsd
jreed 2819075 0.0 0.0 6176 2260 pts/0 S+ 15:48 0:00 grep --color=auto pantsd
░▒▓ /home/pants-home/.cache/bootstrap-Linux-x86_64/2.6.1rc3_py39/bin ·············································· 15:48:13 ▓▒░
❯ ./pants --version
Failed to launch child `./pants`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
░▒▓ /home/pants-home/.cache/bootstrap-Linux-x86_64/2.6.1rc3_py39/bin ·············································· 15:48:24 ▓▒░
❯ ps axu | grep pantsd
jreed 2819188 21.7 0.1 282021188 63384 ? Sl 15:48 0:00 pantsd [/home/pants-home/.cache/bootstrap-Linux-x86_64/pants.fRK9AN/install/bin]
jreed 2819254 0.0 0.0 6176 2196 pts/0 S+ 15:48 0:00 grep --color=auto pantsd
░▒▓ /home/pants-home/.cache/bootstrap-Linux-x86_64/2.6.1rc3_py39/bin ·············································· 15:48:27 ▓▒░
❯ pkill pantsd
░▒▓ /home/pants-home/.cache/bootstrap-Linux-x86_64/2.6.1rc3_py39/bin ·············································· 15:48:35 ▓▒░
❯ ./python -c 'from pants.bin.pants_loader import main; main()'
Argument expected for the -c option
usage: /home/pants-home/.cache/bootstrap-Linux-x86_64/pants.fRK9AN/install/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
15:48:47.92 [INFO] waiting for pantsd to start...
... snip ...
raise cls.Timeout(
pants.pantsd.process_manager.ProcessManager.Timeout: exceeded timeout of 60 seconds while waiting for pantsd to start
flat-zoo-31952
09/13/2021, 7:50 PMflat-zoo-31952
09/13/2021, 7:50 PMwitty-crayon-22786
09/13/2021, 7:53 PMpantsd
is spawned via https://github.com/pantsbuild/pants/blob/bfb11d765c566c97d7b90e9bfede291cdc526da1/src/python/pants/pantsd/pants_daemon_client.py#L60, which uses https://github.com/pantsbuild/pants/blob/bfb11d765c566c97d7b90e9bfede291cdc526da1/src/python/pants/pantsd/process_manager.py#L460-L488 … i don’t think there is anything unusual about itflat-zoo-31952
09/13/2021, 7:55 PMflat-zoo-31952
09/13/2021, 7:57 PMflat-zoo-31952
09/13/2021, 8:00 PMflat-zoo-31952
09/13/2021, 8:02 PMwitty-crayon-22786
09/13/2021, 8:03 PMpantsd
does tries to determine which args to use on the second fork, and that might be failing: https://github.com/pantsbuild/pants/blob/bfb11d765c566c97d7b90e9bfede291cdc526da1/src/python/pants/pantsd/process_manager.py#L540-L559witty-crayon-22786
09/13/2021, 8:04 PMsys.executable
should be the right thing to do there though.flat-zoo-31952
09/13/2021, 8:06 PMwitty-crayon-22786
09/13/2021, 8:07 PMflat-zoo-31952
09/14/2021, 3:33 PMprocess_manager
flat-zoo-31952
09/14/2021, 3:34 PM❯ ./pants --pantsd -ldebug
11:33:54.37 [DEBUG] acquiring lock: <pants.pantsd.lock.OwnerPrintingInterProcessFileLock object at 0x7ff71e358ac0>
11:33:54.37 [DEBUG] purging metadata directory: /home/jreed/devel/aiven/aiven-core/.pids/3dcc53364e8c/pantsd
11:33:54.37 [DEBUG] Launching pantsd
11:33:54.37 [DEBUG] purging metadata directory: /home/jreed/devel/aiven/aiven-core/.pids/3dcc53364e8c/pantsd
11:33:54.37 [DEBUG] pantsd command is: PANTS_DAEMON_ENTRYPOINT=pants.pantsd.pants_daemon:launch_new_pantsd_instance PYTHONPATH=/home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/pants.GlUYnI/install/bin:/usr/lib64/python39.zip:/usr/lib64/python3.9:/usr/lib64/python3.9/lib-dynload:/home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.1rc3_py39/lib64/python3.9/site-packages:/home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.1rc3_py39/lib/python3.9/site-packages /home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.1rc3_py39/bin/python /home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.1rc3_py39/bin/pants --pants-bin-name=./pants --pants-version=2.6.1rc3 --pantsd -ldebug
11:33:55.37 [DEBUG] pantsd is running at pid 2968100, pailgun port is 42157
11:33:55.37 [DEBUG] releasing lock: <pants.pantsd.lock.OwnerPrintingInterProcessFileLock object at 0x7ff71e358ac0>
11:33:55.37 [DEBUG] Connecting to pantsd on port 42157
11:33:55.37 [DEBUG] Connecting to pantsd on port 42157 attempt 1/3
Failed to launch child `/home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.1rc3_py39/bin/pants`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
flat-zoo-31952
09/14/2021, 3:40 PM11:38:23.03 [DEBUG] pantsd running with PID: 2971133
11:38:23.03 [DEBUG] Accepted connection: PollEvented { io: Some(TcpStream { addr: 127.0.0.1:33795, peer: 127.0.0.1:51744, fd: 161 }) }
witty-crayon-22786
09/14/2021, 3:49 PMwitty-crayon-22786
09/14/2021, 3:49 PMwitty-crayon-22786
09/14/2021, 3:50 PMflat-zoo-31952
09/14/2021, 3:51 PMflat-zoo-31952
09/14/2021, 3:51 PMflat-zoo-31952
09/15/2021, 5:56 PMsudo podman
with no mounts it's a problem. Might be something related to podman or crun or cgroups2 or some other element of my container stack. Next i'll try to reproduce with a systemd-nspawn container, if it's a problem with that then it's probably an issue with cgroups2 or fundamental container privilegesflat-zoo-31952
09/15/2021, 5:59 PMflat-zoo-31952
09/15/2021, 8:25 PMFROM ubuntu:latest
RUN useradd -Um --shell /bin/bash jreed
RUN apt-get update \
&& apt-get install -y \
curl \
sudo \
python3-pip \
python3-virtualenv \
aptitude
WORKDIR /home/jreed
USER jreed
RUN mkdir test \
&& cd test \
&& printf '[GLOBAL]\npants_version = "2.6.1rc3"\n' > pants.toml \
&& curl -L -o ./pants <https://static.pantsbuild.org/setup/pants> \
&& chmod +x ./pants
results in a working pants install (doesn't throw the permission denied error). However the same commands run in a container launched via podman run -it ubuntu bash
(literally copy-pasting these commands, except replacing WORKDIR and USER with sudo -u jreed -i
) results in the error described above...
Any ideas? This is getting weirdflat-zoo-31952
09/15/2021, 8:49 PMsudo
itself here that's at issue (same with su or gksu)flat-zoo-31952
09/15/2021, 8:49 PMwitty-crayon-22786
09/15/2021, 8:54 PMwitty-crayon-22786
09/15/2021, 8:54 PMwitty-crayon-22786
09/15/2021, 8:55 PMwitty-crayon-22786
09/15/2021, 9:00 PMflat-zoo-31952
09/15/2021, 11:16 PMwitty-crayon-22786
09/15/2021, 11:17 PMflat-zoo-31952
09/16/2021, 1:48 PM./pants | cat
workaround does not workflat-zoo-31952
09/16/2021, 1:48 PMjreed@7b07981cb3a6:~/test$ ./pants --version | cat
Failed to launch child `/home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.6.1rc3_py38/bin/pants`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
flat-zoo-31952
09/16/2021, 1:58 PMflat-zoo-31952
10/06/2021, 8:07 PMflat-zoo-31952
10/06/2021, 8:10 PMflat-zoo-31952
10/06/2021, 8:27 PMflat-zoo-31952
10/06/2021, 8:30 PMwitty-crayon-22786
10/06/2021, 8:33 PMwitty-crayon-22786
10/06/2021, 8:33 PMwitty-crayon-22786
10/06/2021, 8:35 PMflat-zoo-31952
10/06/2021, 8:37 PMwitty-crayon-22786
10/06/2021, 8:39 PMwitty-crayon-22786
10/06/2021, 8:39 PMwitty-crayon-22786
10/06/2021, 8:39 PMflat-zoo-31952
10/06/2021, 8:39 PMwitty-crayon-22786
10/06/2021, 8:40 PMflat-zoo-31952
10/06/2021, 8:43 PMwitty-crayon-22786
10/06/2021, 8:45 PMflat-zoo-31952
10/06/2021, 8:45 PMdnf install podman
, it's just that the crun OCI runtime ecosystem is a lot more modular than typical docker setups, and podman is daemonless and rootless, and it's all based on systemd containers, idk it makes my head spin a bitwitty-crayon-22786
10/06/2021, 8:45 PMflat-zoo-31952
10/06/2021, 8:46 PMwitty-crayon-22786
10/06/2021, 8:56 PMflat-zoo-31952
10/06/2021, 8:57 PMjreed@aa110e26cc53:~/test$ ./pants -ldebug
20:28:48.87 [DEBUG] acquiring lock: <pants.pantsd.lock.OwnerPrintingInterProcessFileLock object at 0x7f91398edd00>
20:28:48.87 [DEBUG] purging metadata directory: /home/jreed/test/.pids/7ac24caa98f2/pantsd
20:28:48.87 [DEBUG] Launching pantsd
20:28:48.87 [DEBUG] purging metadata directory: /home/jreed/test/.pids/7ac24caa98f2/pantsd
20:28:48.87 [DEBUG] pantsd command is: PANTS_DAEMON_ENTRYPOINT=pants.pantsd.pants_daemon:launch_new_pantsd_instance PYTHONPATH=/home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/pants.ZVUioG/install/bin:/usr/lib/python38.zip:/usr/lib/python3.8:/usr/lib/python3.8/lib-dynload:/home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py38/lib/python3.8/site-packages /home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py38/bin/python /home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py38/bin/pants --pants-bin-name=./pants --pants-version=2.7.0 -ldebug
20:28:50.07 [DEBUG] pantsd is running at pid 46, pailgun port is 46277
20:28:50.07 [DEBUG] releasing lock: <pants.pantsd.lock.OwnerPrintingInterProcessFileLock object at 0x7f91398edd00>
20:28:50.07 [DEBUG] Connecting to pantsd on port 46277
20:28:50.07 [DEBUG] Connecting to pantsd on port 46277 attempt 1/3
Failed to launch child `/home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py38/bin/pants`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
flat-zoo-31952
10/06/2021, 8:59 PMflat-zoo-31952
10/06/2021, 8:59 PMwitty-crayon-22786
10/06/2021, 8:59 PMFailed to launch child
error is generic… i’m not sure where that is coming fromwitty-crayon-22786
10/06/2021, 9:02 PMstrace
to pantsd
before the client connects, that might shine some lightflat-zoo-31952
10/06/2021, 9:04 PMwitty-crayon-22786
10/06/2021, 9:04 PMpantsd
stays up, you can launch it, attach, then try againwitty-crayon-22786
10/06/2021, 9:05 PMwitty-crayon-22786
10/06/2021, 9:05 PMflat-zoo-31952
10/06/2021, 9:06 PMjreed@aa110e26cc53:~/test$ strace -p 46
strace: test_ptrace_get_syscall_info: PTRACE_TRACEME: Operation not permitted
strace: Could not attach to process. If your uid matches the uid of the target process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf: Operation not permitted
strace: attach: ptrace(PTRACE_ATTACH, 46): Operation not permitted
witty-crayon-22786
10/06/2021, 9:06 PMwitty-crayon-22786
10/06/2021, 9:07 PMwitty-crayon-22786
10/06/2021, 9:08 PMflat-zoo-31952
10/06/2021, 9:09 PMwitty-crayon-22786
10/06/2021, 9:09 PMwitty-crayon-22786
10/06/2021, 9:09 PMflat-zoo-31952
10/06/2021, 11:52 PMstrace: Process 1828522 attached
select(0, NULL, NULL, NULL, {tv_sec=0, tv_usec=880102}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {tv_sec=1, tv_usec=0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {tv_sec=1, tv_usec=0}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {tv_sec=1, tv_usec=0}) = 0 (Timeout)
...
That same empty select loop goes on forever. Subsequent child pants processes don't ever get to connecting to the socket it seems:
{ code: 13, kind: PermissionDenied, message: "Permission denied" }
jreed@aa110e26cc53:~/test$ ./pants -ldebug --version
23:48:56.42 [DEBUG] acquiring lock: <pants.pantsd.lock.OwnerPrintingInterProcessFileLock object at 0x7fb7eab99b80>
23:48:56.42 [DEBUG] releasing lock: <pants.pantsd.lock.OwnerPrintingInterProcessFileLock object at 0x7fb7eab99b80>
23:48:56.42 [DEBUG] Connecting to pantsd on port 42355
23:48:56.42 [DEBUG] Connecting to pantsd on port 42355 attempt 1/3
Failed to launch child `/home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py38/bin/pants`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
flat-zoo-31952
10/06/2021, 11:55 PMflat-zoo-31952
10/07/2021, 12:05 AMnc -v localhost 42355
and even with that the strace output of the pantsd process doesn't change. Seems really surprising. I guess tomorrow I'll open a formal ticket with the full repro steps and environment. I'm also open to rebuilding pants as a debugging stepwitty-crayon-22786
10/07/2021, 12:05 AMflat-zoo-31952
10/07/2021, 12:08 AMint select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
witty-crayon-22786
10/07/2021, 12:11 AMflat-zoo-31952
10/07/2021, 2:44 PM| cat
workaround doesn't work for me?witty-crayon-22786
10/07/2021, 3:52 PM2>&1
to also pipe stderr to stdoutflat-zoo-31952
10/07/2021, 4:17 PMjreed@aa110e26cc53:~/test$ ./pants --version 2>&1 | cat
Failed to launch child `/home/jreed/.cache/pants/setup/bootstrap-Linux-x86_64/2.7.0_py38/bin/pants`: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
flat-zoo-31952
10/07/2021, 4:18 PMflat-zoo-31952
10/07/2021, 4:18 PMjreed@aa110e26cc53:~/test$ echo | ./pants --version 2>&1 | cat
16:18:25.21 [INFO] Initializing scheduler...
16:18:25.25 [INFO] Scheduler initialized.
16:18:25.27 [WARN] Please either set `enabled = true` in the [anonymous-telemetry] section of pants.toml to enable sending anonymous stats to the Pants project to aid development, or set `enabled = false` to disable it. No telemetry sent for this run. An explicit setting will get rid of this message. See <https://www.pantsbuild.org/v2.7/docs/anonymous-telemetry> for details.
2.7.0
witty-crayon-22786
10/07/2021, 4:19 PMflat-zoo-31952
10/07/2021, 4:19 PMwitty-crayon-22786
10/07/2021, 4:19 PMflat-zoo-31952
10/07/2021, 4:20 PMflat-zoo-31952
10/07/2021, 5:41 PMhappy-kitchen-89482
10/07/2021, 5:42 PMflat-zoo-31952
10/07/2021, 5:45 PMbusy-vase-39202
10/07/2021, 7:27 PMflat-zoo-31952
10/07/2021, 7:28 PMbusy-vase-39202
10/07/2021, 8:51 PMwitty-crayon-22786
10/07/2021, 9:07 PMwitty-crayon-22786
10/07/2021, 10:36 PMflat-zoo-31952
10/07/2021, 10:54 PMwitty-crayon-22786
10/07/2021, 10:54 PM