LFS problem when running `netlify lm:setup` (Error: No site id found, please run inside a site folder or `netlify link`)

Trying to enable lfs. I’ve followed the requirement steps listed here and have made it to step 3 here: netlify lm:setup

Here’s the error I get.

I unlinked (netlify unlink) and relinked (netlify link) my site and tried again. Same error. Any help would be appreciated. Thanks!

Site name: segolily.netlify.app

Hi, @cpenned, that is an odd one.

Would you please send us the output of the following command (run from that same repo directory)?

netlify status

It also looks like this site does have a Large Media instance add-on now so if you resolved this already, please feel free to share the solution you found here. If not though, we are happy to keep troubleshooting as well.

I’m still getting the same error?

Hi, @cpenned, I’m not sure why you are running netlify lm:setup.

I’m showing this site already has Large Media configured for it. Are you trying to push your content to Large Media? If so what happens when you run this command?

git lfs push --all origin

Is that command successful? If not, please send us the output of the following as a private message (PM):

GIT_TRACE=true GIT_CURL_VERBOSE=true git lfs push --all origin

I’m assuming below that Netlify CLI (the npm package netlify-cli) is installed globally.

I would recommend running the following commands to make sure the dependencies are in place for this to work.

First, let’s sure the latest Netlify CLI tool is installed with this:

npm install netlify-cli -g

Next, check that the Large Media the plugin is installed for Netlify CLI itself:

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

If all that is successful, please try this again:

netlify lm:setup

If this allows pushing to the site, please let us know.

However, if it still doesn’t work, then please run these two command:

cat .netlify/state.json
netlify lm:info

Then would you please private message (PM) me a copy/paste of the output of all of these commands above from the terminal/shell (every command in this reply)? I’ve confirmed PMs are enabled for you account.

If there are questions about any of this, please let us know.

Hi, @cpenned. I received the PM with the git lfs push debugging output and I see no errors there.

Would you please send us the output of these two commands?

cat .netlify/state.json
netlify lm:info

Hi, @cpenned. I’m seeing issue in the latest PM:

cat: .netlify/state.json: No such file or directory

This file controls which site the repo is linked to. The command netlify link creates this file and it should contain the site id from your screenshot:

So, one screenshot shows this file working. The command output shows it also not working as the file doesn’t exist.

This would seem to be impossible. Like Schrödinger’s cat, the file is both dead and alive at the same time.

Are these two commands being run in the same directory (not the same repo, but the exact same directory where the repo is being clone to)?