I eventually solved, even if it’s not totally clear what did the trick.
The last thing i changed was this: I noticed an error from git-credential-helper (which I also have installed manually): Aborting Netlify credential helper execution" error="open $home\\.config\\netlify.json:
so I’d copied the original file $home/.netlify/config.json to .config/netlify.json … yes… filename and directory switched… fairly odd…
hi @viviangb, would you mind pulling this out and posting a new thread in the #netlify-platform:netlify-large-media category? We’ll also need to know things like what your instance name (netlify URL) is, what you’ve already tried, and so on. thanks!
Hey, I am having some issues using large media for images, all looks good following the commands above. I can see the image in the correct directory in the sites large media section. However on the preview site I get a 404 for the image, can’t see any issues in the build logs etc.
Adding a git config to address an error message ( Remote "origin" does not support the LFS locking API. Consider disabling it.) that I would get when Ctrl-Cing my way out of entering a username and password. So consider running:
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