502 Bad Gateway nginx/1.16.0 MacOS 14.3

Bug Summary

Unable to open any sites using a specific theme. Had no issues two days ago but now all sites using that theme report a ‘502 Bad Gateway - nginx/1.16.0’ error. I’ve done several reboots, dumped Local and reinstalled, and tried to install site via .Zip. Only occurs on work machine, site works no problem on personal computer.

Steps to reproduce

Pull site using specific theme and try to view.

Environment Info

WP-CLI: WP-CLI 2.9.0
Composer: 2.6.2 2023-09-03
PHP: 8.2.10
MySQL: mysql Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL)

Describe your environment.

  • What Operating System are you using?
    MacOS 14.3 (Sonoma)
  • What version of Local is installed?
    Version 8.2.0+6554

Supporting info

Please provide your Local Log. See this Community Forum post for instructions on how to do so:

error.log (5.5 KB)
local-lightning.log (6.1 KB)
local-lightning-verbose.log (39.6 KB)

Hi @mbdev_aldous

To clarify is your personal machine on MacOS 14.3 and your work machine on MacOS 10.14?

That’s a good catch. The print out of what the env is copied directly from the Local Site Shell.

Work Machine: MacOS 14.3
Personal: MacOS 14.1.2

Nether machine is running MacOS 10.14, but it looks like Local installed MySQL for 10.14. How do I get that updated?

Do you want to try an uninstall and reinstall? The steps would look like this:

  • Export any sites that you have on Local and save them to a folder somewhere on your computer.

  • Fully uninstall Local from your computer.

  • Install the latest version of Local on this link.

  • Once installed, please restart the computer.

  • When the computer is restarted and turned on, close any applications that automatically run in the background (AntiVirus, Firewall, and other Developer applications included).

  • Check and see if the issue still persists. If so, please provide us with an updated log. Retrieving Local’s Log File

The logs given are after the third attempt of a complete uninstall and reinstall. I put the latest, then the last, and latest again.

Each time I scrubbed all sites and the Library/Application Support/Local folder

Did a 4th time and applied the latest version of Local. Attached is the shot of my comp info and the selected Local Download.

One difference between work and personal machines is that my work is apple silicon, and my personal is intel.

Shell output:
Setting Local environment variables…

WP-CLI: WP-CLI 2.9.0
Composer: 2.6.2 2023-09-03
PHP: 8.1.23
MySQL: mysql Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL)

Also below is the Lightning Logs:

local-lightning.log (2.1 KB)

Ah good call out. You likely need Rosetta installed on your work machine. Rosetta 2 is required for Local’s Apple Silicon build due to the Nginx and MySQL Lighting Services compiled on the Intel architecture. We do plan to have a Local release out in the future that will drop this dependency but for now it is necessary.

You can install Rosetta by opening up a terminal window and using this command:

softwareupdate --install-rosetta

Others have found this doc to be helpful:

Some good news! Got things working again. I installed Rosetta 2 and at first it had no effect.

Next I went through all the NGINX and MySPL processes in the terminal and killed all active process.

  • sudo lsof -PiTCP -sTCP:LISTEN
  • kill -9 [PID]

I also switched php version to 7.4.3

No positive effect.

I had installed the Apple chip focused version of Local:

Local 8.2.1 for Apple Silicon MacOS
(https://cdn.localwp.com/releases-stable/8.2.1+6583/local-8.2.1-mac-arm64.dmg)
SHA1: 4504ee535a2d7237aa5a7edbc1f7d81118847e47

I decided to completely remove that version and all installed sites.

I then rebooted, and installed the Intel MacOS version of Local:

Local 8.2.1 for macOS
(https://cdn.localwp.com/releases-stable/8.2.1+6583/local-8.2.1-mac.dmg)
SHA1: f38eb9d77983bde8fb4d085ebc94b0dced87132a

Rebooted and connected back to WP Engine and pulled a site.

At first this had no effect while running PHP 8.1. But when I switched to PHP 7.4 the 502 error resolved and the 502 error went away!

This makes me think that there is something in that Apple Silicon Local version that caused a hangup.

1 Like

Thank you for the update! I’m glad you were able to get things going. So far we haven’t seen any other widespread issues with the Apple Silicon version as long as users install Rosetta 2 but we will keep watch. Our team is hard at work at getting a native release out soon that will remove that dependency.