allexiusw
allexiusw

Reputation: 1743

KeyError: 'Name' in pipenv/vendor/importlib_metadata/_adapters.py:54 using pipenv

I got this weird error in my CI/CD pipeline running in GCP Cloud build.

Package installation failed... KeyError: 'Name' site-packages/pipenv/vendor/importlib_metadata/_adapters.py:54 everything is working locally when runnning pipenv install.

I'm running in python 3.11.4.

Troubleshooting steps that I have followed are:

Still more on it:

Upvotes: 2

Views: 229

Answers (1)

allexiusw
allexiusw

Reputation: 1743

After running and validating that the build was working properly in docker by using:

docker buildx build --platform linux/arm64 -t fakename -f Dockerfile .

I found that pipenv was resolving the dependencies correctly by building the image properly all along the way. Then I found that I had this setting in kaniko:

--cache=true

Then I disabled it by setting --cache=false and it worked and solved the issue, this will slow down the builds unfortunately but I had no options for now.

I explored and tested other options for example:

  1. Do not shout down the cache entirely and instead use cache-ttl:
--cache=true
--cache-ttl=24h

And it worked the first time but after a while maybe 2 hours later it lead me to the same issue so I rolled back the changes unfortunately.

  1. I found --cache-repo setting and this give me the following combination:
--cache=true
--cache-ttl=24h
--cache-repo=myrepo

Maybe that will avoid other cache repos to overwrite my dependencies' cached in this repo and will give me the granularity that I need for the cache(I have not tested this yet).

Upvotes: 0

Related Questions