A user in our org was met with this error. The fil...
# general
h
A user in our org was met with this error. The file has the proper
#!/usr/bin/bash
shebang line, but this error makes it seem like it's getting invoked with
sh
. Any ideas why that might be the case?
Copy code
/tmp/pants-sandbox-fWn7OP/./jfrog.pex_pex_shim.sh: 2: set: Illegal option -o pipefail
b
Have you confirmed that
/usr/bin/bash
understands
set -o pipefail
when run outside of pants? if it does, https://www.pantsbuild.org/docs/troubleshooting#debug-tip-inspect-the-sandbox-with---keep-sandboxes gives a way to jump into the sandbox and simulate the commands pants was running
h
Yup, I got the file for inspection with keep sandboxes
And yes, that command works fine in the user's terminal
Unfortunately, it's just this pex shim, another, and some source code. No run.sh file
b
(Just checking in case it's significant: the sandbox simulator is
__run.sh
with two underscores.) Weird 🤷‍♂️
h
Copy code
$ ls -la
total 52
drwxr-xr-x 5 nathanael nathanael  4096 Jun  8 17:39 .
drwxr-xr-x 9 nathanael nathanael 24576 Jun  8 17:38 ..
drwxr-xr-x 4 nathanael nathanael  4096 Jun  7 17:17 astranis-python
drwxr-xr-x 5 nathanael nathanael  4096 Jun  8 17:42 jfrog.pex
-rwxr-xr-x 1 nathanael nathanael  3246 Jun  7 17:17 jfrog.pex_bin_python_shim.sh
-rwxr-xr-x 1 nathanael nathanael  3239 Jun  8 17:39 jfrog.pex_pex_shim.sh
drwxr-xr-x 2 nathanael nathanael  4096 Jun  7 17:17 jfrog_secrets
Nothing sadly
🤷‍♂️ 1
e
I mean, there is a whole can of worms with env vars. Does the user let any leak through via ~/.pants.rc or the like? For example
POSIXLY_CORRECT
?
Basically, that is a whole avenue to explore if you have not. Env vars + config files. If bash only works because it can see one or both of those and they are gone in the sandbox hermetic env - boom.
h
Yeah that’s kind of the issue here is not knowing what can affect this.
They don’t have anything custom set up. This is a new employee that was trying to set up their system.
No obvious differences in the environment between a working system and theirs. If they
pants package
the pex and then run things as opposed to
pants run
, things work fine.
e
Well, the PEX is not what is being run in the sandbox per the error message. Its running the shim bash script created by pants and failing in that on line 2.
So, yeah. Definitely an issue with the sandbox shim script / bash and not with the PEX.