When doing a (manual) backup with Snapshot, I keep getting this error: Gateway Timeout

"The gateway did not receive a timely response from the upstream server or application."

What to do? I want to make a backup just before the complete redesign of this site.

Thank you in advance for any help you can give.

Best regards,

Verdi.

  • Bojan Radonic

    Hey Verdi,

    How are you doing today?

    This error should be on the server side rather than coming directly from Snapshot. In general it means that after the server sent a request to remote gateway it didn't get a response fast enough.

    That said, I think you could try to adjust PHP settings to allow more time for connection. In case you can edit php.ini you can try changing the following (you can find more info about editing php.ini file here):

    default_socket_timeout = 600
    max_execution_time = 600

    If you can't do that on your own please try contacting your hosting provider asking them to increase default socket timeout and max execution time to see if that will help :slight_smile:

    Please let me know how that goes :slight_smile:

    Cheers,
    Bojan

  • Verdi

    Hi Bojan,

    Apologies for my late answer, something came up. Please view the chat with my host (SiteGround) below and you'll understand why I had to remove snapshot. I only message you this as feedback, hoping one day I might use snapshot as a failsafe (and way easier method of doing my backups than I'm forced to do now).

    === Support chat between me and SiteGround: ===

    Verdi Heinz: So I’m trying to use a plugin called Snapshot by WPMU Dev. But it gives this error: ""The gateway did not receive a timely response from the upstream server or application."

    Verdi Heinz: Naturally I asked the makers of the plugin first, and they said:
    Verdi Heinz: This error should be on the server side rather than coming directly from Snapshot. In general it means that after the server sent a request to remote gateway it didn't get a response fast enough. That said, I think you could try to adjust PHP settings to allow more time for connection. In case you can edit php.ini you can try changing the following (you can find more info about editing php.ini file here): default_socket_timeout = 600 max_execution_time = 600 If you can't do that on your own please try contacting your hosting provider asking them to increase default socket timeout and max execution time to see if that will help

    Verdi Heinz: Sorry, the line breaks seem to got lost in this chat

    Verdi Heinz: I tried making a php.ini file like they said, did not work. Hope you can help.

    Marin P.: Verdi, I will now explain. Hold on just a minute.

    Verdi Heinz: Take all the tome you need, I''ll come back when I hear the chime.

    Marin P.: Maximum execution time is the maximum time, allowed by the server, that your account is on to wait for the plugin to make connection with the server Itself. ?In other words - If the plugin does not respond in the maximum execution time (which on your server is 120 sec.), the server cuts the process, in order, the plugin to not use more resource, since It's inactive or It's taking too much time to work.

    Verdi Heinz: So the plugin is bad?

    Marin P.: Your server's maximum execution time is 120 seconds, the plugin you want to use requires 600.

    Verdi Heinz: So not bad, but just asks too much?

    Marin P.: Takes too much time to respond, which is not good for the server, because too much processes, taking too much time will cause too much resource consumption.

    Marin P.: That's why our System Administrators have put those limits.
    Verdi Heinz: An understandable measure to protect all users of that server, ok

    Marin P.: Yes, that is what I mean.

    Marin P.: And we cannot increase the max. execution time on account level, the limit is for the whole server.

    Verdi Heinz: I understand now. I'll relay this info to the maker.

    Marin P.: I apologise, but this is did, so you can get stable performance from the server.

    Verdi Heinz: No apologies necessary, I understand and respect the decision.

  • Bojan Radonic

    Hey Verdi,

    Thanks for your reply :slight_smile:

    First of all 600 seconds is not required by the plugin, we could even try with 300, backup is a big process and I just wanted to make sure if this is what's causing it that this change is going to fix it.

    Aside from that execution time is not something that is set per plugin, if you have a lot of plugins/complex theme on your site you'd require higher execution time as it would take more time for the script to get executed. Everything that goes through PHP interpreter has to fit into that time frame otherwise you get an error so it's not purely based on specific plugins, yes some plugins require more, others less. I hope that makes it more clear.

    If your hosting provider doesn't allow any changes for this then I can totally understand that you don't want to use it.

    Best regards,
    Bojan

  • Roseanne

    Hi,

    I'm also experiencing this problem on http://www.dyt24hourplays.com. I get the error

    The gateway did not receive a timely response from the upstream server or application.

    I am trying to restore a snapshot of a new version of the site developed on localhost using Upfront.
    I created php.ini to include

    upload_max_filesize = 2000M
    post_max_size = 3000M
    memory_limit = 4000M
    file_uploads = On
    default_socket_timeout = 600
    max_execution_time = 600

    but it doesn't help. I noticed it is getting stuck on wp_posts > wp_posts which it the same on localhost and live. (i.e. there have been no blog updates on localhost) Should I try running a snapshot with this table left out?
    I have given support access to the live site.
    I would LOVE to fix this in the next 24 hours if possible.

    Thanks in advance,
    Roseanne

  • Tyler Postle

    Hey Roseanne, the blog is no longer attached? I'm not sure what you mean by that, if you excluded the wp_posts table though then yes you wouldn't have any posts and also there wouldn't be anywhere to save new posts until you create the wp_posts table again in your database - that is likely the issue that is causing your blog not to be attached.

    I will mention that our Snapshot plugin wasn't designed to handle migrations, so that is why you are running into some issues changing the urls. We are working on adding proper migration logic though it's been made into a priority feature for Snapshot as we know a lot of members are wanting it.

    To replace the localhost url with the live url you can run a search and replace plugin such as this one: https://en-ca.wordpress.org/plugins/better-search-replace/

    I'd suggest re-importing it with the wp_posts table, I know you had an error when you tried that before but it's possible that your host might not allow changing those PHP setting values yourself, it looks like support access was revoked so if you would like us to check that then just re-grant support access :slight_smile:

    Cheers,
    Tyler

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.