Solving a 500 error

Hi All,

I have an nginx install with the configuration below.

The server is a linux VM running under Virtual Box on my windows
machine. The website / directory is made available as a sharename using
Samba, which I connect to from Windows, so I can edit the files. I edit
in windows, using familiar tools and then test using a browser, usually
without restarting nginx or init-fastcgi.

This works fine for php files. When I edit one of two javascript files,
the next request for a javascript file fails with a 500 error - even if
the request is not for the changed file.

The version of nginx I am running is 1.2.6 compiled with the long
polling module included.

Does anyone know what is happening?

Thansk,

Ian

This is my server confiig.

server {
server_name coachmaster3.anake.hcs;
listen 80;
fastcgi_read_timeout 300;
index index.php;
root /home/ian/websites/coachmaster3dev/htdocs;
location = / {
rewrite ^ /index.php last;
}
# serve php via fastcgi if it exists
location ~ .php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
fastcgi_param CENTRAL_ROOT $document_root;
fastcgi_param RESELLER_ROOT $document_root;
fastcgi_param HTTPS OFF;
}
# serve static files
try_files $uri =404;
# now to configure the long polling
push_store_messages on;
location /publish {
push_publisher;
set $push_channel_id $arg_id;
push_message_timeout 30s;
push_max_message_buffer_length 10;
}
# public long-polling endpoint
location /activity {
push_subscriber;
push_subscriber_concurrency broadcast;
set $push_channel_id $arg_id;
default_type text/plain;
}
}


Ian H.
31 Sheerwater, Northampton NN3 5HU,
Tel: 01604 513875
Preparing eBooks for Kindle and ePub formats to give the best reader
experience.

On 01/10/2013 20:36, Jonathan M. wrote:

To be fair, chap, you’re the one who has access to the log files! What
dothey say?
They tell me nothing new.

When I change a static file, I get a 500 error on the next static file I
request - even if it is not the file I have changed.

Sometimes I get two consecutive 500 errors, sometimes only one.

I’m still mystified as to why I should get any at all - and why on
unchanged files?

Regards

Ian

On 1 October 2013 17:52, Ian H. [email protected] wrote:

Hi All,

I have an nginx install with the configuration below.

The server is a linux VM running under Virtual Box on my windows machine.
The website / directory is made available as a sharename using Samba, which
I connect to from Windows, so I can edit the files. I edit in windows, using
familiar tools and then test using a browser, usually without restarting
nginx or init-fastcgi.

I used to admin some devs who had that sort of abortion of a workflow
and did the same as you.

Just don’t do that.

This works fine for php files. When I edit one of two javascript files, the
next request for a javascript file fails with a 500 error - even if the
request is not for the changed file.

The version of nginx I am running is 1.2.6 compiled with the long polling
module included.

Does anyone know what is happening?

To be fair, chap, you’re the one who has access to the log files! What
do they say?

J

On Tue, 2013-10-01 at 22:57 +0100, Ian H. wrote:

I’m still mystified as to why I should get any at all - and why on
unchanged files?

Regards

Ian

To reiterate what Jonathan said… you have nginx and system logs. Next
time you get the error, how about just tailing the last 50 lines from
all logs that have changed?

Also have you gone over the basics: disks full, out of inodes, enough
open files, etc.

Steve

Steve H. BSc(Hons) MIITP
http://www.greengecko.co.nz
Linkedin: http://www.linkedin.com/in/steveholdoway
Skype: sholdowa

On 1 October 2013 22:57, Ian H. [email protected] wrote:

On 01/10/2013 20:36, Jonathan M. wrote:

To be fair, chap, you’re the one who has access to the log files! What
do they say?

They tell me nothing new.

You get a 500 in your access log and a simultaneous entry in your
error log doesn’t appear? At all?

When I change a static file, I get a 500 error on the next static file I
request - even if it is not the file I have changed.

Sometimes I get two consecutive 500 errors, sometimes only one.

I’m still mystified as to why I should get any at all - and why on unchanged
files?

That “push” config stuff looks like a 3rd party module. Try running
without that enabled and see if the errors persist. If they do, try it
without that module compiled in and see if they persist.

NB I’m not suggesting you have to not use this module; just that if
you can isolate the problem to “when it’s enabled/compiled”, then you
can poke that module’s authors about the problem.

Cheers,
J

Hello!

On Tue, Oct 01, 2013 at 05:52:32PM +0100, Ian H. wrote:

This works fine for php files. When I edit one of two javascript
files, the next request for a javascript file fails with a 500 error

  • even if the request is not for the changed file.

The version of nginx I am running is 1.2.6 compiled with the long
polling module included.

Does anyone know what is happening?

Key points is “Samba” and “Linux”. When you edit files via Samba
share, it tries to lock files with fcntl(F_GETLEASE) if running on
Linux. This in turn results in errors while opening such “locked”
files. For more information see Samba docs here:

http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/locking.html#id2616903

It’s not clear why the problem happens with files you didn’t
changed, but I would suppose they are at least open via Samba.

Anyway, disabling appropriate locking in Samba configuration will
likely help. See the link above for details.


Maxim D.
http://nginx.org/en/donation.html

Sounds familiar, edit files elsewhere and overwrite them for nginx’s
destination, any basic editor has macro support, just make a macro that
does
a copy after save.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,243333,243371#msg-243371

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs