Upgraded to 9.2 and get a 502 on all sites

What issue or error are you experiencing?

Was on 9.0 and all worked fine. Started having an issue with a push failing and Flywheel support suggested upgrading. Upgraded to 9.2 and started getting this on all sites:

The page you requested generated a server error and could not be processed.
If you continue to get this message after refreshing, try restarting the Local site.

If the error persists, check the Local Router Logs in Local by going to
Help » Reveal Local Router’s Logs.

I downgraded to 9.1 and the issue remained. Then I downgraded to 9.0 and the issue remains (even though yesterday 9.0 worked fine).

I don’t know if it’s related, but I have been having a horrible time with Local for awhile. When I try to upgrade through the app (clicking upgrade when the popup displays), it says it’s downloading, but it just hangs in that state. And for some reason when in this state my internet connection fails. No sites or anything will load. I stop the upgrade and my connection the internet works instantly works again.

Many times push/pulls fail unless I do super small partials. It seems very random as to when it will work or not work. When it fails, Local just hangs as if it’s still processing/downloading or whatever, and during this time ‘sometimes’ my internet connection fails until I cancel the process.

Super frustrating. Any assistance will be most appreciated!

I’m running Bitdefender - but it was running when Local worked too, so I assume that’s not the issue.


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version:
    Currently 9.0 but have tried 9.1 and 9.2.

  • Operating System (OS) and OS version:
    Mac Sequoia 15.2
    local-lightning.log (858.2 KB)


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Thanks for your post, @DavidG, and I’m sorry for your experience upgrading Local recently.

For the issue you see with a 502 on all sites, the output below from your logs suggests something else may be running on port 80, which is the same port Local uses for its nginx router.

"nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)"

If you’re running any other servers, you could try stopping them, then restarting Local.

If you’re not running other servers that you know of, you could double-check if anything else is running on port 80 using this in your terminal:

sudo lsof -i :80

It will show you the “command” (application) and “PID” (process identifier) of any running services and could help you see what applications are using the same port that Local needs.

If the output is empty, it suggests something else may be blocking nginx from binding to port 80, such as Bitdefender. Local upgraded its version of nginx between 9.0 and 9.2 (in Local 9.1), so you may need to add the new nginx binary to an allow list to let it run if Bitdefender is blocking it.

When I try to upgrade through the app (clicking upgrade when the popup displays), it says it’s downloading, but it just hangs in that state.

This could also be indicative of Local being blocked by security software such as Bitdefender. (Your logs show lines that suggest traffic is being blocked for some URLs, such as “Client network socket disconnected before secure TLS connection was established”.)

I’m not familiar with Bitdefender, but I recommend reviewing any logs and whitelists it offers to ensure that Local is able to spawn processes (such as nginx/MySQL) and connect to the URLs it needs to run and self-update. We have a list of required URLs here.

If, after following all of the above and adjusting Bitdefender rules you still see “the page you requested generated a server error”, please could you share a fresh copy of your local-lightning.log immediately after seeing that error (Help → Reveal Local’s log), as well as a copy of your router log? (Help → Reveal Local router’s logs.)

The only time I see any response to port 80 being used is when Local is open. I get this:

image

I reset all my local and modem DHCP DNS to Cloudfare’s 1.1.1.2/1.0.0.2 just in case that mattered.

Bitdefender has no firewall for mac but I do have my mac firewall on. Local is whitelisted:

image

I also tried turning Bitdefender off.

After doing the above I was able to run the auto update for Local. I’m guessing changing my DHCP DNS helped here. But even with Bitdefender off I’m still getting the 502 when trying to open a site.

I’ve attached the logs you requested. Any ideas what I should try next?

local-lightning.log (920.3 KB)
error.log (5.0 MB)

Thanks for the info and logs, @DavidG. These lines from your nginx logs point to a possible add-on issue:

upstream prematurely closed connection while reading response header from upstream, client: ::1, server: [redacted].local, request: "GET /browser-sync/socket.io/?EIO=3&transport=polling&t=P2V7hqB&sid=qNh83Y1Q4333Rj57AAAc HTTP/2.0", upstream: "http://127.0.0.1:3003/browser-sync/socket.io/?

upstream sent "Content-Length" and "Transfer-Encoding" headers at the same time while reading response header from upstream

Are you using Local’s Instant Reload add-on? If so, please could you check it’s the latest version (1.1.4)? We fixed an issue in 1.1.4 that could result in 502 responses accompanied by those errors in nginx logs. (Note that the current version is displayed on the “installed” tab, not the “library” tab: Instant Reload 502 error - #34 by nickc )

If you’re using a lower version than 1.1.4 and don’t see an update notice, you could try removing the add-on and re-installing it. (You could also try disabling it if you no longer need it.)

I reset all my local and modem DHCP DNS to Cloudfare’s 1.1.1.2/1.0.0.2…

I also tried turning Bitdefender off.

After doing the above I was able to run the auto update for Local. I’m guessing changing my DHCP DNS helped here.

That’s good to hear! It sounds like either Bitdefender or your DNS configuration were blocking Local’s update server.