Permission Denied Error When Executing a Job Locally on CircleCI CLI

I am trying to execute a local job on CircleCI CLI but I Keep on running into this:

====>> Checkout code
Making checkout directory "/home/circleci/project"
Copying files from "/tmp/_circleci_local_build_repo" to "/home/circleci/project"
Error: /usr/bin/cp: cannot create regular file '/home/circleci/project/.git/objects/pack/pack-e79d14cba850d4fc0867a11a2cc0353c912b4c50.pack': Permission denied

Command that trigers the above error:
circleci local execute -c .circleci/test-config.yml --job- test-job --org-id <org-id>

The job is being executed on the cimg/python:3.10 executor

Any ideas of what might be causing this?

1 Like

You may need to post more of your config.yml file as it is hard to understand the context of the command that is failing or the environment that you are working in.

The first thing that comes to mind is - is the git repo already found in /home/circleci/project/ at the time you run the command?

1 Like

Hi @0xabdi,
Sometimes restarting Docker fixes that.

But Docker Desktop > Troubleshoot > Clean / Purge data has almost always fixed that.

Though that’s an extreme approach, as it’ll clear all containers and images.

1 Like

Will try this and see if it solves the issue. Thanks @ryankienstra

1 Like