-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Cannot install Pants > 2.19 if home directory in /etc/passwd
is a symlink.
#21321
Comments
The second error is because 2.22 has not been released yet, that is https://github.com/pantsbuild/pants/releases/tag/release_2.22.0 will also 404. (There have been several RCs and we hope it is really close, but it is not out yet!) I am unsure about the first error. When you say I hesitate to recommend this, but is deleting the cache ( |
Ah, yes, that might have been a miscommunication. Forget about 2.22... The main thing is: Tried tearing down Just to be sure it wasn't some quirk of config in our repo, we even cleared everything out including any Pants binary and did the following:
And still see the same error on these boxes. Any ideas how we could get this to spit out some more useful logs about what's happening perhaps? |
Can you conform what version of the scie-pants bootloader this box has?
I am not sure they would have much more that the earlier output, but you can try what is in |
This is what we see for the bootloader:
Only an |
Okay, a bit more context: We were able to reproduce this on a completely clean Ubuntu image on AWS with a new Pants repo: ami-0d486650b94f4c69b. Not sure whether that's pointing to some networking configuration around it (perhaps it's failing to fetch something silently?). |
ModuleNotFoundError
for pex
./etc/passwd
is a symlink.
We found the source of the issue. The Pants installer isn't correctly handling a symlinked home directory. In particular, in |
That looks frustratingly deep to debug; glad you found it! |
I have a similar observation / problem, but not with a symlinked home directory. In my case, it's when
In my case, 2.22.0 works correctly, but 2.23.0 fails (see below). No changes are required to make 2.22.0 work correctly. I'm creating the test environment with nested directory at /tmp/test/cache/.cache - failsThis set of steps fails with the failure message below for 2.23.0 and works for 2.22.0 Get shell in container with
less nested .cache directory inside /tmp/test - worksBefore running this test, terminate the container and restart it to return filesystem to default. Get shell in container with
2.23.0 failure message
2.23.0 success messageWhen using /tmp/test/.cache, 2.23.0 succeeds with
|
Thanks for the specific repro instructions. I now reproduce this locally, so will dig in. |
This is because pex computes a relative path of the "physical" cache dir And so if paths under the symlink are at a different depth than the corresponding "physical" paths, that relpath is incorrect. If they are at the same depth then that The underlying issue is that we I will file and fix over in pex. |
Fixed here: pex-tool/pex#2626 |
In almost all codepaths, a `pex_root` will be a realpath. See, e.g., https://github.com/pex-tool/pex/blob/06b8850f35ae67377ad2fe31d62ee1f71ba61eea/pex/pex_info.py#L511 https://github.com/pex-tool/pex/blob/06b8850f35ae67377ad2fe31d62ee1f71ba61eea/pex/variables.py#L320 However there was one codepath by which a non-realpath could be obtained, namely `boot()` calling`Variables.PEX_ROOT.value_or()` with a `raw_pex_root` given as the fallback value. This change ensures that `Variables.PEX_ROOT` is always a realpath. This manifested as a bug at pex boot time in the presence of a symlinked cache dir: pantsbuild/pants#21321
#21762 upgrades Pants to use Pex 2.27.1, which includes this fix. This should go out in the next dev release of Pants (2.25.0.dev2). If you need this fix in an earlier version of Pants you can manually update the Pex version in config:
|
Picks up pex-tool/pex#2626 to fix #21321
@benjyw I also encountered this issue for a long time. Happy to see some progress and effort made here. However, I just tried the pants 2.23.0 with Pex 2.27.1. I still have the same issue. Below is my sample log.
when I go inside to
What seems to me is that In my case |
I've just realized that upgrading pex in an existing version of Pants won't help, because this relates to the version of Pex that we package Pants with. Can you try upgrading to the just-released 2.25.0.dev2? |
Thank you @benjyw . I can confirm that 2.25.0.dev2 solves this issue 💯 . I will wait for the official release. |
Describe the bug
The
pants
CLI works fine in all of our environments at version 2.19. When we change the version to 2.20 or 2.21 or 2.22, we see one of two errors, although it's not clear why some environments trigger one and some another, given that they're all on the same Ubuntu (perhaps quirks of the user setup):Or
Pants version
2.19 - 2.22
OS
Linux:
Additional info
We've tried a bit of flailing to fix this:
./get-pants.sh
SCIE_BOOT=update pants
(yieldsNo new releases of scie-pants were found.
)We tried to install Pex directly into the virtual environment using
pip
, but gotFWIW,
https://github.com/pantsbuild/pants/releases/download/release_2.22.0/pants.2.22.0-cp39-linux_x86_64.pex
is not an accessible address as far as I can tell.The text was updated successfully, but these errors were encountered: