Local 6.5.1 give 502 in both site domain and localhost

Just installed the Apple Silicon Local v6.5.1 and I’m getting a 502 error this is using both site domain and localhost. BTW, this works fine in the Local Beta v6.5.1

Neither the Local or Local Beta v6.5.1 can access the site shell. I get the following error.

local-lightning-verbose.log.zip (81.5 KB)

This needs to get fixed ASAP.

Hi @afragen!

This works fine in the Local Beta v6.5.1 but also Neither the Local or Local Beta v6.5.1 can access the site shell? Those seem conflicting.

This sounds like the same MacOS Ventura thread we were working with @emmtre in, if you remember that one.

Edit - this is the one, where he says this fixed his issue - macOS 13 Ventura and Open Site Shell - #13 by emmtre

Except that I am on Ventura and could access the site shell in v6.4.3

I think I understand now.

2 separate issues -

  • 502 errors on the site. You didn’t see this on the Local Beta build.
  • Site shell - you did see this on both Beta and stable.

Digging in on this now.

yes, 2 distinct issues.

BTW, disabling system integrity checks is not a viable solution.

Agreed, +1 to that.

My hunch is this is the issue is in the difference between v6.4.3 (which was Intel) and v6.5.1 (now Silicon). I think it is Silicon-specific.

Not sure if you tried this, just eliminating things as I’m troubleshooting - do these same errors happen if you’re on v.6.5.1 Intel?

@afragen and @austinwendt

Welcome to the club with Ventura problems! :sweat_smile: I have tried to dig into the site shell issue but without any success. There is a new extended attribute in macOS Ventura called com.apple.provenance but the info is limited. Looks like all apps installed on macOS Ventura gets this. If it’s a part of the Gatekeeper system or some other security measure. Anyway, I tried to delete the attribute from Local app and lightning-services folder but it didn’t help. I had a similar issue with another app in the past where the solution was to delete the com.apple.quarantine attribute because of some component in that app wasn’t signed correctly. This is the command I used but it didn’t help with any of my issues with the site shell and repeating dialog about the network connection. To be continued… :nerd_face:

sudo xattr -d -rs com.apple.quarantine /Applications/Local.app
sudo xattr -d -rs com.apple.provenance /Applications/Local.app
sudo xattr -d -rs com.apple.provenance ~/Library/Application\ Support/Local/lightning-services

Be extra careful with sudo commands!

@austinwendt Yes, I can confirm the problem on Macs with Intel processors as well. And also with Local app 6.4.3 and 6.5.1 for me.

More info.

Local 6.5.1 Apple Silicon doesn’t give 502 errors when PHP is 8.0 or 8.0.22. Deleting 8.0.22 and allowing to re-downloading seems to work but naturally I did a few other drastic things and needed to re-import a site.

For clarification it was lightning-services in the Application Support folder. This allows a switch from darwin to darwin-arm64 for the PHP versions. I believe it was these previously installed Intel PHP versions that was/is the issue.

It may be safer to create a new site and use that as an opportunity to download the new PHP version.

Yeah, you might be right since Local re-downloaded new PHP versions the same day right after I had updated to macOS 13.0 Ventura.

ls -ale@ ~/Library/Application\ Support/Local/lightning-services
total 0
drwxr-xr-x   7 emmtre  staff   224 Oct 26 21:26 .
drwx------  39 emmtre  staff  1248 Nov  2 17:54 ..
drwxr-xr-x   7 emmtre  staff   224 Sep 17 23:17 apache-2.4.43+7
drwxr-xr-x   7 emmtre  staff   224 Sep 17 23:17 mysql-5.7.28+4
drwxr-xr-x@  7 emmtre  staff   224 Oct 26 21:26 php-7.4.30+3
	com.apple.provenance	   11 
drwxr-xr-x@  7 emmtre  staff   224 Oct 26 21:10 php-8.0.22+4
	com.apple.provenance	   11 
drwxr-xr-x@  7 emmtre  staff   224 Oct 26 21:07 php-8.1.9+6
	com.apple.provenance	   11

I think the complete solution is to delete all the pre-existing PHP resources from the ~/Application Support/Local/lightning-services/php* and let Local re-download them as needed.

➜  AJF-M1-MBA arm64: ~ ls -ale@ ~/Library/Application\ Support/Local/lightning-services
total 16
drwxr-xr-x   7 afragen  staff   224 Nov  2 12:08 .
drwx------  51 afragen  staff  1632 Nov  2 12:10 ..
-rw-r--r--@  1 afragen  staff  6148 Nov  2 12:07 .DS_Store
	com.apple.FinderInfo	  32 
drwxr-xr-x   7 afragen  staff   224 Apr 25  2021 apache-2.4.43+6
drwxr-xr-x@  7 afragen  staff   224 Nov  2 12:08 php-7.3.5+12
	com.apple.provenance	  11 
drwxr-xr-x@  7 afragen  staff   224 Nov  2 11:19 php-7.4.30+3
	com.apple.provenance	  11 
drwxr-xr-x@  7 afragen  staff   224 Nov  2 11:25 php-8.0.22+4
	com.apple.provenance	  11

This is good to know that it worked, but Local should have done that for you - which is why I was confused originally. Good to know that it didn’t, that gives me a place to start.

Deleting those Intel services and redownloading the Silicon PHPs resolved the 502s for you?

Yes, 502s all resolved.

I think the issue with Open Site Shell is that the OS considers the shell script to be an app that may require Full Disk Access or some additional access. If there’s a way to for the Terminal to open the script I think the issue may resolve as Terminal has those privileges.

Dropping the appropriate shell script from ~/Application Support/Local/ssh-entry onto the Terminal app results in the correct response.

I have tried that several times without success. Maybe for the 502 issue but not for the dialog to accept incoming network connections.

@emmtre I updated my response above

Shouldn’t the path in the script now be to the built-in PHP 8.1.9 version? I tried to change the script and lock the file but then Open Shell in Local app didn’t work at all. The script in the ssh-entry folder is checked and re-written every time.

# export PATH="/Users/emmtre/Library/Application Support/Local/lightning-services/php-8.1.9+6/bin/darwin/bin:$PATH"
export PATH="/Applications/Local.app/Contents/Resources/extraResources/lightning-services/php-8.1.9+6/bin/darwin/bin/php:$PATH"

Also odd as I set all .sh files to open in Terminal.app. Double-clicking the .sh file opens the site shell but using the menu in Local does not.

The path referenced for PHP 8.1.9 is for darwin not darwin-arm. Not sure it that’s an issue.