Error 502 - Only one usage of each socket address is normally permitted

Hello,
I started to get the following error the past few days:

[alert] 17144#1656: *509 connect() failed (10048: Only one usage of each socket address (protocol/network address/port) is normally permitted) while connecting to upstream - on my Local sites.

It’s not on every page load, more like 2-3 out of 5 page loads - both in the front end, and in the admin area. If I refresh a page where it happens, it may or may not load properly, sometimes it does, sometimes it throws an 502 Request error again. It seems quite random.

OS is Windows 10 Professional.

Any ideas about what could be causing this?

Hi @daiquiri Do you have any antivirus, security, or firewall applications that could be blocking Local?

More details about troubleshooting this here: Router Mode

Hey Nick,
There’s nothing I haven’t had or I that I changed recently, and Local has been working fine for years without this issue…

Hi @daiquiri - I understand, I’m only trying to help you troubleshoot. Conflicts like this on Windows are actually quite common which is why I linked the above document. If you’d like you share a copy of your Local Log we can dig deeper? Retrieving Local’s Log File

Thank you Nick, I understand, all I’m saying is it’s unlikely that from one day to another my built in windows firewall or windows anti-malware is starting to block local… Also, if it was blocked, then I believe it would be permanently blocked, whereas right now it works on one page load then crashes on the next, totally randomly… (For what it’s worth, I have tried deleting and reinstalling some sites, tried switching server to Apache from nginx, tried changing php versions, updating WP to latest… Same deal.)

I attached the log file as well as the router log
local-lightning.log (286.6 KB)

error.log (8.0 MB)

Thanks again!

Hi @daiquiri - What Local version on you running? Did you update recently? I wonder if that triggered something on your Windows machine. The logs are chocked full of port conflict or security type errors we would attribute to something blocking Local from making connections. I know you mentioned not making any changes on your end, but it’s still curious.

If you change your Router Mode to localhost do you still run into errors while working?

I’m running the latest version but tried downgrading to a 6-7 month old version a few hours ago, did not solve the problem.
I tried router mode but that makes things even worse, hardly anything loads in that case.
What should I be looking into on Windows? I’m using the built-in firewall and built-in antivirus - I tried turning off the firewall completely to see if it changes anything, but it does not.

Hi @daiquiri - We’ve been tracking a potential issue with the latest release however it has so far seemed unique to macOS Ventura. One potential workaround has been to remove the PHP services from ~/Application Support/Local/lightning-services. Then, create a new site and use that to download the new PHP versions.

If you’re willing to give that a try let us know!

Issue Summary

Local doesn’t install new pages. I have old one that works fine, but the new ones are having issues. After new page appears in Local and i Go to WPadmin page - I ger 502 bad getaway error

Troubleshooting Questions

I’m not able to create new site. I don’t know where the problem is or how to resolve it.

Replication

Local error
image

System Details

  • Which version of Local is being used?
    6.5.1+6195

  • What Operating System (OS) and OS version is being used?
    Windows 10 pro

  • Attach the Local Log. See this Help Doc for instructions on how to do so:

local-logs.zip (7.9 KB)

Hi @Ivana! This might be due to an issue with the recent release. If you roll back to 6.4.3 manually do you have the same problems?

Local opens but when I want to open a site he keeps loading

after a long time he gives than a 502 error
I have uninstalled local and reinstalled but it stays the same
What can I do ?

  • Which version of Local is being used? the latest version

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

    • _For example: Windows xp

Hello @caroline - welcome to the Local Community! :wave:

Is this happening on all of your Local sites or just one in particular?

Are you able to create a new, clean Local site and open it normally?

Thank you! Let’s start there.

Sam :woman_technologist:t3:

Hi all! I merged a couple of threads that seemed related. Let’s use this thread for any issues that look like this:

  • On Windows
  • On Local v6.5.1
  • Sites producing 502 errors

Myself and the engineering team have been trying to reproduce this on our own Windows machines, but we haven’t run into it (yet).

If you’re experiencing this and could answer these questions, that will help us track down a potential cause! @caroline @Ivana @daiquiri

  1. Is this happening only on existing sites? Does it happen on new sites you create as well?
  2. For the sites that are having issues, can you tell me which PHP version and web server (Apache vs nginix) the site is using?
  3. Are any of these sites Headless WordPress sites (using the Atlas add-on in Local)?
1 Like

Dear Sam,

I 've tryed to ad a new site but it keeps adding but nothing happens. If I want to close a site it keeps stopping. It’s for all sites like that.

Kind regards
Caroline

Verzonden via Yahoo Mail op Android

Hi @caroline -

Thank you for that detail - do you mind answering the questions that @austinwendt has asked above?

It appears that some users have been experiencing similar issues and this could help us track it down or reproduce:

  1. Is this happening only on existing sites? Does it happen on new sites you create as well?
  2. For the sites that are having issues, can you tell me which PHP version and web server (Apache vs nginix) the site is using?
  3. Are any of these sites Headless WordPress sites (using the Atlas add-on in Local)?

Thank you!

Sam

Issue Summary

Only in wp-admin this is happening, it was working fine and after update wp-admin crashed. I used an downgrade version of local and still the same

Troubleshooting Questions

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

  • Are you able to create a new, plain WordPress site in Local and access it in a Browser? YES and its ok

Hi @mhornet13 A 502 could be a resource or timeout issue. You might start by checking through our guide here: Troubleshooting Performance issues in Local - Local

If you’re still having trouble let us know and share a copy of your Local Log. Retrieving Local’s Log File

NGINX error.log (11.3 KB)
PHP error.log (457.3 KB)

Hi @mhornet13! A fatal error I’m seeing in the PHP log is memory exhaustion. In that performance document I linked above, towards the bottom, there are instructions for increasing the memory for your Local site which may help.

Hey @Ivana – it looks like from the error message that was posted, Local’s version of PHP is expecting a more recent version of “Microsoft Visual C++ Redistributable for Visual Studio”

Can you try manually downloading and installing that from the Other Tools and Frameworks section of Microsoft’s downloads page?

Once that’s installed, try creating a new site and let us know how it goes!