Listen ... http2" directive is deprecated

What issue or error are you experiencing?

2024/11/26 21:04:24 [warn] 48352#61264: the "listen ... http2" directive is deprecated, use the "http2" directive instead in AppData/Roaming/Local/run/router/nginx/conf/server-block-ssl.conf:2


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

I believe the latest version of Local has upgraded NGINX to version nginx-1.26.1+3 this is causing an issue with the router.

The fix to put in place is to adjust these two lines in the NGINX conf:

listen 443 ssl http2;
listen [::]:443 ssl http2;

To this:

listen 443 ssl;
http2 on;

listen [::]:443 ssl;
http2 on;

(The only place I could find these was in this file: server-block-sll.conf in the AppData/Roaming/Local/run/router/nginx/conf/ dir, as the error suggests above!)

The only problem is, if we modify the file, as soon as we run any site in Local, it regenerates the file and overwrites the changes. I had a quick mooch about to see if there was a default template anywhere that could maybe be edited to overwrite these values for a persistent change, but I didnā€™t have much joy.

I have also tried changing router mode and creating a new WordPress website; all have the same issue. It worked fine before I updated Local!

Possibly related to this post, I couldnā€™t comment there as it is closed - Nginx configuration is deprecated - #4 by Nick-B


System Details

  • Local Version: Version 9.1.1+6738

  • Operating System (OS) and OS version:

OS Name Microsoft Windows 11 Pro
Version 10.0.22631 Build 22631


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Localā€™s Log)

error.log (236.1 KB)

local-lightning.log (664.3 KB)


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.

Whoops, I didnā€™t mean to delete that!

I just wanted to say I have just downloaded the previous version from before the NGINX upgrade:

And installed it. I just started and opened the same site in Local, and it fired up the first time without issue:

Hopefully, this can help the developers narrow it down to the latest 2 builds. For now, I will stick with this version until a fix is implemented, and hopefully, this will help other people experiencing the same issue.

@paulbart, you may find this useful, as your post (linked above) experienced a similar, if not the same, issue.

Kind regards,
Gunner

Hi Gunner

I uninstalled and reinstalled latest version. I also changed the default browser from Edge to Chrome. Problem solved. Not sure why

2 Likes

Hi @paulbart,

I am glad this worked for you, I tried it, but unfortunately, I still get the same issue. So, for now, I will have to stick to the reverted version.

Kind regards,
David

Hi @davidgunnerjnr

Those http2 messages in the logs are a bit of a false positive we are trying to clean up so I donā€™t think thatā€™s related to your issue. We arenā€™t able to replicate the 502 problem in the latest release, for us and most users so far it seems to be working just fine but weā€™re still happy to help dig in here.

Looking through your logs Iā€™m seeing errors like this which seem to indicate maybe too many MySQL processes running at the same time, which could have been contributing:

{"level":"error","message":"Database did NOT respond to ping after 15 tries.","service":{},"serviceBinVersion":{},"stack":"Error: Command failed: %%userDataPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqladmin.exe ping\n\u0007mysqladmin: connect to server at '::1' failed\r\nerror: 'Can't connect to MySQL server on '::1' (10061)'\r\nCheck that mysqld is running on ::1 and that the port is 10054.\r\nYou can check this by doing 'telnet ::1 10054'\r\n\n    at ChildProcess.exithandler (node:child_process:422:12)\n    at ChildProcess.emit (node:events:517:28)\n    at ChildProcess.emit (node:domain:489:12)\n    at maybeClose (node:internal/child_process:1098:16)\n    at ChildProcess._handle.onexit (node:internal/child_process:303:5)","thread":"main","timestamp":"2024-11-26T20:49:16.659Z"}

If you update your Local application, and then quit and do a full reboot, Iā€™d be interested to see if you still have the same problem.

On Windows as well you can check for duplicate processes in your Task Manager:

1 Like

Hi @Nick-B,

Thanks for your response. I followed your steps:

  1. Installed the latest update. (I did not run it after installation; I closed the installer)
  2. Restarted PC
  3. Opened Local, Click ā€˜Start Siteā€™; here is what I got:

(the same 502 error, I have also added in the Task Manager)

Here are the updated logs:

error.log (306.8 KB)
local-lightning.log (687.4 KB)

Kind regards,
David

Hi @davidgunnerjnr - If you create a new, blank site in Local and try to access that do you get an error message? Or is it just with a specific site or sites you were already working on?

Hey @Nick-B,

At first, I thought maybe because plugins and WordPress were slightly outdated, that maybe it didnā€™t want to run because of that, so I used the site shell to trigger the WordPress Core update and renamed the plugins folder to plugins_old to temporarily disable them (I also tried this with the custom theme so it would revert to one of the Twenties), this made no difference whatsoever.

Well, actually, it did make a slight difference, as after doing the updates, I was then receiving the same 502 issues in the 9.0.5 version of Local.

But, being as good as I am, I had created a zip of it before I made any changes, so I simply deleted the folder containing the updates and reverted; this allowed me to run it in 9.0.5 of Local again but still get the 502 in the latest version.

By this point, I was ready to throw my PC out of the window. Anyway, then I had to go to work, so I had to leave it for a while. But I was thinking of so many different things throughout the day to try once I had finished work.

Anyway, to cut a long story short, after trying numerous things and nothing working at all, I took your advice and decided to create a new site in the latest version of Local (for a second time, as you will see in my original message, I did in fact already try this once, but got the same 502 error).

Here is the snippet from what I wrote in my initial post:

But, after creating it, it did allow me to run the new site successfully this time, without any issue (I have no clue why it worked this time, it just did).

I then decided that because this worked and my old site didnā€™t, there had to be some reason, so I started comparing the settings in Local between the old site and new site, and the only difference I could see was that I had enabled the Live Reload.

I thought this was not likely to be the cause of the issue, but I decided to disable it anyway, as by this point, I had nothing to lose. Oddly, after doing this, at first, it didnā€™t make any difference whatsoever, but I thought I would again repeat the steps above:

  • Remove Local
  • Reinstall the latest version
  • Then try to run it again

First, I tried the Test site, and this still worked as expected; then, I started the old site expecting to be greeted with the same old 502 error again, but this time, it just fired up, and I was able to access it!

So I just took this opportunity to update each plugin 1 by 1, and then the WordPress core to 6.7.1 from 6.6.2. And touch wood; it still seems to be running without issue.

I canā€™t say for certain if disabling the ā€˜Live Reloadā€™ was the cause of the issue, and I donā€™t want to re-enable it to find out after all of this palaver :rofl:

But in any case, I thought I would give an update. I will mark your last reply as the answer, as it did lead to me getting it to work.

Thanks for your help!

Kind regards,
Gunner

1 Like

I probably should have caught this earlier because we did recently have a bug where Instant Reload was causing 502 errors. This was resolved in the latest release, but you also have to make sure that Instant Reload is separately updated to itā€™s latest version in the addons library as well.

2 Likes

@Nick-B,

That is the issue; that is definitely what is causing it; I just re-enabled instant reload to check and BAM, back to the 502.

So, as a test, I followed the post above, uninstalled the add-on and reinstalled it to version 1.1.4. it now resolves the 502, and the site is functional again with it enabled.

Thanks again for all of your help. I am glad we can say for definite that was the cause. Hopefully, it will help other people who come across the issue.

I will amend the mark as a solution (if I can) to your last reply, as we can say for sure that is the fix.

Kind regards,
Gunner

2 Likes

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.

Thank you for the updates here @davidgunnerjnr! Glad things are sorted now. Happy Developing :green_heart: