[Common Issue] Troubleshooting your Netlify Large Media Configuration

answered
#1

So, you are trying to use the Netlify Large Media feature and it isn’t working as expected. Where do you begin troubleshooting?

Well, we’re happy to answer. :slight_smile: Our Large Media plugin has several requirements to work correctly and those are are listed here!

Requirements

The first two requirements are:

  • access to a Netlify account with permissions for this site
  • the site is deployed via a tracked git repo (not manual deployments)

Netlify Large Media is built using Git Large File Storage (LFS). This means, if you aren’t using git, Netlify Large Media won’t work.

Third, much of what follows involves using git on the command-line interface (or CLI). If you don’t know how to use git via the CLI, please research that first before proceeding with the rest of this topic.

So, if you can log into Netlify and you are using git on the CLI, what’s next?

Is Netlify Large Media installed and working?

Next, we will check to see if Large Media is installed. Do to this, run the following command (in the base directory of the git repo:

netlify lm:info

Then you what see in your command line should look similar to this:

$ netlify lm:info
  ✔ Checking Git version [2.20.1]
  ✔ Checking Git LFS version [2.7.0]
  ✔ Checking Git LFS filters
  ✔ Checking Netlify's Git Credentials version [0.1.8]

If you don’t see results similar to those above (your versions could be newer for example - which is expected), then there is something missing.

To resolve the issue, you will need to resolve the missing requirements. Those are:

  • Git LFS version 2.5.1 or above, installed on your local machine. You can run git lfs version in your terminal to see if you have a valid version installed. If not, follow the installation instructions on the Git LFS website.
  • Netlify CLI version 2.6.4 or above. Refer to the CLI docs for information on installation, authentication, and linking your local repository clone to your Netlify site.
  • Installed the Netlify Large Media plugin for Netlify CLI.

Installing the Netlify Large Media plugin can be done by running the following commands in the base directory of your git repository:

netlify plugins:install netlify-lm-plugin
netlify lm:install

All the requirements are installed and it still isn’t working!

Hmmm. Well, if all the requirements are met, it is time to check the details.

First, confirm that all the required versions are correct this commands (again, in the base directory of the git repo):

netlify lm:info

If that command shows versions equal to or newer than the required versions, now it is time to check the following files (again, they are found in the repo base directory):

  • .gitattributes
  • .lfsconfig
  • .gitignore

In these files, look for common issues. If .gitattributes is empty, for example, the files are not being tracked by Git LFS. The solution would be to add files for tracking like so:

git lfs track <filename-or-filenames-here>

There are more details about this in our documentation here.

For the file .lfsconfig, check to see if the URL in that file ends with netlify.com/.netlify/large-media. Often people use another LFS provider like Github before switching to Netlify Large Media. Because of this, the previous LFS provider’s URL can be in .lfsconfig instead of Netlify’s.

And why .gitignore? Well, one common scenario is that large media files are being ignored here because, possibly, they previously were not being tracked by git. If so, then removing the .gitignore rules which ignore those files can be the solution!

If there are other questions about this, comments are welcome below!

#2

I have followed all the steps as mentioned in the docs and did run the troubleshoot, but still it is not showing the files in Netlify Large media.

#3

We’d be happy to help debug, but we’d need some more details. Perhaps you could provide a link to a page that isn’t working as you expect, with a description of the missing asset. Something like: “On my site https://mysite.com/resume, I have large media set up for the referred asset file.pdf. You can see in the browser dev console that it gets a 404” would be most helpful!

#4

Hi there, I have followed all the steps, I got the files looks “good”, but when i do git push it asks me user/password and the one I use to login to netlify doesn’t works.

It looks like some problem with git-credentials-netlify but I don’t know how to fix this.

Any idea?

thank you, Enrico

#5

I’m having the same problem as ilsasdo

When i try to push to the repo it asks me for the credentials

user@1c6910b52379:/app/travel-cecil$ git push
Username for 'https://mysite.netlify.com': my@email.com
Password for 'https://my@email.com@mysite.netlify.com': 

I tried logging into my netlify credentials, and the one created when it was from template. Do you know what these credentials are asking for? No credentials seem to work.

#6

Doing some further research the issues seems like this

I get pretty much the exact same error

user@1c6910b52379:/app/test-netlify$ DEBUG=1 GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push origin master
05:39:24.495448 git.c:344               trace: built-in: git push origin master
05:39:24.496352 run-command.c:646       trace: run_command: unset GIT_PREFIX; ssh git@github.com 'git-receive-pack '\''palidanx/test-netlify.git'\'''
05:39:25.579890 run-command.c:646       trace: run_command: .git/hooks/pre-push origin git@github.com:palidanx/test-netlify.git
05:39:25.586555 git.c:576               trace: exec: git-lfs pre-push origin git@github.com:palidanx/test-netlify.git
05:39:25.586652 run-command.c:646       trace: run_command: git-lfs pre-push origin git@github.com:palidanx/test-netlify.git
05:39:25.610646 trace git-lfs: exec: git 'version'
05:39:25.623785 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
05:39:25.632790 trace git-lfs: exec: git 'config' '-l'
05:39:25.635964 trace git-lfs: exec: git 'config' '-l' '-f' '/app/test-netlify/.lfsconfig'
05:39:25.642256 trace git-lfs: pre-push: refs/heads/master 1d7147f4baee3ec84a0221f1220962b2bc6ff5e7 refs/heads/master 8c2a7ce2a10112c1855e520a6a94247f64d2ee32
05:39:26.783783 trace git-lfs: creds: git credential fill ("https", "00af26a7-362b-4b16-af49-da645b3832c6.netlify.com", "")
05:39:26.787197 git.c:344               trace: built-in: git credential fill

And the authentication fails. When you try to enter credentials

Username for 'https://00af26a7-362b-4b16-af49-da645b3832c6.netlify.com': sdf
Password for 'https://sdf@00af26a7-362b-4b16-af49-da645b3832c6.netlify.com': 
05:57:50.552357 trace git-lfs: Filled credentials for https://00af26a7-362b-4b16-af49-da645b3832c6.netlify.com/.netlify/large-media
05:57:50.552938 trace git-lfs: HTTP: POST https://00af26a7-362b-4b16-af49-da645b3832c6.netlify.com/.netlify/large-media/locks/verify
> POST /.netlify/large-media/locks/verify HTTP/1.1
> Host: 00af26a7-362b-4b16-af49-da645b3832c6.netlify.com
> Accept: application/vnd.git-lfs+json; charset=utf-8
> Authorization: Basic * * * * *
> Content-Length: 36
> Content-Type: application/vnd.git-lfs+json; charset=utf-8
> User-Agent: git-lfs/2.7.1 (GitHub; linux amd64; go 1.11.5)
> 
{"ref":{"name":"refs/heads/master"}}05:57:51.517497 trace git-lfs: HTTP: 401

It’s oddly attempting trying to auth against the website endpoint.

It seems like when netlify login happens it isn’t storing the credential correctly?

#7

i have the exact same issue , did you manage to find a fix?

#8

All the troubleshooting steps show correct results, and i followed all the steps in the docs. But still nothing shows up in the Large Media section of netlify. I also get a 401 when trying to acess my “(…).netlify/media” . What may be causing that?

#12

The time on my clock was around (11’o clock), when I started facing the issue.

Yes, the FIX was very easy but it took me almost 8 hrs.

Here’s what I did,

  1. Turn off my laptop
  2. Take a good nite sleep
  3. Woke up
  4. Open the app.netlify.com
  5. and there you will find the fix

This is no joke, it really did work for me.

When I didn’t found any other solution, I give followed the above same steps.

What could be possible problem?
When we initialize Netlify Large Media in a site and upload few bigger size files, it seems like the netlify server is takes a longer time to process those files and show them.

#13

Hi, @palidanx. Would you please try using netlify logout followed by netlify login to see if this restores the credentials? And would you please confirm here if that works or not?

If it doesn’t resolve it, would you please open a support case with us?

#14

@yarilabs, would you also try the netlify logout followed by netlify login steps? And also open a support case with us if this doesn’t resolve the issue?

#15

Actually I think I made a mistake in the process and forgot to run netlify lm:install As a review this is what I ran

#cd to git base directory
netlify lm:setup
netlify lm:install
git lfs track "*.jpg" "*.png"
git push
1 Like
#16

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…

pinned #19
#21

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!