I'm getting 500 errors when trying to upload a image file with the
django admin.
I think this has to do with user/group permissions on the media
directory (currently they are owned by lighttpd:lighttd)
Does anyone know what 'user' is being run to actually do the saves? I
think it's the apache user but I could be wrong.
Anyways in my group file I added apache to the lighttd group.
Does anyone have any ideas? I'd appreciate the help. Thanks.
My setup:
Apache and fast_cgi serves the django pages
Lighttpd serves media
Db run off another server
Of course, the media you're saving is being processed by python, and
that's apache, if that config is right. Lighttpd is *serving* static
files, but upload is being done by apache.
Make sure the directory (and, just in case, it's parent) is writable by
the appropiate user or group. If unsure, set to 777 to see if it's a
permission problem, and don't forget to set it back to something more
secure once your test is done.
Have a look at apache logs (error logs specially) and make sure django
has DEBUG = True. If with DEBUG on you're still getting 500 pages (and
not a django error page), the problem will be reported in apache's error
log, scattered through a few lines, so remember to look further upwards
than the last line.
Be sure to write back with your results, even if they're good. We like
to know if we're helping or just dropping dumb lines :)
Good Luck,
Chris Hoeppner
www.pixware.org
Here's whats happening:
1. user "apache" is added to group "lighttpd"
2. when I chmod 777 it seems to work
3. when I change the file permissions back and save using the django
admin the 500 errror occurs. but i think the image IS saved there.
Here is what i see in the apache logs:
--------
[Mon Jun 25 18:17:31 2007] [error] [client 206.191.88.168]
(111)Connection refused: FastCGI: failed to connect to server "/var/
www/www.canadianfamily.ca/mysite.fcgi": connect() failed
[Mon Jun 25 18:17:31 2007] [error] [client 206.191.88.168] FastCGI:
incomplete headers (0 bytes) received from server "/var/www/
www.canadianfamily.ca/mysite.fcgi"
[Mon Jun 25 18:17:31 2007] [error] [client 206.191.88.168]
(111)Connection refused: FastCGI: failed to connect to server "/var/
www/www.canadianfamily.ca/mysite.fcgi": connect() failed
[Mon Jun 25 18:17:31 2007] [error] [client 206.191.88.168] FastCGI:
incomplete headers (0 bytes) received from server "/var/www/
www.canadianfamily.ca/mysite.fcgi"
[Mon Jun 25 18:17:32 2007] [error] [client 206.191.88.168]
(111)Connection refused: FastCGI: failed to connect to server "/var/
www/www.canadianfamily.ca/mysite.fcgi": connect() failed
[Mon Jun 25 18:17:32 2007] [error] [client 206.191.88.168] FastCGI:
incomplete headers (0 bytes) received from server "/var/www/
www.canadianfamily.ca/mysite.fcgi"
[Mon Jun 25 18:17:32 2007] [error] [client 206.191.88.168]
(111)Connection refused: FastCGI: failed to connect to server "/var/
www/www.canadianfamily.ca/mysite.fcgi": connect() failed
[Mon Jun 25 18:17:32 2007] [error] [client 206.191.88.168] FastCGI:
incomplete headers (0 bytes) received from server "/var/www/
www.canadianfamily.ca/mysite.fcgi"
[Mon Jun 25 18:31:18 2007] [error] [client 142.167.136.101]
(104)Connection reset by peer: FastCGI: comm with server "/var/www/
www.canadianfamily.ca/mysite.fcgi" aborted: read failed, referer:
http://www.canadianfamily.ca/contests/18/entered/
[Mon Jun 25 18:31:18 2007] [error] [client 142.167.136.101] FastCGI:
incomplete headers (0 bytes) received from server "/var/www/
www.canadianfamily.ca/mysite.fcgi", referer: http://www.canadianfamily.ca/contests/18/entered/
--------
Apparently the mysite.fcgi file was not being automatically created
when I used the fcgi startup script to start the site. So I went into
the directory and did a `touch mysite.fcgi` then a good old chown
lighttd:lightd mysite.fcgi and it a magical thing happened - it
started working.
Thanks for all you help.
John
i remember i got this error when i tried to save a file because my
database's auto field sequences were not set up correctly. i am using
postgresql and i use fixtures to populate the database. so there were
a bug in fixtures that did not set sequences in postgresql correctly
(i think it might be fixed now), so i was getting this error.
hope this helps
konstantin
On Jun 26, 12:50 pm, john-f <emailjohnf-...@yahoo.ca> wrote:
> HI Thanks for the reply - I really appreciate it. The problem however
> still occurs:
>
> Here's whats happening:
> 1. user "apache" is added to group "lighttpd"
> 2. when I chmod 777 it seems to work
> 3. when I change the file permissions back and save using the django
> admin the 500 errror occurs. but i think the image IS saved there.
>
> Here is what i see in the apache logs:
> --------
> [Mon Jun 25 18:17:31 2007] [error] [client 206.191.88.168]
> (111)Connection refused: FastCGI: failed to connect to server "/var/
> www/www.canadianfamily.ca/mysite.fcgi": connect() failed
> [Mon Jun 25 18:17:31 2007] [error] [client 206.191.88.168] FastCGI:
> incomplete headers (0 bytes) received from server "/var/www/www.canadianfamily.ca/mysite.fcgi"
> [Mon Jun 25 18:17:31 2007] [error] [client 206.191.88.168]
> (111)Connection refused: FastCGI: failed to connect to server "/var/
> www/www.canadianfamily.ca/mysite.fcgi": connect() failed
> [Mon Jun 25 18:17:31 2007] [error] [client 206.191.88.168] FastCGI:
> incomplete headers (0 bytes) received from server "/var/www/www.canadianfamily.ca/mysite.fcgi"
> [Mon Jun 25 18:17:32 2007] [error] [client 206.191.88.168]
> (111)Connection refused: FastCGI: failed to connect to server "/var/
> www/www.canadianfamily.ca/mysite.fcgi": connect() failed
> [Mon Jun 25 18:17:32 2007] [error] [client 206.191.88.168] FastCGI:
> incomplete headers (0 bytes) received from server "/var/www/www.canadianfamily.ca/mysite.fcgi"
> [Mon Jun 25 18:17:32 2007] [error] [client 206.191.88.168]
> (111)Connection refused: FastCGI: failed to connect to server "/var/
> www/www.canadianfamily.ca/mysite.fcgi": connect() failed
> [Mon Jun 25 18:17:32 2007] [error] [client 206.191.88.168] FastCGI:
> incomplete headers (0 bytes) received from server "/var/www/www.canadianfamily.ca/mysite.fcgi"
> [Mon Jun 25 18:31:18 2007] [error] [client 142.167.136.101]
> (104)Connection reset by peer: FastCGI: comm with server "/var/www/www.canadianfamily.ca/mysite.fcgi" aborted: read failed, referer:http://www.canadianfamily.ca/contests/18/entered/
> [Mon Jun 25 18:31:18 2007] [error] [client 142.167.136.101] FastCGI:
> incomplete headers (0 bytes) received from server "/var/www/www.canadianfamily.ca/mysite.fcgi", referer:http://www.canadianfamily.ca/contests/18/entered/
> --------
I was just about to tell you to have a look at the fcgi file. Glad you
solved it.
Sincerely,
Chris Hoeppner
www.pixware.org
On Jun 26, 1:49 pm, Christian Markwart Hoeppner <c...@pixware.org>
wrote: