Hey folks! Having a weird issue when trying to bui...
# general
b
Hey folks! Having a weird issue when trying to build a Docker image using Pants. Here’s the error:
Copy code
pants package src/docker/scraper:img
19:16:12.60 [ERROR] 1 Exception encountered:

Engine traceback:
  in `package` goal

BinaryNotFoundError: Cannot find `docker-credential-ecr-login` on `['/bin', '/home/ubuntu/.cargo/bin', '/home/ubuntu/.depot/bin', '/home/ubuntu/.local/bin', '/home/ubuntu/.local/bin/pants', '/home/ubuntu/.ns/bin', '/sbin', '/snap/bin', '/usr/bin', '/usr/games', '/usr/local/bin', '/usr/local/games', '/usr/local/sbin', '/usr/sbin']`. Please ensure that it is installed so that Pants can use docker.

make: *** [Makefile:31: build-docker] Error 1
1
Here’s the weird part - when I look for
docker-credential-ecr-login
, it’s present in
/usr/bin
, which is one of the paths that was searched:
Copy code
ls /usr/bin/docker-credential-ecr-login
/usr/bin/docker-credential-ecr-login
Is there any reason why Pants might think that this tool is not installed even though it’s in one of the search directories? I’m wondering if it could be a permissions issue or something like that
g
Did you install the tool while pantsd was running?
(i.e., is the failure to locate a result of caching)
b
Yeah, I actually think that might be the case because I just installed recently and this is the pantsd process:
Copy code
ubuntu    726886       1  1 Mar11 ?        00:34:17 pantsd [/data/krishnan/backend]
Let me try killing pantsd and running again
That worked 🙂 Thanks Tom!
g
This question arises once per week in our work slack, and here... Should probably try to fix it. I'm not sure why it's like this. Maybe because it's a throw and not a return-failure.
b
Sorry about that. I tried to search but couldn’t find it here, I see now that there are some past examples too: https://pantsbuild.slack.com/archives/C046T6T9U/p1702566591379719?thread_ts=1702555875.675089&cid=C046T6T9U
c
I'm not sure why it's like this.
There's more info on this here: https://github.com/pantsbuild/pants/pull/17207