Something has broken with Git LFS, leaving me stuck and unable to push anything

Hi,

I’m having trouble pushing new commits that include any file changes tracked in Git LFS. Earlier today, I committed a .psd file — PSDs are being tracked in .gitattributes as LFS files. I just went to try and push to GitHub, but can’t get past this error:

Jack@Jacks-iMac:~/Sites/MyProject$ git push GitHub landing-pages
batch response: Authorization error: https://JackWH@github.com/JackWH/MyProject.git/objects/batch                                                                                                                                                                  
Check that you have proper access to the repository
Uploading LFS objects:   0% (0/1), 0 B | 0 B/s, done.
error: failed to push some refs to 'https://JackWH@github.com/JackWH/MyProject.git'

I definitely do have proper access to the repository — I’ve been pushing to it for years without issue. Running git lfs status outputs this:

Jack@Jacks-iMac:~/Sites/MyProject$ git lfs status
On branch landing-pages
Git LFS objects to be pushed to GitHub/landing-pages:
public/images/landing/screenshots/Screenshot.psd (3ad90fa780871ca89a53f5056348c5da5f5f079adb3bf8cd028bdf147e301af0)
Git LFS objects to be committed:

Git LFS objects not staged for commit:

As per GitHub’s support article, I tried the following too, without any luck:

Jack@Jacks-iMac:~/Sites/MyProject$ git lfs push --all GitHub landing-pages
Uploading LFS objects:   0% (0/7), 0 B | 0 B/s, done.                                                                                                                                                                                                        
batch response: Authorization error: https://JackWH@github.com/JackWH/MyProject.git/objects/batch
Check that you have proper access to the repository

I have also tried reinstalling with git lfs uninstall followed by git lfs install — same outcome.

Here is the output from git lfs env:

Jack@Jacks-iMac:~/Sites/MyProject$ git lfs env
git-lfs/2.9.2 (GitHub; darwin amd64; go 1.13.5)
git version 2.21.1 (Apple Git-122.3)
Endpoint (GitHub)=https://JackWH@github.com/JackWH/MyProject.git (auth=none)
LocalWorkingDir=/Users/Jack/Sites/MyProject
LocalGitDir=/Users/Jack/Sites/MyProject/.git
LocalGitStorageDir=/Users/Jack/Sites/MyProject/.git
LocalMediaDir=/Users/Jack/Sites/MyProject/.git/lfs/objects
LocalReferenceDirs=
TempDir=/Users/Jack/Sites/MyProject/.git/lfs/tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=/Users/Jack/Sites/MyProject/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file
UploadTransfers=basic,lfs-standalone-file
GIT_EXEC_PATH=/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"

I don’t mind if I lose the .psd file, I’m not precious about it being committed. But at the moment I’m stuck and unable to push anything at all. Any help would be much appreciated!

Thanks,

Jack

@jackwh - Hey there, and thanks for creating this topic!

“Check that you have proper access to the repository”  is an indication of an authorization error. Given the URLs posted in those logs, I see that the repository is JackWH/MyProject.

However, when I navigate to https://github.com/jackwh/myproject, GitHub.com returns a 404.

This could mean one of three things:

  • the repository doesn’t exist,
  • the repository is a private repository that only authorized collaborators have access to, or
  • it’s a name that serves as a placeholder for a different repository.

Moving forward, here are some questions that I’d love your confirmation on:

  • Assuming that the repository you’re pushing to exists, could we confirm with you that the name of the repository on GitHub.com matches what’s written on the command line? 
  • Because the error is related to authorization, would it be possible for you to double check the credentials you’re using to push to GitHub.com using Git? For example, it may be worth trying a personal access token instead of your account’s password to authenticate.

Here’s an example from one of our blog posts around using Git over HTTPS and OAuth :

git clone https://<token>@github.com/owner/repo.git

If you clone that repository, the token will already be embedded in the Git remote configuration. Alternatively, you could update your Git remotes by embedding the personal access token in the URL as a way of updating your authentication.

Let us know how you get on!

@jackwh - did you ever find a resolution to this issue? I have had a similar issue suddenly crop up on a handful of machines at work when fetching git-lfs data from Bitbucket.