wmjie / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

Error on connect w/Apache, Django, and mod_wsgi #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We have a Django application that we are trying to host via Apache and
mod_wsgi.  The application fails to make a database connection when loading
any of the application pages.

What is the expected output? What do you see instead?
Connections to database should be made and the page should load with
information from the database.  

We see the following in the Apache error_log:
    self.connection = Database.connect (**kwargs)
  File
"/opt/python2.6.3/lib/python2.6/site-packages/ibm_db-1.0-py2.6-linux-x86_64.egg/
ibm_db_dbi.py",
line 436, in connect
    raise _get_exception(inst)
Error: ibm_db_dbi::Error: SystemError('error return without exception set',)

We have looked at client and server side traces and it doesn't appear to
have made any sort of connection to the database server.

What version of the product are you using? On what operating system?
RedHat Enterprise Linux 4.7, Python 2.6.3, Django 1.1, mod_wsgi 3.1,
ibm_db-1.0, IBM DB2 V9.1.7 client

Please provide any additional information below.
We can run the stand-alone httpd server (django manage.py runserver
127.0.0.1:8000) and the application connects to the database properly and
loads the data appropriately, so we know the database connections are
configured properly.

Original issue reported on code.google.com by jschlu...@gmail.com on 15 Dec 2009 at 3:45

GoogleCodeExporter commented 9 years ago
I tried to reproduce this problem with the same environment. But in my case it 
works
fine.

This may arise  due to some db2 environment variables not sets correctly for web
server user.  
To resolve this issue, edit  '../bin/envvars' of apache and add following line 
into
the file 
“. /home/rahul/sqllib/db2profile” .

And then restart apache server. 
db2profile adds all the required environment variables for web server user.

Let me know how it works after this change. 

Original comment by rahul.pr...@in.ibm.com on 20 Apr 2010 at 10:49

GoogleCodeExporter commented 9 years ago

Original comment by rahul.pr...@in.ibm.com on 29 Apr 2010 at 12:35