Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resetting a shadow causes HTTP 504 if the operation takes long #187

Closed
l3ku opened this issue Oct 29, 2018 · 3 comments
Closed

Resetting a shadow causes HTTP 504 if the operation takes long #187

l3ku opened this issue Oct 29, 2018 · 3 comments

Comments

@l3ku
Copy link
Contributor

l3ku commented Oct 29, 2018

While successful, running wp-shadow-reset via SSH on our site takes somewhat long:

wp-palvelu@wp-palvelu:~$ time wp-shadow-reset wp-palvelu_xxxxx
Warning: the database and all files in /data/wordpress in shadow wp-palvelu_xxxxx will be deleted and replaced with a clone from production. Are you sure you want to proceed? (y/n): y
Exporting production database...
Moving database from production to wp-palvelu_xxxxx...
Moving files from production to wp-palvelu_xxxxx...
Importing production database to wp-palvelu_xxxxx...
Success: the shadow wp-palvelu_xxxxx has been updated with production.

real	1m10.517s
user	0m0.908s
sys	0m0.400s

(Shadow ID has been removed)

Presumably the large size of the database or some other phenomenon causes the AJAX request that is made when resetting the exact same shadow via WP admin to timeout with HTTP 504, taken from chrome dev console response/request headers:

Request URL: https://wp-palvelu.fi/wp-admin/admin-ajax.php
Request Method: POST
Status Code: 504 
...
server: nginx
status: 504
type: POST
action: seravo_reset_shadow
resetshadow: wp-palvelu_xxxxx
...

There is also no indication to the user that the operation failed without opening the developer console, the button just remains disabled.

@ottok
Copy link
Contributor

ottok commented Oct 29, 2018

The process should output something once a minute to not time out.

Wiljami added a commit that referenced this issue Jul 29, 2020
The user is now informed when the ajax call times out.

Related #315, #187
@Wiljami Wiljami self-assigned this Jul 29, 2020
@Wiljami
Copy link
Member

Wiljami commented Jul 29, 2020

In 5c8d318 an error box is added so that user can see when the timeout happens.

Unfortunately I don't think there is any easy way to create output to avoid this timeout. The php times out after one minute in the ajax call when it's running its exec command. There is no output from the exec command itself until it has completed, so I don't know how to make the php extend the timeout period during it.

Wiljami added a commit that referenced this issue Aug 3, 2020
The user is now informed when the ajax call times out.

Related #315, #187
Wiljami added a commit that referenced this issue Aug 3, 2020
The user is now informed when the ajax call times out.

Related #315, #187
Wiljami added a commit that referenced this issue Aug 3, 2020
The user is now informed when the ajax call times out.

Related #315, #187
Wiljami added a commit that referenced this issue Aug 3, 2020
The user is now informed when the ajax call times out.

Related #315, #187
Wiljami added a commit that referenced this issue Aug 3, 2020
The user is now informed when the ajax call times out.

Related #315, #187
Wiljami added a commit that referenced this issue Aug 5, 2020
The user is now informed when the ajax call times out.

Related #315, #187
@Wiljami Wiljami removed their assignment Jan 18, 2021
@elguitar
Copy link
Contributor

Closing in favor of #465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants