Error, could not load sites ... Failed to fetch

Issue Summary

Unstalled Local and installed version 5.9.4+5115 and am unable to see any sites in the Local Sites tab.

Troubleshooting Questions

  • Does this happen for all sites in Local, or just one in particular?

    • Yes … happens in all sites
  • Are you able to create a new, plain WordPress site in Local and access it in a Browser?

    • I can create a new site and it starts up … am able to access it in the browser (both front and back end), but when I restart Local the sites are missing from the list and I’m unable to restart any of them. I currently have 2 sites that are on the hard drive, but inaccessible via Local

Replication

System Details

  • Which version of Local is being used?

    • 5.9.4+5115
  • What Operating System (OS) and OS version is being used?

    • Microsoft Windows 10 Home 10.0.18363 Build 18363
  • Attach the Local Log. See this Community Forum post for instructions on how to do so:

{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%userDataPath%%\\lightning-services\\mysql-5.7.28+4\\lib\\main.js","timestamp":"2020-12-12T21:38:46.737Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%userDataPath%%\\lightning-services\\mysql-5.7.28+4\\lib\\main.js","timestamp":"2020-12-12T21:38:46.873Z"}
{"thread":"main","class":"AddonLoaderService","message":"Add-on does not have package.json: %%userDataPath%%\\lightning-services\\php-5.6.39+6\\package.json","level":"info","timestamp":"2020-12-12T21:38:46.875Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%resourcesPath%%\\lightning-services\\mailhog-1.0.0+3\\lib\\main.js","timestamp":"2020-12-12T21:38:46.878Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%resourcesPath%%\\lightning-services\\mailhog-1.0.0+3\\lib\\main.js","timestamp":"2020-12-12T21:38:46.884Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%resourcesPath%%\\lightning-services\\mariadb-10.4.10+4\\lib\\main.js","timestamp":"2020-12-12T21:38:46.887Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%resourcesPath%%\\lightning-services\\mariadb-10.4.10+4\\lib\\main.js","timestamp":"2020-12-12T21:38:47.023Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%resourcesPath%%\\lightning-services\\mysql-8.0.16+5\\lib\\main.js","timestamp":"2020-12-12T21:38:47.025Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%resourcesPath%%\\lightning-services\\mysql-8.0.16+5\\lib\\main.js","timestamp":"2020-12-12T21:38:47.177Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%resourcesPath%%\\lightning-services\\nginx-1.16.0+4\\lib\\main.js","timestamp":"2020-12-12T21:38:47.181Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%resourcesPath%%\\lightning-services\\nginx-1.16.0+4\\lib\\main.js","timestamp":"2020-12-12T21:38:47.313Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%resourcesPath%%\\lightning-services\\php-7.3.5+10\\lib\\main.js","timestamp":"2020-12-12T21:38:47.315Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%resourcesPath%%\\lightning-services\\php-7.3.5+10\\lib\\main.js","timestamp":"2020-12-12T21:38:47.446Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Loading Add-on: %%appPath%%\\node_modules\\@getflywheel\\local-addon-broken-link-checker\\lib\\main.js","timestamp":"2020-12-12T21:38:47.448Z"}
{"thread":"main","class":"AddonLoaderService","level":"info","message":"Successfully Loaded Add-on: %%appPath%%\\node_modules\\@getflywheel\\local-addon-broken-link-checker\\lib\\main.js","timestamp":"2020-12-12T21:38:47.449Z"}
{"thread":"main","class":"AddonLoaderService","message":"Add-on does not have \"productName\" specified in package.json: %%appPath%%\\node_modules\\@getflywheel\\local-browsersync\\package.json","level":"info","timestamp":"2020-12-12T21:38:47.451Z"}
{"thread":"main","class":"AddonLoaderService","message":"Add-on does not have \"productName\" specified in package.json: %%appPath%%\\node_modules\\@getflywheel\\local-browsersync-client\\package.json","level":"info","timestamp":"2020-12-12T21:38:47.452Z"}
{"thread":"main","class":"AddonLoaderService","message":"Add-on does not have \"productName\" specified in package.json: %%appPath%%\\node_modules\\@getflywheel\\local-components\\package.json","level":"info","timestamp":"2020-12-12T21:38:47.452Z"}
{"thread":"main","class":"AddonLoaderService","message":"Add-on does not have \"productName\" specified in package.json: %%appPath%%\\node_modules\\@getflywheel\\localcert\\package.json","level":"info","timestamp":"2020-12-12T21:38:47.453Z"}
{"thread":"main","class":"AddonLoaderService","message":"Add-on does not have \"productName\" specified in package.json: %%appPath%%\\node_modules\\@getflywheel\\localtunnel\\package.json","level":"info","timestamp":"2020-12-12T21:38:47.453Z"}
{"thread":"main","class":"AddonLoaderService","message":"Add-on does not have \"productName\" specified in package.json: %%appPath%%\\node_modules\\@getflywheel\\memoize-one-ts\\package.json","level":"info","timestamp":"2020-12-12T21:38:47.454Z"}
{"thread":"main","class":"AddonLoaderService","message":"Add-on does not have \"main\" or \"renderer\" specified in package.json: %%appPath%%\\node_modules\\@getflywheel\\replacestream\\package.json","level":"info","timestamp":"2020-12-12T21:38:47.454Z"}
{"thread":"main","name":"DeprecationWarning","code":"DEP0005","level":"info","message":"Warning:Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.","stack":"DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.\n    at showFlaggedDeprecation (buffer.js:174:11)\n    at new Buffer (buffer.js:257:3)\n    at encoder (%%appPath%%\\node_modules\\superagent\\lib\\node\\index.js:499:12)\n    at RequestBase._auth (%%appPath%%\\node_modules\\superagent\\lib\\request-base.js:431:44)\n    at Request.auth (%%appPath%%\\node_modules\\superagent\\lib\\node\\index.js:502:15)\n    at Analytics.flush (%%appPath%%\\node_modules\\analytics-node\\lib\\index.js:152:6)\n    at listOnTimeout (internal/timers.js:531:17)\n    at processTimers (internal/timers.js:475:7)","timestamp":"2020-12-12T21:38:58.125Z"}
1 Like

Solution to getting the sites to show up again … downgraded to 5.9.0 and my sites appear

Upgraded to 5.9.3+5100 and it still works …

I’m having the same issue on 2 Windows machines. These are new installs. I can create sites and access them through a browser, but Local Sites does not populate. Windows 10 Pro on both machines.

Thank you for providing this info and taking the time to post here in the forums!

I’ve never seen Local in that sort of a state. Does this still happen with the latest (currently 5.9.6) version of Local?

From the screenshot, I can sort of imagine that Local is having trouble reading the sites.json file within it’s configuration directory.

Do you have any sort of antivirus software installed that might be preventing Local from reading files within the %AppData%\Local directory?

Shared with CloudApp

Also, is there anything that might be different from the defaults in terms of how Local was installed? For example, was Local installed to a different partition?

Only windows firewall. I disabled - same results.

I created a test site from the defaults and I see it in sites.json file.

Running version 5.9.7+5156

Ben,

As a test, I uninstalled and installed 5.9.3 and the sites are listed!

Uninstalled 5.9.3 and reinstalled 5.9.7, and the sites are gone again.

Installed 5.9.3 over 5.9.7 and the site list is back. Installed 5.9.7 over 5.9.3 and error fetching.

5.9.4 does not show the site list.

Russ

A post was split to a new topic: Unable to see my site

That’s really interesting and thanks for the screenshot – the file permissions look correct.

Can you please provide your Local Log? See this Community Forum post for instructions on how to do so:

local-lightning - Copy.zip (7.6 KB)

Let me know if this is not the correct file.

Russ

Thanks! This is the right log. I’m not seeing anything obviously broken here.

You mention that this is happening with two different machines – do each of those Local windows have the same error as what is in the original post? Specifically, I’m wondering if your machines are reporting the same error:

Error, could not load sites.
Failed to fetch

If you can, could you take a screenshot of the Local window for us to compare as well?

image

image

Thanks for those screenshots @grokwhy – I think I’ve zeroed in on recreation steps which should help with getting a fix created, though I don’t have an exact ETA for when that will be released.

I think there are two options:

  1. Downgrade to Local 5.9.3
  2. Find whatever is listening on port 4000 and stop that before launching Local

Since you are running Windows, you should be able to work through #2 by using these commands within a cmd prompt:

netstat -nao | find "4000"
taskkill /F /pid <whatever-process-id-is-found>

To help visualize, this screenshot has a fake “dev server” listening on port 4000. I’m able to use taskkill to kill it and get Local to work again:

Thanks, I’ll look into this.

Russ

Ben,

I determined the service running on port 4000 was the NoMachine app. After disabling the service and installing the latest 5.9.7 I now see the site list.

Thanks!
Russ

Nice!

The team’s still working on a fix so that you won’t have to find and kill a process that’s running on port 4000, but it’s coming along and should be released soon!

Good to know … I’m running NoMachine as well to contact a few Linux machines I have on site. I will try disabling it or see if I can have it run on a port other than 4000.

I can confirm.

Installing Local v5.9.3 on top of latest installation recovered my site list, with NoMachine working well. (it is linked in a comment above)

Installing Local v5.9.7 (latest at time of writing) on top of v5.9.3 gave this same error as the original post “Error, could not load sites. Failed to fetch.”

When I disable NoMachine, and restart Local v5.9.7, everything works again as normal.

I hope Local elects to use a different port for this service, as I use NoMachine extensively as a remote working tool.

Take care folks!