[Support Guide] Troubleshooting your Netlify Large Media Configuration

Thanks so much! Had the same problem, spent hours trying to figure out what was wrong with my git configuration. Of course I should have realized this, but still: would be good to add an explicit warning to the settings page where one can switch on Asset Optimization (or better even: don’t allow users to turn it on when using Large Media).

Hi, @elmarj. There is an open feature request for exactly this (don’t allow one to be enabled if the other is in use).

If or when this change happens we will post an update here.

1 Like

Hi dear support & thanks for the guide @luke

I have set up a site/repo for netlify large media today, in order to being able to use transformations and publish the website.

I’ve managed to get it all running locally, in CLI, and uploading the tracked images to LSF seems to be working (also checked all things you OP mentioned and it’s all green checks).

but, since everything has been set up, my website builds are failing on push.

I have also added the env variable GIT_LFS_ENABLED to true, which seems to work.

I’m attaching the build error log, which seems very generic to me and I have no idea how to go on from here :slight_smile: any advice on debugging this further?

Thanks!
N.

6:01:53 PM: Build ready to start

6:01:56 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
6:01:56 PM: build-image tag: v3.6.1
6:01:56 PM: buildbot version: 44655717ddf0e7bd7f856f5b1154254de54b1d80
6:01:56 PM: Fetching cached dependencies
6:01:56 PM: Starting to download cache of 1.2GB
6:02:01 PM: Finished downloading cache in 5.544915992s
6:02:01 PM: Starting to extract cache
6:02:20 PM: Finished extracting cache in 18.693005743s
6:02:20 PM: Finished fetching cache in 24.552205934s
6:02:20 PM: Starting to prepare the repo for build
6:02:20 PM: Git LFS enabled
6:02:21 PM: Preparing Git Reference refs/heads/master
6:02:30 PM: Starting build script
6:02:30 PM: Installing dependencies
6:02:30 PM: Python version set to 2.7
6:02:30 PM: Started restoring cached node version
6:02:34 PM: Finished restoring cached node version
6:02:34 PM: v12.18.0 is already installed.
6:02:35 PM: Now using node v12.18.0 (npm v6.14.4)
6:02:35 PM: Started restoring cached build plugins
6:02:35 PM: Finished restoring cached build plugins
6:02:36 PM: Attempting ruby version 2.7.1, read from environment
6:02:37 PM: Using ruby version 2.7.1
6:02:38 PM: Using PHP version 5.6
6:02:38 PM: Started restoring cached node modules
6:02:38 PM: Finished restoring cached node modules
6:02:38 PM: Started restoring cached yarn cache
6:02:38 PM: Finished restoring cached yarn cache
6:02:39 PM: Installing NPM modules using Yarn version 1.22.4
6:02:39 PM: yarn install v1.22.4
6:02:39 PM: error An unexpected error occurred: “/opt/build/repo/package.json: Unexpected token v in JSON at position 0”.
6:02:39 PM: info If you think this is a bug, please open a bug report with the information provided in “/opt/build/repo/yarn-error.log”.
6:02:39 PM: info Visit yarn install | Yarn for documentation about this command.
6:02:39 PM: Error during Yarn install
6:02:39 PM: Build was terminated: Build script returned non-zero exit code: 1
6:02:39 PM: Failing build: Failed to build site
6:02:39 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
6:02:39 PM: Finished processing build request in 43.447594476s

update! my bad, I accidentally added ALL files to large media, instead of just the images… this broke the deployment of course.

now all images seem to be stored with git ls, at least in the git repo. but the large media section on netlify still isn’t activated (Netlify App) somehow and the image transformations are not working therefore.

Hi,
I just initialised my repo to use lm. But when I’m trying to push, I get the error Aborting Netlify credential helper execution and TLS handshake timeout. It then asks for username and password (I tried to fill out, but with no success).

I tried to re-initialise everything, but now when I run netlify lm:setup it throws TextHTTPError: Unauthorized.

What can I do to make it work?

1 Like

Hi @luke,

My site: lwrc.io I have followed the doc and setup, and all the git lfs ls-files listed files in the GitHub remote repo are now pointers. But out of the 3 file types in the directory: JPG, PNG and SVG, only the SVGs successfully show up in the deployed site and in the “Large Media” tab of the admin page.
My .gitattributes only contains
frontend/src/components/media/** filter=lfs diff=lfs merge=lfs -text

I’ve checked the versions, reinstalled, logout login, unlink link, and tried all the common trouble-shooting commands and all of them returned no errors. I wonder did I overlook some steps during setup? Thank you so much for the help.

Hi, @flip-it. Are you logged in using the netlify-cli when running netlify lm:setup command?

If not, please try using this first:

netlify login

For your issue, @FoolishMastermind, there are two requirements for files to appear in the Large Media tab at Netlify. Be sure both of the following requirements are met:

  1. The file is tracked using Git LFS.
  2. The file is part of a deploy at Netlify (which means the file exists somewhere under the publish directory when the build at Netlify is complete).

For the first requirement, the file must be listed when this command is run:

git lfs ls-files

For the second requirement, you can download the deploy at Netlify to see what files exist in that deploy. Here is a screenshot of the button to use:

download-deploy-button-small

For the site you mention, I am able to see the repo (because it is public) and the deploy (because I am Netlify support).

Here is what I see for the repo:

$ git lfs ls-files
59116f23b3 - frontend/src/components/media/bg-banner.jpg
7473cbccb3 - frontend/src/components/media/bg.jpg
18b34d247f - frontend/src/components/media/icon-github.png
e45d3a4a84 - frontend/src/components/media/icon-instagram.png
fc50c204e0 - frontend/src/components/media/icon-linkedin.png
82de3fd250 - frontend/src/components/media/icon-youtube.png
97479cf0eb - frontend/src/components/media/intro-image.jpg
3f38398f2c - frontend/src/components/media/loader.gif
9273959be5 - frontend/src/components/media/svg-design.svg
406dbc1350 - frontend/src/components/media/svg-drum.svg
b5ee5eec5e - frontend/src/components/media/svg-engineer.svg
2dc54e3c26 - frontend/src/components/media/thumbnail.png

This is what I see in the deploy:

/robots.txt
/manifest.json
/asset-manifest.json
/index.html
/favicon.ico
/logo192.png
/logo512.png
/static/media/svg-design.e0b500f1.svg
/static/media/svg-drum.a09e3166.svg
/static/media/svg-engineer.7a6b7813.svg
/static/js/2.d725c679.chunk.js.license.txt
/static/js/runtime-main.9d63ab6e.js
/static/js/3.e576ed47.chunk.js
/static/js/3.e576ed47.chunk.js.map
/static/js/main.0479cbb3.chunk.js
/static/js/runtime-main.9d63ab6e.js.map
/static/js/main.0479cbb3.chunk.js.map
/static/js/2.d725c679.chunk.js
/static/js/2.d725c679.chunk.js.map
/static/css/main.f775ea05.chunk.css
/static/css/main.f775ea05.chunk.css.map

So the issue does appear to be caused by the second requirement. The files in question are not appearing in the publish directory so they are not part of the Large Media files for the site. The solution is to be sure to move the file there before the deploy completes.

If there are other questions or concerns, please let us know.

Hi @Luke , yes I am logged in and have tried to logout and login again.

Hi, @flip-it. The issue in your case is authentication related. Are you possibly using an Apple computer with the M1 CPU? If so, this is likely the issue:

If you are not using an M1 CPU and are able to login, would you please send us output of the following commands?

netlify status
netlify lm:info
git config -l

You can post that information publicly or you can private message (PM) that to one of our support staff. I’ve confirmed that PMs are enabled for your community login. Please keep in mind that only one person can see the PM and this will likely mean a slower reply than posting the information publicly. Please feel free to reply to however you prefer though.

Hi, @flip-it. I suspect you are running into the issue mentioned here:

https://github.com/netlify/cli/issues/514

Some people have reported that using an auth token to work around the authentication issue:

https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui

Would you be willing to test that and let us know your results?

Hi @luke
I looked at your GitHub link now https://github.com/netlify/cli/issues/514 and saw in the last comment that CLI version 3.8.0 address this issue. I installed it and now it works. So no need to try the auth token then. Thanks a million for your help!

Hi, @flip-it. Thanks for letting us know the most recent update to netlify-cli resolved the issue! We appreciate you taking the time to let us know and if there are other questions, we’ll be here! :+1:

@luke, now that I can push I could finally test in production. And unfortunately the files tracked by lfs returns index.html. I guess it’s because I have a redirect rule for SPA like this:

# _redirects:
# ...
/index.html        /

I understand that the rule shouldn’t match actual existing files (since it is not set to force). Maybe this is not true for lfs-files?

The redirect rules do not behave different for LFS tracked files so something else must be happening. Have you downloaded the deploy to see if the file in question are part of the deploy?

If the files are missing from the deploy, we next need to troubleshoot the site build process to find out why it isn’t putting those files into the publish directory. Would you please link us to the deploy logs where those files are missing?

If the files are in the deploy, what is a URL for a file which should work and does not?

​Please let us know if the files are in the deploy or if there are other questions about this.

Good to hear they behave the same @luke! And thanks for the tip about downloading the deploy, didn’t know about that feature. Turns out the files weren’t there. I removed and re-added the files and now it’s all good!

time="2021-05-07T09:04:44+02:00" level=error msg="Aborting Netlify credential helper execution" error="Get \"https://api.netlify.com/api/v1/sites/MY_SITE_ID.netlify.app\": dial tcp: lookup api.netlify.com on [fe80::4ad2:4fff:fe15:1c2b]:53: write udp [fe80::5c:bc28:eed0:55be%en0]:50199->[fe80::4ad2:4fff:fe15:1c2b]:53: write: no route to host"

It happens when I try to push lfs setup. Has anyone had this problem? It asks for credentials but it does not work either. I did ntl logout/login, unliked and linked my site, netlify helper is in $PATH, credential helper installed… No idea how to solve it :frowning:

Hi, @AverageNetlifyBoi. We have sent you an email to the email address associated with your Netlify account, and we’ll communicate with you through that email to continue resolving this issue.
(Please note that for security reasons, we will not contact you at email addresses not listed in your Netlify account.)

Also, please let us know with a reply here if you don’t receive a message from us about support ticket # 56428.

Hi Luke,

I got the email, thank you! I will look into the logs this evening and will get back to you, thanks!

I just setup NLG on a new repo. The images are not showing in the Large Media tab and I’m getting 404 on the website.

This is the netlify lm:info output
√ Checking Git version [2.30.0.windows.2]
√ Checking Git LFS version [2.13.2]
√ Checking Git LFS filters
√ Checking Netlify’s Git Credentials version [0.1.10]

I verified the .lsconfig file and tried the ‘git lfs push --all’, which shows the three images being uploaded to the repo.

git lfs ls-info shows the three images I using on the site( a nuxtjs site).

I also updated the Netlify CLI a few hours ago → netlify-cli/3.33.2 win32-x64 node-v14.15.4

Any other things I could try?

Hi, @Jamesv2.0. We have sent you an email to the email address associated with your Netlify account, and we’ll communicate with you through that email to continue resolving this issue.

Also, please let us know with a reply here if you don’t receive a message from us.

1 Like