504 error but have unlimited execution time

Setup

WP2Static 7.2
WP2Static Add-on: Zip Deployment 1.0.1
PHP max_execution_time: Unlimited
PHP memory_limit: 1073741824 (1GB)
Uploads directory writable: Writable
PHP version: 8.0.25
cURL extension loaded: Yes
WordPress Permalinks Compatible: Yes

I also disable some of the detections:

add_filter( 'wp2static_detect_sitemaps', '__return_false' );
add_filter( 'wp2static_detect_posts_pagination', '__return_false' );
add_filter( 'wp2static_detect_archives', '__return_false' );
add_filter( 'wp2static_detect_categories', '__return_false' );
add_filter( 'wp2static_detect_category_pagination', '__return_false' );
add_filter( 'wp2static_detect_authors', '__return_false' );
add_filter( 'wp2static_detect_authors_pagination', '__return_false' );

and I exclude some urls via the ‘wp2static_modify_initial_crawl_list’ filter (pages I know generate 404) and a number of urls of image and pdf files that are failing (though I do not know why).

The error alert box message is:

504 error code returned from server.
Please check your server's error logs or try increasing your max_execution_time limit in PHP if this consistently fails after the same duration.
More information of the error may be logged in your browser's console.

with browser console:

Gateway Time-out admin.php:212:17
504 Gateway Time-out - The server didn't respond in time.

What’s a good way to debug this?
How can I find what url it was trying to get?

You should first check the logs of your HTTP server to check if there 504 response has been logged there. It should happen on a request to the /wp-admin/admin-ajax.php path.

In my case, I actually had only 200 on the HTTP server logs. The problem was I had a Load Balancer as intermediary, and it was the one setting a stricter timeout of 60s, and returning the 504 status code. After changing the timeout in the Load Balancer, I got this working.

1 Like