git clone with Git LFS, you may encounter errors like the following:
batch response: Bad credentials batch response: Bad credentials0/1), 0 B | 0 B/s Failed to fetch some objects from
smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
These errors indicate authentication issues during the cloning process, specifically when using deploy keys.
If you are using the CircleCI GitHub OAuth Integration/CircleCI BitBucket OAuth Integration: Deploy keys are typically used for automated processes and have more restricted permissions compared to user keys. To resolve the "Bad credentials" errors, you should use a user key instead of a deploy key.
You can configure this on your Project Settings -> SSH Keys -> Add User Key.
CircleCI recommends the use of a Machine user for a User key that has access to the specific repositories that you need to access.
You can also create an Additional SSH key that has access to these dependencies. Please view the documentation on how to accomplish this here.
If you are using the CircleCI GitHub Apps/CircleCi GitLab Integrations: Please make sure that the SSH Key that you have configured for your Project has access to any repositories that you need access to. If the SSH configured does not have access, please feel free to create an additional one which can be found here.
By using a user key instead of a deploy key, you can resolve the "Bad credentials" errors when using
git clone with Git LFS. User keys have broader permissions and are better suited for interactive operations.