When I add
git lfs track “/images/uploads/**”
it adds but doesn’t pick up any of the files already in the uploads directory.
when i do git push it says everything is up to date but none of the files have been replaced with pointers and nothing is showing as uploaded or processed in the large media settings in my site settings.
when I run netlify lm:info
I get :
√ Checking Git version [2.12.1.windows.1]
√ Checking Git LFS version [2.8.0]
√ Checking Git LFS filters
√ Checking Netlify’s Git Credentials version [0.1.8]
So everything looks OK but if I look up the version with : netlify
I see netlify-cli/2.15.0 win32-x64 node-v10.16.3
So it looks like the version doesn’t meet the CLI requirement.
When I reinstall with npm though, it is up to date, I don’t appear to be able to get a higher version.
So I’m not really sure where my problem lies.
I’m running this on Windows 10 machine via a command prompt with ruby.
@tofuwarrior, would you please check the output of the following command?
git lfs ls-files
Does this list your files? If not, then git itself isn’t tracking the files as LFS files so they won’t use Netlify Large Media (itself a Git LFS service).
Also, the content of .gitattributes may be helpful. This will show the LFS file tracking configuration (not which specific files are currently tracked but what the matching/tracking rules for LFS files are).
My best guess here is that “/images/uploads/*” is an absolute (not a relative path) so it isn’t finding your files. What this does on Windows - I don’t actually know. On most Unix systems this would point a non-existent directory so match nothing (unless someone had created this directory manually but, even then, it would still probably not be inside the git repo itself).
Would you try changing this to “images/uploads/*” (without the starting /)?
This will make the path relative to the base directory of the repo and could be part (or all) of the solution required here.
Once that is done, add your files and try the git lfs ls-files command again to see if they are tracked or not.
@tofuwarrior, everything looks good above. Would you please try running the following command?
git lfs push --all
Then check to see if those images are listed here after doing so:
(Note: they are not listed there currently.)
If the command above doesn’t fix this, the would you please run the version below and save the output in a text file:
GIT_TRACE=1 GIT_CURL_VERBOSE=1 git lfs push --all
This is the same command with two Git specific environment variables which will trigger diagnostic output to be generated.
Please do not post that file here (it is probably okay, but I want to play it safe). If you would please reply here, we’ll open a support ticket to keep troubleshooting this.
The commands didn’t quite work but if I added origin master they did.
Someting was uploaded but nothing showing in the LM area on the site which is puzzling.
I’ve pasted the output here:
G:\My Drive\Work\Development Work\ApacheWamp\www.clearspringacupuncture.co.uk\netlifyboilerplate>git lfs push --all
Specify a remote and a remote branch name (git lfs push origin master)
G:\My Drive\Work\Development Work\ApacheWamp\www.clearspringacupuncture.co.uk\netlifyboilerplate>git lfs push --all origin master
Remote “origin” does not support the LFS locking API. Consider disabling it with:
$ git config ‘lfs.https://[mycustomurldeleted].netlify.com/.netlify/large-media.locksverify’ false
Git LFS: (42 of 42 files) 52.68 MB / 52.68 MB
G:\My Drive\Work\Development Work\ApacheWamp\www.clearspringacupuncture.co.uk\netlifyboilerplate>GIT_TRACE=1 GIT_CURL_VERBOSE=1 git lfs push --all
‘GIT_TRACE’ is not recognized as an internal or external command,
operable program or batch file.
Additionally , I found I coudn’t now pull, it says I have unmerged files.
I tried doing git push --force to get things together but that hadn’t resolved anything so after some fiddling around, I did git add .
and git push
and then stuff pushed so I checked the LM storage on etlify and the files were there.
Unfortunately, the nf_resize function still isn’t dynamically resizing the files in question.
e.g. https://dev.clearspringacupuncture.co.uk/images/uploads/shutterstock_105193541.jpg?nf_resize=fit&w=551
For transparency, I wanted to update this thread with the resolution.
It turns out there were two issues:
the version of Git LFS being used was earlier than the required version here
because of this unsupported Git LFS version of the assets in our database/system were incorrectly uploaded
The solution was to update the version of Git LFS being used. Then additional work was done to remove the incorrect copies of those assets from our service. Once these two steps were completed one more git lfs push --all origin was needed and the issue was resolved.
This was a tricky issue to spot as there were two version of git being used. Note the logging above showed a valid version (Checking Git LFS version [2.8.0]). It turned out this version wasn’t being used by the local Git install when debugging output from git was examined.
At the end of the day, we did find the root cause, resolved the issue, and it is working correctly now.
Everything looks good on my end from this troubleshooting page. I updated GIT, and ran git lfs push --all origin However I’m still getting a 401 error on my netlify lm page (the url that is in the .lfsconfig).
Any reason why this would be?
Git LFS is tracking the correct files and everything is working correct locally. The files are just not showing up on the netlify side.
Hi, @drew. I believe we are troubleshooting this privately in another channel. Once we have a resolution there, we’ll update this topic with the solution (minus any private or sensitive details, of course).
I cannot get this to work with a Middleman setup, just get constant JS errors:
TypeError: "t is undefined" is shown once the admin has loaded, then TypeError: g is undefined when trying to upload any images, both referenced from mediaLibrary.js (in Firefox). Safari is a bit less cryptic with error messages TypeError: undefined is not an object (evaluating 't.map') and Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'g.find').
TypeError: Cannot read property 'map' of undefined
at S (netlify-lfs-client.js:158)
at Object.getResourceDownloadURLArgs (netlify-lfs-client.js:239)
at implementation.js:374
at /admin/async https:/unpkg.com/netlify-cms@2.9.7/dist/netlify-cms.js:234
The folder you use as a media folder source/images/uploads must exist and shouldn’t have any folders nested since having subfolders within your media library is not yet supported. Can you share your repo?
Problem is now I’m getting Large Media addon doesn't support the repo linked to multiple sites when trying to add it to this new repo using netlify lm:setup, even though it’s not linked to multiple sites Think it’s time to cut my losses with this.
There’s no upload folder within your images folder even though you specified it as your media library folder, causing at least some of these issues. Add the uploads folder to your images folder and try again
Even adding the upload folder (which I had in the other repo) I still get those JS errors. I’m just going round in circles now, even deleted all those repos and tried setting up another private one from scratch, same thing.
Thanks for your help though I can’t spend any more time trying to get this working.
@luke@tomrutgers So I grabbed another 30min looking at this, started from fresh again. Eventually I was able to get it working by adding a single image to the uploads folder, then pushing that. Is that something that is expected? I couldn’t see anything in the docs regarding that?