Tuesday, March 1, 2011

Re: Django+ oracle, working with apache(mod_python, wsgi) and in runserver, ora-03114 in fastcgi

On Mar 1, 4:23 am, lipt0n <michal.lipin...@gmail.com> wrote:
> Django 1.2.3
> python 2.6
> cx_oracle 5.0.4
> oracle 10 XE
>
> $ cat /var/log/nginx/localhost.error_log
> 2011/02/28 16:52:39 [error] 11159#0: *47 FastCGI sent in stderr:
> "Traceback (most recent call last):
>   File "/usr/lib/python2.6/site-packages/flup-1.0.3.dev_20110111-
> py2.6.egg/flup/server/fcgi_base.py", line 574, in run
>     protocolStatus, appStatus = self.server.handler(self)
>   File "/usr/lib/python2.6/site-packages/flup-1.0.3.dev_20110111-
> py2.6.egg/flup/server/fcgi_base.py", line 1159, in handler
>     result = self.application(environ, start_response)
>   File "/home/intranet/libs/django/core/handlers/wsgi.py", line 248,
> in __call__
>     signals.request_finished.send(sender=self.__class__)
>   File "/home/intranet/libs/django/dispatch/dispatcher.py", line 162,
> in send
>     response = receiver(signal=self, sender=sender, **named)
>   File "/home/intranet/libs/django/db/__init__.py", line 84, in
> close_connection
>     conn.close()
>   File "/home/intranet/libs/django/db/backends/__init__.py", line 70,
> in close
>     self.connection.close()
> OperationalError: ORA-03114: not connected to ORACLE" while reading
> response header from upstream, client: 192.168.1.105, server:
> localhost, request: "GET /accounts/menuleft/122/ HTTP/1.1", upstream:
> "fastcgi://127.0.0.1:9001", host: "192.168.1.50", referrer: "http://
> 192.168.1.50/accounts/menuleft/"
> 2011/02/28 16:54:46 [error] 11159#0: *56 connect() failed (111:
> Connection refused) while connecting to upstream, client:
> 192.168.1.105, server: localhost, request: "GET /accounts/menuleft/
> 122/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host:
> "192.168.1.50", referrer: "http://192.168.1.50/accounts/menuleft/"


It appears that the error is actually from the previous (working)
request when Django subsequently tries to close the database
connections and fails, and since the error goes uncaught, it kills the
server.

It's pretty weird that it would fail in this way. What happens if you
explicitly close the database connections at the end of your view?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment