[Support Guide] Troubleshooting your Netlify Large Media Configuration

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.

My latest deploy

Hi, @danjmurphy92. I opened a support ticket for this and I’ll also follow-up in this other topic (which looks like the “original” topic):

https://answers.netlify.com/t/large-media-images-404/2404/5

I solved this same problem by:

  1. Using nvm to manage my packages instead of npm

  2. 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:

git config lfs.https://d7dg5c72-5439-b0eg-46a4-dgfcd61d9936.netlify.com/.netlify/large-media.locksverify false

1 Like

I solved credential problem by manually added to .git/config:
[credential]
helper = netlify

3 Likes

it worked for me too. I manually added in .git config this:

[credential "https://your-netlify-website-name.netlify.com"]
helper = netlify

Reference: Git - gitcredentials Documentation

1 Like

Hi,

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.

Thanks, I’m stumped!

@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.

If not, please let us know.

Hey, thanks very much for your reply.

In gitattributes the paths are not /images, they are images:

images/uploads/** filter=lfs diff=lfs merge=lfs -text
images/uploads/* filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text

git lfs ls-files lists the files but the netlify dynamic resizing isn’t working. e.g.

https://dev.clearspringacupuncture.co.uk/images/uploads/shutterstock_105193541.jpg?nf_resize=fit&w=551

IS the full sized original image, not a netlify resized image which is my goal

Output of git lfs ls-files is below.

1bef71d374 - assets/img/uploads/screenshot-editor.jpg
872f07402f - images/pic01.jpg
49aae25ed7 - images/pic02.jpg
0d82c20904 - images/pic03.jpg
ee6aa87631 - images/pic04.jpg
d831ff7b20 - images/pic05.jpg
50349ee54c - images/pic06.jpg
01fdd2b0d8 - images/pic07.jpg
289c606a62 - images/pic08.jpg
9b6489e5aa - images/slide01.jpg
3c95a687b6 - images/slide02.jpg
a6d3bc0f1e - images/slide03.jpg
7a56655cf2 - images/uploads/acupuncture-model-back551x297.jpg
8602c913b0 - images/uploads/baby-in-towel-551x297.jpg
cb00f55eb2 - images/uploads/child-on-beach-with-spade551x297.jpg
f4b80f04a3 - images/uploads/children-smiling-551x297.jpg
58397ef4bb - images/uploads/chinese-parchment-551x297.jpg
a79ba2bcd5 - images/uploads/emotional-wellbeing-551x297.jpg
fa6beb4f1e - images/uploads/fertility-551x297.jpg
c4cdde5eb4 - images/uploads/hand-up-in-class551x297.jpg
ddf743e780 - images/uploads/hands-with-book-and-pen-551x297.jpg
43dd8b6116 - images/uploads/little-gang-1433289.jpg
4e5e7c7ffe - images/uploads/male-female-gender-symbols-drawn-in-chalk.jpg
a4bf0cd273 - images/uploads/middleaged-woman-chatting-sofa551x297.jpg
3cff8728a0 - images/uploads/moxa-rolls-551x297.jpg
17fcf283ff - images/uploads/open-book551x297.jpg
58c75d76e2 - images/uploads/pain-freedom-551x297.jpg
20b91234d0 - images/uploads/paper-family-in-hands551x297.jpg
6d6b8c9756 - images/uploads/physical-health-551x297.jpg
a8c5460c1e - images/uploads/pregnancy-birth-551x297.jpg
3d4f588c04 - images/uploads/senior-guy-2000x900.jpg
f632b8c4bf - images/uploads/shutterstock_103943927.jpg
b68efea62b - images/uploads/shutterstock_104963795.jpg
c3dd00e901 - images/uploads/shutterstock_105193541.jpg
37b83c5be2 - images/uploads/shutterstock_107645981.jpg
6986c5ebb6 - images/uploads/shutterstock_127297229.jpg
8530d40360 - images/uploads/shutterstock_66226753.jpg
bad333cbe0 - images/uploads/students-studying551x297.jpg
7852558ca6 - images/uploads/taking-pulse551x297.jpg
9b5782ba97 - images/uploads/teenagers-by-wall-551x297.jpg
46ab5b690b - images/uploads/three-smiling-people-2000x900.jpg
42bb3316b8 - images/uploads/womens-health-551x297.jpg

@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.

Hi Luke,

really appreciate your help with 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.

What is the next step?

thanks again,

Paul

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

which can be seen here:
https://dev.clearspringacupuncture.co.uk

CAn you advise what else I haven’t done?

`

Any ideas on this @luke?

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. :slight_smile:

Hi Luke,

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.

Let me know! thanks!

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).

2 Likes

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

netlify-cms-app 2.9.7
netlify-cms-core 2.12.2

  ✔ Checking Git version [2.23.0]
  ✔ Checking Git LFS version [2.8.0]
  ✔ Checking Git LFS filters
  ✔ Checking Netlify's Git Credentials version [0.1.8]

backend:
  name: git-gateway

media_folder: source/images/uploads
public_folder: images/uploads

collections:
  - name: blog
    label: Blog
    folder: source/posts/
    extension: .html.md
    format: frontmatter
    slug: '{{title}}'
    create: true
    fields:
      - {label: Title, name: title, widget: string, required: true}
      - {label: Publish Date, name: date, widget: datetime}
      - {label: Image, name: image, widget: image, required: false}
      - {label: Body, name: body, widget: markdown}

Anyone seen anything like this? Wasted a few hours on this now and can’t find a resolution. The site I’m trying to setup is Netlify CMS

Do you have subfolders within your media library folder maybe?