Friday, January 25, 2013

Re: Django & Oracle connection problem

Hmm, ok so I guess having a different user name isn't causing the problem. I was able to connect to the database from the webserver using SQL Developer, and I am sure the credentials are correct. Are there any configuration steps that I need to perform for Instant Client or cx_Oracle? So far, I have just added the shared library path to the loader so that Instant Client can run (i.e. change LD_LIBRARY_PATH environment variable). Is there anything else I need to do to configure Instant Client to work with Django?

On Friday, January 25, 2013 8:27:38 AM UTC-5, Dan Gentry wrote:
You've probably already tried the simple things:

  • Confirm that the server name and port are correct.
  • Ensure that firewall/routing rules will allow the connection.
  • Try a simple connection on the same box with sqlplus.

Walking through this list has helped me a number of times.


On Thursday, January 24, 2013 5:27:22 PM UTC-5, Dylan Klomparens wrote:

I have a Django program that is connecting to an Oracle database. In my settings.py file I have this configuration:

DATABASES = {    'default': {      'ENGINE': 'django.db.backends.oracle',      'NAME': 'xe',      'USER': 'MY_USER_NAME',      'PASSWORD': 'abcdefghijklmnopqrstuvwxyz',      'HOST': 'db_server.example.com',      'PORT': '1234',    }  }

I received a strange error when attempting to load the website:

ORA-28547: connection to server failed, probable Oracle Net admin error

After further investigation, I sniffed the TCP traffic between the webserver and the database server. I discovered this text in the network communication, which I reformatted for this post:

(DESCRIPTION=      (ADDRESS=          (PROTOCOL=TCP)          (HOST=1.2.3.4)          (PORT=1234)      )      (CONNECT_DATA=          (SID=xe)          (CID=              (PROGRAM=httpd@webserver_hostname)              (HOST=webserver_hostname)              (USER=apache)          )      )  )

So my question is: why is Django attempting to connect to the Oracle database with different credentials than the ones I specified? Notably, it is attempting to use user 'apache' instead of 'MY_USER_NAME'. The database host IP, port, and SID are correct and what I specified. It just appears to be the user name that is different.

(As a side note, I suppose the password is transmitted separately in a later portion of the log in process?)

--
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.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment