[Solved] cx_Oracle.DatabaseError: Error while trying to retrieve text for error ORA-01804

Error: 

cx_Oracle connect oracle error:

cx_Oracle.DatabaseError: Error while trying to retrieve text for error ORA-01804
sample code:
import cx_Oracle
conn = cx_Oracle.connect(user,pwd, self.ois_tns)

 

Solution: Check the environment variable settings for oracle in the .bash_profile under the Linux user on the server executing the code, as follows.

export ORACLE_HOME=/test/home/oracle/product/11.2.0.4
export LD_LIBRARY_PATH=O R A C L E H O M E / l i b e x p o r t T N S A D M I N = ORACLE_HOME/lib export TNS_ADMIN=ORACLEHOME/libexportTNSADMIN=ORACLE_HOME/network/admin

 

Read More: