I’m trying to clone a GitHub repo that backs my Netlify site. The GitHub repo refers to files stored in Netlify LFS. (I am planning to migrate away since I heard it was deprecated, but step one is getting it cloned locally…)
I’m using an Ubuntu 22.04 LTS machine to do the cloning. I have the netlify CLI installed and the proper plugin installed as per the instructions: Large Media setup | Netlify Docs
What is happening:
When I try to clone, I’m getting prompted for a username/password combo. It appears to be coming from the netlify-credential-helper.
> netlify --version
netlify-cli/17.14.0 linux-x64 node-v20.11.0
> netlify login
Already logged in via process.env.NETLIFY_AUTH_TOKEN set in your terminal session
Run netlify status for account details
or run netlify switch to switch accounts
To see all available commands run: netlify help
> netlify lm:info
✔ Checking Git version [2.37.3]
✔ Checking Git LFS version [3.0.2]
✔ Checking Git LFS filters
✔ Checking Netlify's Git Credentials version [0.1.11]
I’ve tried netlify logout and netlify login - this doesn’t seem to change anything
I’ve tried manually sourcing the zsh include in my shell (but it’s already sourced in .zshrc)
I’ve tried updating to the latest node.js and reinstalling the netlify cli
I’ve tried deleting ~/.config/netlify and reinstalling the CLI and netlify lm:install
Of course, after I went through the trouble of writing all this down, I find this:
The netlify-credential-helper has a known issue that is several years old - it can’t use an API token defined in the environment.
What I had to do was spin up a VNC session on my Ubuntu box, install Firefox, and do netlify login at the terminal without NETLIFY_AUTH_TOKEN set. That opened a login page in Firefox.
The first time I logged in, it redirected me to the normal Netlify control panel interface, and the netlify login command timed out. I ran netlify login again, and since Firefox was already logged into Netlify, I instead got an OAuth prompt page. Accepting this prompt caused netlify login to succeed.
Sorry for the hassle, but I’m glad you were able to find a solution and could share this with the community. This will help other folks who stumble upon this thread.