• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 Unable to save template: "The server did not respond in time. Please try again."

Contex

Well-known member
#1
XenForo 1.1.3

Hello, I recently moved my website to a new hosting service and I'm currently using Nginx instead of Apache.
Everything was working fine before the move, but now I seem to get some kind of issue when saving a template, there are no errors in the XenForo server log but I assume I've setup the server block in Nginx wrong, because it keeps returning the same error in the log:
Code:
2012/07/17 09:06:56 [error] 13512#0: *84929 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: IP, server: domain.com, request: "POST /admin.php?templates/save-multiple.json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "domain.com", referrer: "http://domain.com/admin.php?templates/message_user_info.944/edit&style_id=10"
2012/07/17 09:06:56 [error] 13512#0: *84929 open() "/home/contex/sites/unavailable/public/index.html" failed (2: No such file or directory) while sending to client, client: IP, server: domain.com, request: "POST /admin.php?templates/save-multiple.json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "domain.com", referrer: "http://domain.com/admin.php?templates/message_user_info.944/edit&style_id=10"
And here's the access log:
Code:
IP - - [17/Jul/2012:09:37:03 +0000] "POST /admin.php?templates/save-multiple.json HTTP/1.1" 499 0 "http://domain.com/admin.php?templates/message_user_info.944/edit&style_id=10" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11"
Here's my server block in Nginx:
Code:
server {
    listen 80; # Listen on port 80 for IPv4 requests
 
    server_name domain.com;
    server_tokens off;
 
    root /home/contex/sites/domain.com/web/public;
    index index.html index.htm index.php;
 
    access_log /home/contex/sites/domain.com/web/logs/access/access.log combined;
    error_log /home/contex/sites/domain.com/web/logs/error/error.log error;
 
    error_page 502 503 @unavailable;
 
    client_max_body_size 100m;
 
    # Set expiration information for assets
    location ~ \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
        #expires max;
        log_not_found off;
    }
 
    location / {
        try_files $uri $uri/ /index.php?$uri&$args;
        index index.php index.html;
    }
 
    location /internal_data/ {
        internal;
    }
    location /library/ {
      internal;
    }
 
    location ~ \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi_params;
    }
 
    location @unavailable {
        root /home/contex/sites/unavailable/public;
        rewrite ^(.*)$ /index.html break;
    }
}
As a side note, editing the .css files works fine without any issues, it's just the templates.

What am I doing wrong?
 

Contex

Well-known member
#3
How many styles do you have installed? The template rebuild process can take some time with lots of styles installed. That error means it took a bit too long. One possible solution is to delete any styles you aren't using. Or you can try to increase the limits. See this post:

http://xenforo.com/community/thread...-nodes-updating-usergroups.28811/#post-333911
Thanks for the quick reply!

I have about 6 parent styles of the style I'm trying to edit, they are all being used as users can select a style depending on which character they prefer.

I did as you suggested, and I'm currently getting a new error, I believe the timeout isn't related to the amount of styles but my setup with nginx.
Eitherway, after applying those attributes I'm getting this returned instead:


And the error still exists:
Code:
2012/07/17 10:56:07 [error] 29328#0: *3986 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: IP, server: domain.com, request: "POST /admin.php?templates/save-multiple.json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "domain.com", referrer: "http://domain.com/admin.php?templates/message_user_info.944/edit&style_id=10"
2012/07/17 10:56:07 [error] 29328#0: *3986 open() "/home/contex/sites/unavailable/public/index.html" failed (2: No such file or directory) while sending to client, client: IP, server: domain.com, request: "POST /admin.php?templates/save-multiple.json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "domain.com", referrer: "http://domain.com/admin.php?templates/message_user_info.944/edit&style_id=10"
It's trying to look for a /home/contex/sites/unavailable/public/index.html, which I haven't created yet.
However this error would only show if the page returned a 502 or a 503: "error_page 502 503 @unavailable;", why would the template editing throw that error?

Any ideas where I can go from here?
 

Contex

Well-known member
#5
Again, thanks for the quick replies.

I tried all the above and they all failed/did not work.
I read up on PHP-FPM and found a "request_terminate_timeout" in /etc/php5/fpm/pool.d/www.conf, the value was 30s, I have now set this to 120s.
Seems to be working like a charm now, thanks again!