Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git failed to push (LFS upload missing objects)

I’ve been using Gitlab with LFS just fine for a while now but somehow ran into this problem today:

me@some-PC MINGW32 /b/Unity Projects/Platballer (master)
$ git push
LFS upload missing objects: (32/33), 30 MB | 0 B/s
Uploading LFS objects:  97% (32/33), 30 MB | 0 B/s, done
  (missing) Assets/External Assets/TimelineEvents/setup-guide.pdf (6ef8ef61e49821309de416925bf4e068ebb10a57f3398cb926e967eeb90cf034)
Counting objects: 401, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (400/400), done.
Writing objects: 100% (401/401), 1.40 MiB | 9.56 MiB/s, done.
Total 401 (delta 177), reused 0 (delta 0)
remote: Resolving deltas: 100% (177/177), completed with 31 local objects.
remote: GitLab: LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".
To arvzrg.asuscomm.com:arvz/platballer.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:me/project.git'

So I did what they said and ran git lfs push --all origin master which gives me:

Uploading LFS objects: 100% (330/331), 52 MB | 0 B/s, done
LFS upload missing objects:
  (missing) Assets/External Assets/TimelineEvents/setup-guide.pdf (6ef8ef61e49821309de416925bf4e068ebb10a57f3398cb926e967eeb90cf034)

It seems like that did whatever needed doing, right? So I tried pushing again, but I still get the exact same problem I did before.

I'm running my own installation of GitLab on a server on my network.

What else can I do here?

like image 245
Arvin Avatar asked Sep 20 '18 12:09

Arvin


People also ask

How do I push a file using git LFS?

Step 1: Download and Install Git-lfs ( Git Large File Storage ) from here. Step 2: Setup Git lfs for your user account git lfs install . Step 3: If you have already tried to commit large files and got the error then you must first undo the commit, use git reset — soft HEAD~1 otherwise ignore this step.

What does git LFS prune do?

In general terms, prune will delete files you're not currently using and which are not 'recent', so long as they've been pushed i.e. the local copy is not the only one. The reflog is not considered, only commits. Therefore LFS objects that are only referenced by orphaned commits are always deleted.

What is git LFS smudge?

git-lfs-smudge - Git smudge filter that converts pointer in blobs to the actual content.


1 Answers

Check if this is similar to gitlab-org/gitlab-ce issue 40616:

I've verified that it is possible to push to GitLab if the LFS objects are stored elsewhere, but LFS must be disabled for the project so that the LFS validation is disabled.

Disabled LFS for the project using the API (I'm using HTTPie)

http PUT https://gitlab.com/api/v4/projects/<id> name=<project-name> lfs_enabled=false Private-Token:<your token>

Add the lfs.url to the lfs config (for example GitHub)

git config -f .lfsconfig lfs.url https://github.com/<user>/<project>.git/info/lfs

Push to GitLab should now work

like image 84
VonC Avatar answered Oct 21 '22 12:10

VonC