Cannot commit changes to github after enabling netlify large media

Hi! I ran the command netlify lm:setup and I am trying to commit .lfsconfig file and state.json that contains my linked site. VS Code is asking for username and password when I try to push the change. I have tried the username and password that I use to login to netlify, then I tried github username and password and nothing seems to work. Any ideas what can I do?

Seems that I need to install separately git-credential-netlify . Was able to do it using
brew install git-credential-netlify

Thanks for the follow-up to share the solution you found with the community! We appreciate the extra effort as this answer will now be able to help other people if they experience the same thing. :slight_smile:

Hi again,

As a feedback with my experience so far, it looks like Large Media is very unpredictable and not very reliable. Sometimes it’s blazing fast and then 1 minute later it’s terrible! Is there any way to fix this (upgrade to some paid plan or something?). My user experience has degraded considerably (my website depends a lot on images) and if I cannot trust that it will load them in good timing, I will need to switch back to gastby-image, which is less than ideal (since I have a lot of images). The images are optimized already, so it doesn’t seem to be an image issue. The same page might load really fast or really slow, with the same internet connection speed.

BR,
Oana

Yikes!

That isn’t expected or normal - service time should be on par with non-large-media assets and if you’re seeing something different then something is almost certainly wrong and we’d be happy to troubleshoot.

If you can send us the value of the HTTP response header x-nf-request-id (please paste as text - it’s extremely hard to retype from a screenshot!) for such a slow request we’ll be able to trace it through our system to understand the behavior.

Hi,

Thank you for trying investigate this! I am aware this can’t be as fast as gatsby-image, but still the whole experience feels weird.

Here is the HTTP response header:

x-nf-request-id: 9dfe6d70-d677-4f1c-b87a-3731aa0f63f4-5750480

This is my website :

https://www.wildplanetblog.com/

Hopefully there is an explanation for this and maybe I didn’t configure something correctly.

Thank you again!

Br,

Oana

Using Large Media shouldn’t change the performance of the site and suspect that there may be some other root cause of this. I’m not saying it is impossible that Large Media is the cause, only that I haven’t seen this happening before.

I checked the x-nf-request-id given and I show that that specific request has a 2 ms response. So that specific request appears quite fast to me and it could be a different request for this.

I do show a later request for this same URL which was slower. However, that slow request shows a client connection abort (the requesting browser closed the connection). This slow response (the client closed one) also appeared to be from a mobile device from the User-Agent string sent.

Did the slow response you saw happen on a mobile device? If so, can this issue be reproduced on a desktop system (meaning a device which isn’t a mobile device)? I’m asking because, with mobile devices, slowness can be caused by issues with the mobile network itself and that is not something Netlify can control.

If so, it might also help to check the network tab in the browser developer tools. This should reveal more detail about the reason for the performance issue.

There is more information about how to gather this information using developer tools (Chrome specific) below:

These tools may reveal additional details to explain the slowness. For example, the image fetch could be locally queued and, therefore, the slowness issue would be unrelated to our CDN or Large Media. (It could be something else, and I’m only hypothesizing about common scenarios.)

If you do see slowness in those tools, would you be willing to share that information here (for example , as a screenshot)?

Hi,

Thank you for investigating! Now that you mentioned the queue, I think the problem is that the first image (background image on desktop, first image on mobile) is fetched last, so I guess that is why I see it as slow.

According to Lighthouse my pages are fast anyway (99% on desktop, 85% on mobile and this is due to facebook and google analytics, not to netlify), so it doesn’t affect any SEO rankins, It’s just about the UX.

Another thing might be that gastby-image was generating webp formats for the browser that supported them, which probably were a lot faster to load. I guess Large media doesn’t yet have any kind of transformations depending on what browser I use (unfortunately webp doesn’t work with firefox yet).

Also I suspect that if I browse through the pages fast enough, the images from the previous page are somehow still getting fetched and then the new images take more time, which didn’t happen before. If I wait a bit longer on the page it’s fine.

In the end I think there were many factors that affected the loading of images getting slower, but thank you for confirming that there is nothing wrong with Large Media! I will investigate more into my implementation and try to see why the background image is loaded last.

I really like Netlify so far, I think it’s a great product and it made my website really fast in general, so keep it up!

Have a great day!

BR,

Oana

1 Like

thanks for your kind words, Oana! Come back any time with more questions :slight_smile:

I have the same issue now as originally stated in this post. But brew install git-credential-netlify does not work… It can not find any package by that name.

I’ve tried unlinking and running netlify link + netlify lm:setup again, which all run fine, but then I still get the question for a username for the LFS server… :frowning:

Also netlify lm:info returns an all good result:

➜  $ netlify lm:info
  ✔ Checking Git version [2.23.0]
  ✔ Checking Git LFS version [2.10.0]
  ✔ Checking Git LFS filters
  ✔ Checking Netlify's Git Credentials version [0.1.8]
  1. I also ran the following, as per this troubleshooting post:
$ netlify plugins:install netlify-lm-plugin
$ netlify lm:install
  1. Now I was not asked for a username but I am getting the following error on git push:
Authentication required: Authorization error: https://XXXX.netlify.app/.netlify/large-media/verify
Check that you have proper access to the repository
  1. I then ran netlify unlink and then netlify link again, then chose the option to manually select a recently updated repo and THAT solved it.

I have regularly had issues with Netlify Large Media, it seems fragile. Last time unlink + link did the trick, now it was a bit more complex.

Hi, @bramwillemse.

The solution below works for most people:

npm i -g netlify-cli
netlify plugins:install netlify-lm-plugin
netlify lm:install
. ~/.netlify/helper/path.bash.inc
netlify lm:info

The final command should now show something like this:

$ netlify lm:info
  ✔ Checking Git version [2.26.2]
  ✔ Checking Git LFS version [2.10.0]
  ✔ Checking Git LFS filters
  ✔ Checking Netlify's Git Credentials version [0.1.9]

The key here is that the final line should say “0.1.9” and not some other version. Also, please make sure the . ~/.netlify/helper/path.bash.inc line appears in .bash_profile (or the equivalent file if you are not using bash).

If this doesn’t resolve the issue, please let us know.

Running the commands above did not help, until I actually went and manually deleted all the netlify-cli files from my global, however even if everything looked correct (it said 0.1.9), it was still asking me for username.
If the solution above doesn’t work try to install git-credential-netlify package manually:

If you are using MAC you can try these commands:
brew tap netlify/git-credential-netlify
brew install git-credential-netlify

More info here: GitHub - netlify/netlify-credential-helper: Git credential helper to use Netlify's API as authentication backend

2 Likes

thanks for sharing this! :smiley: