Forums

"504 Gateway Timeout

cyberspyder 15 Mar, 2019
Joomla 3.9.4 and CF6 6.0.26 hosted at Liquid Web CloudSites
We used to get the timeout when trying to view a form after it was created, but you could keep reloading the page over and over and eventually the form would open for editing. Then it got really quick at opening on Joomla 3.9.3 and ChronoForms6 a version or two ago. Now, since the new Joomla and the new 6.0.26 CF6 version, we cannot ever open a previously created form. We continually get the 504 error. We tried for over an hour yesterday to open a form and cannot. We've checked with the hosting company and all variables available in the .htaccess file are at their max levels.

This is getting to be a rather large issue as we need to edit forms occasionally and we're paying for software that doesn't work. We need a solution or a workaround quickly.

UPDATE: We've confirmed that this is happens on sme sites but not others hosted at the same location. At this time, we cannot find any differences in the various sites. Also, some forms, of equal length and complexity, open and some don't on the same site.
GreyHead 16 Mar, 2019
Hi cyberspyder,

This isn't a problem that I remember seeing here before. It is almost certainly something on your server/hosting setup. ChronoForms admin forms can be very big and hit limits set in your PHP configuration. However the 504 error suggests that the server is trying to access some other server that is not responding - see here for some suggestions.

Bob
cyberspyder 19 Mar, 2019
Bob - Thanks for your reply. Although, it doesn't explain too much that we didn't already know. We've been in the web design business for 18+ years.
Our .htaccess file is set with the max variables, as you can see below. Our sites are hosted with LiquidWeb CloudSites, which we never have issues from. However, we have had issues with ChronoForms6 - mainly this timing out issue when trying to open a form to edit. As previously stated, it was like this before, but we could keep retying/reloading/refreshing the page and eventually, the form would open for editing. Then, after this latest Joomla update and the latest CF6 update, we cannot get certain forms to load for editing -although some on some sites and even some on the same site will open.
Take a look at this .htaccess and see if you can see anything is obviously wrong and if you'd suggest changing anything. The max variables were provided to us by LiquidWeb and is what we use on all our Joomla sites. (Note - this is not from the site in question. It's from another site , but has the exact same variables, etc.)

##
# @package Joomla
# @copyright Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved.
# @license GNU General Public License version 2 or later; see LICENSE.txt
##

php_value memory_limit 512M
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_vars 259200
php_value suhosin.get.max_vars 259200
php_value suhosin.post.max_vars 259200
php_value suhosin.request.max_vars 259200
php_value max_input_time 259200


##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line 'Options +FollowSymLinks' may cause problems with some server configurations.
# It is required for the use of mod_rewrite, but it may have already been set by your
# server administrator in a way that disallows changing it in this .htaccess file.
# If using it causes your site to produce an error, comment it out (add # to the
# beginning of the line), reload your site in your browser and test your sef urls. If
# they work, then it has been set by your server administrator and you do not need to
# set it here.
##

## No directory listings
IndexIgnore *

## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes

## Mod_rewrite in use.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^celebratepartyrentals.com [NC]
RewriteRule ^(.*)$ http://www.celebratepartyrentals.com/$1 [L,R=301]RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site then comment out the operations listed
# below by adding a # to the beginning of the line.
# This attempts to block the most common type of exploit `attempts` on Joomla!
#
# Block any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root home page
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

##
# Uncomment the following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.

<IfModule mod_expires.c>
ExpiresActive On

# Images
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"

# Video
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/mpeg "access plus 1 year"

# CSS, JavaScript
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"

# Others
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
</IfModule>

<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml

# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>
indiana71 07 Oct, 2019
Answer
1 Likes
Hi, I had the same problem:

504 Gateway Timeout with large Form.


The gateway did not receive a timely response from the upstream server or application.
Server Capacity: 10000

I asked to Sitegroud to update the following vars

max_input_vars = 30000
max_execution_time = 300

The second one was not possible because my site is on a shared server, so they modified my .htaccess with a DynamicTimeout on Joomla administrator with these istructions:

<IfModule mod_dtimeout.c>
<Files ~ ".php">
SetEnvIf Request_URI "index.php" DynamicTimeout=300
SetEnvIf Request_URI "administrator/index.php" DynamicTimeout=300
</Files>
</IfModule>
SetEnv PHPRC /home/mysite/public_html/php.ini
This topic is locked and no more replies can be posted.