502 Bad Gateway (nginx/1.16.0) in all sites after update

Issue Summary

Hello! Today after updating local from 6.4.3 to 6.5.1 in MacOS Mojave (10.14.6), I couldn’t access to the Admin Dashboard in all the sites previously created (using 'nginx in all of them). I re-installed the latest release from website and still same issue.

Troubleshooting Questions

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

  • Are you able to create a new, plain WordPress site in Local and access it in a Browser? I’m able to create new sites but when I try to access to the Admin Dashboard I got the “502 Bad Gateway” error.

Replication

Describe the steps that others can take to replicate this issue. If you have screenshots that can help clarify what is happening, please include them!

System Details

  • Which version of Local is being used? 6.5.1.

  • What Operating System (OS) and OS version is being used? MacOS Mojave (10.14.6)

2 Likes

Hi @p.verdugo - this may be due to a recent issue in the new release that we are actively working on. If you’d like you can try the steps Austin lays out here to get things going: PHP v7.3.5 ONLY usable on Mac 10.13.6 (High Sierra) - #2 by austinwendt

2 Likes

Yes, already tried that but it didn’t work.
Now one of my sites don’t even open and I’m getting the following errors:



This is not acceptable as some plugins will not run on less than php8?
You have dropped the ball here and I cannot work on any clients sites!!!

I highly recommend to backup all the projects before deleting the ‘lightning-services’ folder and trying anything that could corrupt the sites.

I’ve lost a project but sh*t happens, so I solved the issue just uninstalling 6.5.1. and installing the 6.4.3. which is the current stable release aaaaand back to work.

2 Likes

Hi @bomakalu - Did you try the workaround and are getting the same errors as above now? Or are you dealing with the 502s still?

We should have a patch out soon, and apologize for the disruption in your workflow.

Hi @p.verdugo - I’m glad you were able to get things going in the meantime. Thank you for your patience and communication with us. We should have a patch out for the issue soon.

I got it working again by switching to PHP 8.0 in Local and then switching back to PHP 7.4.1

1 Like

@Nick-B

Im also encountering this, or a similar problem. Same OS, Local version 6.5.1+6195

I do have an older copy of ‘Local by Flywheel’ installed if that makes any difference at all.

Strangely, only a few pages on the admin throw, most notably the plugins admin pages, if there are any plugin files present at all, if the plugin directory is empty, you can load the plugin page, but ‘add new plugin’ throws. There are a few other pages that consistently throw 502, including:

The bare /wp-admin/ route, after the login screen…
http://localhost:10003/wp-admin/options-general.php
http://localhost:10003/wp-admin/import.php
http://localhost:10003/wp-admin/export.php
http://localhost:10003/wp-admin/site-health.php
http://localhost:10003/wp-admin/export-personal-data.php

Ive already tried rebooting, deleting the sites, and the contents of
~/Application Support/Local/lightning-services/

Any thoughts from the hive-mind would be greatly appreciated.

php-fpm.log (107.9 KB)
error.log (223 Bytes)
error.log (33.6 KB)

Im also have the same problem. All sites only work with php 7.3.5.
I delete the folder
~/Application Support/Local/lightning-services
with no luck.

Any news?

I’m having exactly the same issues as the original poster and cannot work on any sites unless I go back to PHP version 7.35.

I notice this thread started 22 days ago with many promises of a patch to fix this SOON. Please admin, what is your definition of SOON?

Local version 6.5.2+6204
Mac OS Mojave 10.14.6

Hi @royby (and @lolobomac if this applies to you) - there are two separate issues at play here, and I want to make sure I explain them appropriately.

  1. With the update to Local v6.5.1, we updated our PHP versions and recompiled them on the latest MacOS. This caused users to see a 502 error on their existing sites due to a configuration mismatch. Deleting the lightning-services directory was a temporary workaround, and the core issue has been patched and released in Local v6.5.2.

  2. Users on macOS Mojave or lower continued to see issues with Local sites on the latest build, v6.5.2. This is because the PHP versions compiled and released in the latest version are no longer compatible with these older versions of macOS. This is somewhat expected but was not found during QA as we don’t have the capacity to test on these older versions.

In order to keep Local secure and continue to prioritize new features, we are unable to continue supporting Local for operating systems that are no longer supported by their creators. After Local v6.5, we cannot ensure compatibility below macOS Catalina.

Unfortunately, Apple stopped active support for macOS Mojave in 2019 outside of minor security updates. We’d strongly encourage you to update to a newer version of macOS to ensure security on your machine and to maintain compatibility with modern applications and technologies.

Users who must remain on macOS Mojave or lower can install Local v6.4.3 from our releases page.

More for our team to continue learning - based on the data we have, a very small portion of the Local user base is still running on Mojave. Is there a reason you’re unable to update to a newer version?

1 Like

Yep, same exact OSX I’m using and I’m having the same issue.

Here are my router logs. It’s the same thing over and over and over.

2022/12/01 10:35:10 [emerg] 4484#0: bind() to [::]:80 failed (48: Address already in use)
2022/12/01 10:35:10 [emerg] 4484#0: bind() to 0.0.0.0:443 failed (48: Address already in use)
2022/12/01 10:35:10 [emerg] 4484#0: still could not bind()
2022/12/01 10:35:13 [emerg] 4487#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to [::]:80 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to 0.0.0.0:443 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to [::]:80 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to 0.0.0.0:443 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to [::]:80 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to 0.0.0.0:443 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to [::]:80 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to 0.0.0.0:443 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to [::]:80 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: bind() to 0.0.0.0:443 failed (48: Address already in use)
2022/12/01 10:35:13 [emerg] 4487#0: still could not bind()

I tried the same thing and it didn’t work either, and I’m using the same OSX as the original poser

I reverted to Local v6.4.3 and am still not able to use Local. I’m getting 404 Site not found on the webpage and am getting port conflict with the site’s domain in Local.

I don’t want to update past Mojave right now because I’m using a piece of software that won’t work beyond Mojave.

Hi @bensieg - Based on the logs it looks like there might be a port conflict occurring. Here are some steps to help you identify and address this:

  • Stop all sites that are running in Local

  • Force quit Local

  • Run the command lsof -nP -iTCP -sTCP:LISTEN

What you’ll be looking for here is to see when sites are stopped and Local is properly shut down if there are still programs running on ports 80 and 443. These may be conflicting with Local or the system may be reporting Local is still running.

Once you run that command you should see a list of listening ports. If you see a particular program making use of those ports, you can then kill that process by running sudo kill -9 XXX where XXX is the PID number of that process. (On Windows you will use taskkill /F /pid XXX where XXX is the PID number of that process)

After that, you should be able to retry. Keep us posted if you have any questions or continuing issues.

There are also some more details around this and other troubleshooting steps at this link if needed: Stopping Whatever Is Listening On Port 80.

1 Like

I’m still getting the following white screen with “502 Bad Gateway nginx/1.16.0”
I can’t get any of my sites to allow me to see the WP Admin. I can click to see the front page and the Admin is signed in but when I click to see the admin page from there it gives me the error above too. This is super frustrating. I’m newish with using Local and have always used Desktop Server but they are out of business now. Does this Local app have any consistency???

Port 80 and 443 are getting stopped. I can see they are with the terminal command you provided. Local is so inconsistent. Sometimes it will work where I can see the Admin area of the sites, and like today all I get is the bad gateway error above, and I can’t do any work on a site.

Yeh this sucks, I literally just spent a month setting up all my local websites again because my computers logic board blew up. A week later and now my local sits don’t work because Local broke them. Great…really great.

I am also getting EXACT same issue with MAC OS 10.13.6 - BAD GATEWAY on all Sites. This has happened before (Nov 3) when I raised a ticket. Deleting this folder:-

Mac: ~/Library/Application Support/Local/lightning-services helped then but now makes no difference at all.

If I change PHP to a later version than 7.3.5 - Wordpress does not load - even after a 10 minutes wait. Go back to 7.3.5 & all is good.

Please help!

Exact same problem… 502 Bad Gateway… back to MAMP!

Tried everything above… using both servers, various versions of PHP, etc. 502 after 502, occasionally get the actual login window… then the 502.

I’ve only managed to build one site here, two months ago… and even that is no longer accessible.

No more time… no more trust.