Local Community

Cannot get to another page. 502 error. Says check Local router logs

Issue Summary

Get a 502 error when trying to click to a different page on the website I am building. Says, check Local Router Logs. I don’t know how to do that.

Hey @spencer, 502 errors basically tell you that something was waiting for a response upstream. You might just have to wait a little longer for a site to turn on, or possibly, if the site has become corrupted, you can try restoring the site to a new one in Local by following the steps outlined in the “Restoring From Only Local Site files” section of this help doc:

To your specific question about where to find Local’s Router, click the “Help > Reveal Local Router’s Log” link in the menu.

Image 2021-09-30 at 10.36.59 AM

Hi, would you know where I would find the wordpress-import folder/

I dragged the wp-content folder into local, but it gives me an error, saying couldn’t figure out what to do with the import file provided. Please extract it manually.
Do I just right click on the folder, and click on Add to wp-content zip.
Also, where do I find the wp-import folder.

Take another look at the help doc – you’ll need to create a zip file that contains the wp-content folder along with a .sql file for the database. Usually you can copy the database file and the wp-content folder to a temporary location, select those two items, right-click on them, and select “Compress.”

Once you have that .zip file created, drag and drop the zip onto Local so that it can import it.

That folder is for the screenshot only. It was name of the site that I used when creating the help doc. You’ll want to work with whatever the sitename is for your site.

Issue Summary

Have a 502 error. Said, I must go to reveal error log. I found the log folder, and in it says, error file, and nginx.pid. What must I do now, do I report those errors in the error file to somebody for more help on what to do next.

I’ve consolidated the various topics into this one to help focus the communication.

You’ll want to open the error log and see what errors are showing. This will help you zero in on what’s wrong with the site.

I don’t quite understand the error showing. I am not sure, if I must still try extract and import the wp-content folder, or try fix the error first before I do that, as I got another error when I tried to import the wp-content folder, saying couldn’'t figure out what to do with the import file provided.
Hope its alright to post the error from the error log file here: I have got errors all the way dating back from 2021/06/05. So, I am wondering if that is why I could never get javascript to work either, after enqueueng that in a child theme.

2021/10/01 12:05:37 [warn] 5556#5180: *8921 a client request body is buffered to a temporary file C:\Users\spencer\AppData\Roaming\Local\run\router\nginx/temp/client_body_temp/0000000042, client: ::1, server: backyardleathercraftcom.local, request: “POST /wp-admin/admin-ajax.php HTTP/1.1”, host: “backyardleathercraftcom.local”, referrer: “http://backyardleathercraftcom.local/wp-admin/post.php?post=12&action=elementor
2021/10/01 12:28:56 [error] 5556#5180: *10982 connect() failed (10061: FormatMessage() error:(317)) while connecting to upstream, client: ::1, server: artandleatherspencer.local, request: “GET /contact/ HTTP/1.1”, upstream: “http://127.0.0.1:10004/contact/”, host: “artandleatherspencer.local”, referrer: “http://backyardleathercraftcom.local/
2021/10/01 12:28:57 [error] 5556#5180: *10982 connect() failed (10061: FormatMessage() error:(317)) while connecting to upstream, client: ::1, server: artandleatherspencer.local, request: “GET /favicon.ico HTTP/1.1”, upstream: “http://127.0.0.1:10004/favicon.ico”, host: “artandleatherspencer.local”, referrer: “http://artandleatherspencer.local/contact/
2021/10/01 14:48:31 [error] 5556#5180: *11939 connect() failed (10061: FormatMessage() error:(317)) while connecting to upstream, client: ::1, server: artandleatherspencer.local, request: “GET /contact/ HTTP/1.1”, upstream: “http://127.0.0.1:10004/contact/”, host: “artandleatherspencer.local”, referrer: “http://backyardleathercraftcom.local/
2021/10/01 14:48:32 [error] 5556#5180: *11939 connect() failed (10061: FormatMessage() error:(317)) while connecting to upstream, client: ::1, server: artandleatherspencer.local, request: “GET /favicon.ico HTTP/1.1”, upstream: “http://127.0.0.1:10004/favicon.ico”, host: “artandleatherspencer.local”, referrer: “http://artandleatherspencer.local/contact/

Hi Ben,
I managed to import the wp_content folder after zipping it, but for some reason, it will not let me import the sql folder, even though I right clicked first and clicked add to sql.zip. then tried to import. I also tried placing the sql zip into wp content zip folder, but then I got a message there saying: the specified directory c:\Users\spencer\Desktop\sql.zip is empty, so Compressed (zipped) folders cannot add it to the archive.
I found the sql folder next to the public folder.

You need to create a zip of the .sql and the wp-content. This is a single zip file not a zip within a zip.

Hi, it would not let me import the sql file, even after zipping it. Same error: sorry couldn’t figure out what to do with imported fie, please extract manually.
So, then I thought maybe the file is empty or something, but I think I messed things up now, because I then tried to open it with notepad to look, and then it was not responding, and then the file name automatically changed from sql to saying local. Would you know, what I should do now?

It would not let me import the zipped file, but I have another file on the screen saying sql.zip.tmp.
I am not sure if I must import that now. but, when I looked inside sql.zip.tmp file now, the code is totally different and unreadable, than what was in the sql file.

This is basically the Local router telling you that it didn’t know what to do with a request.

If I’m reading it correctly, here are some observations:

  • I think there’s a Local site with a domain of artandleatherspencer.local
  • That site is having issues reaching the /contact page
  • The “referrer” is a different domain: backyardleathercraftcom.local

I almost wonder if there’s a setting in the theme or a plugin that doesn’t have the correct domain name, and because of that, a contact form isn’t submitting correctly.

As afragen mentioned, you need to have only one zip that’s imported. From the description of what was done, it sounds like you tried importing two different zips - one of the wp-content folder, and one of the sql folder.

It sounds like the sql.zip file was renamed for some reason. You need to get that file back to it’s “raw” state. To do this:

  1. Close all applications that have sql.zip.tmp open.
  2. Rename sql.zip.tmp to sql.zip
  3. Unzip sql.zip so that you have a directory called sql
  4. Open the sql folder – do you see any files within that folder that end in .sql? There will likely be a file called local.sql

Importing the site into Local

Once you are back to a clean slate, with the wp-content folder and the sql folder unziped, Take steps to prepare one archive to be imported into Local.

To help clarify the things that need to be done to create that site zip, I’ve recorded this screencast to show the steps that need to happen:

Thanks for all that info. Regarding, the two domain names, I have two sites on local. Maybe I am not supposed to do that, not sure. I did find that I had problems, when I was on one site, then when I clicked to a different page, the page of the other site would come up. But, now I close the the whole application, and start it up again, before switching over or going to the other site, which seems to have resolved the problem of two sites conflicting with each other.

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