django.db.utils.DatabaseError: Error while trying to retrieve text for error ORA-01804 - python-3.x

Q1. What versions are we using?
Ans.
Python 3.6.12
OS : CentOS 7 64-bit
DB : Oracle 18c
Django 2.2
cx_Oracle : 8.1.0
Q2. Describe the problem
Ans. While running server with "python3 manage.py runserver"
application is able to contact Oracle DB and show the Django Administration page and login also works.
But when we access the application using the Apache (HTTPD) based URL over secure SSL port, we do see the Django page and the admin page as well but Login to Admin page with Internal server error.
In the logs, we see
"django.db.utils.DatabaseError: Error while trying to retrieve text for error ORA-01804"
cx_oracle is otherwise able to connect to the database properly, another application is also using the same database behind the same httpd proxy and works fine
Q3. Show the directory listing where your Oracle Client libraries are installed (e.g. the Instant Client directory). Is it 64-bit or 32-bit?
Ans. 64-bit
Q4. Show what the PATH environment variable (on Windows) or LD_LIBRARY_PATH (on Linux) is set to?
LD_LIBRARY_PATH=/srv/vol/db/oracle/product/18.0.0/dbhome_1/lib:/lib:/usr/lib
PATH=$ORACLE_HOME/bin:/srv/vol/db/oracle/product/18.0.0/dbhome_1/lib:$PATH
Q5. Show any Oracle environment variables set (e.g. ORACLE_HOME, ORACLE_BASE).
ORACLE_HOME=/srv/vol/db/oracle/product/18.0.0/dbhome_1
TNS_ADMIN=$ORACLE_HOME/network/admin
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
ORACLE_BASE=/srv/vol/db/oracle
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/lib
Any suggestions/help is highly appreciated.
Thank you

I found the problem
So I just removed all the variable declarations from /etc/sysconfig/httpd and checked, the application was still able to access the lib files, so these were now redundant.
Then undid all variable declarations done earlier in .localsh and .localrc files for the os users. To start from scratch, and go step by step to see where it breaks.
So now, cx_Oracle was looking for the lib files in wrong directory
$ORACLE_HOME/client_1/lib
instead of
$ORACLE_HOME/lib
DPI-1047: Cannot locate a 64-bit Oracle Client library: "$ORACLE_HOME/client_1/lib/libclntsh.so: cannot open shared object file: No such file or directory". See https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html for help
I did not have any subfolder named "client_1" inside dbhome_1
so I just created a symlink client_1 that points to dbhome_1 (still unsure on this, but at least it works :) )
So, now, this error was gone but now again ORA-01804 was coming. 😑
I had read somewhere that this error can be fixed by adding "libociei.so" but I did not have one on my instance, so I generated it using these commands:-
mkdir -p $ORACLE_HOME/rdbms/install/instantclient/light
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk igenliboci
Then I just moved this libociei.so file from
$ORACLE_HOME/instantclient to $ORACLE_HOME/lib
Now there was a new error (so.. progress 😉 ):
ORA-12546 - TNS Permission Denied.
This was easy to solve 😀
I used this command to address this :-
setsebool -P httpd_can_network_connect on
And...... That was all! It worked.

Related

Source class "\Magento\Framework\DB\Adapter\Pdo\Mysql" for "Magento\Framework\DB\Adapter\Pdo\MysqlFactory" generation does not exist

i'm trying to install Magento 2 in localhost, and get an error when i want to connect the database.
The error is:
Source class "\Magento\Framework\DB\Adapter\Pdo\Mysql" for "Magento\Framework\DB\Adapter\Pdo\MysqlFactory" generation does not exist.
OS: linux mint 19.1 x64.
DB: MySQL.
I create a database (magento) and a user (magento), asigning all privileges.
When run:
mysql -u magento -p
And then put his password can access, so all is fine here.
The path dir is: /var/www/html/magento2
i'm follow this tutorial: https://tecadmin.net/install-magento-on-ubuntu-16-04/
what should I do to solve this?
Solved.
Change the Full Release with Sample Data of Magento for the Full Release with NO Sample Data, and solved.

OpenMPI: ORTE was unable to reliably start one or more daemons

I've been at it for days but could not solve my problem.
I am running:
mpiexec -hostfile ~/machines -nolocal -pernode mkdir -p $dstpath where $dstpath points to current directory and "machines" is a file containing:
node01
node02
node03
node04
This is the error output:
Failed to parse XML input with the minimalistic parser. If it was not
generated by hwloc, try enabling full XML support with libxml2.
[node01:06177] [[6421,0],0] ORTE_ERROR_LOG: Error in file base/plm_base_launch_support.c at line 891
--------------------------------------------------------------------------
ORTE was unable to reliably start one or more daemons.
This usually is caused by:
* not finding the required libraries and/or binaries on
one or more nodes. Please check your PATH and LD_LIBRARY_PATH
settings, or configure OMPI with --enable-orterun-prefix-by-default
* lack of authority to execute on one or more specified nodes.
Please verify your allocation and authorities.
* the inability to write startup files into /tmp (--tmpdir/orte_tmpdir_base).
Please check with your sys admin to determine the correct location to use.
* compilation of the orted with dynamic libraries when static are required
(e.g., on Cray). Please check your configure cmd line and consider using
one of the contrib/platform definitions for your system type.
* an inability to create a connection back to mpirun due to a
lack of common network interfaces and/or no route found between
them. Please check network connectivity (including firewalls
and network routing requirements).
--------------------------------------------------------------------------
[node01:06177] 1 more process has sent help message help-errmgr-base.txt / failed-daemon-launch
[node01:06177] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages
Failed to parse XML input with the minimalistic parser. If it was not
generated by hwloc, try enabling full XML support with libxml2.
[node01:06181] [[6417,0],0] ORTE_ERROR_LOG: Error in file base/plm_base_launch_support.c at line 891
I have 4 machines, node01 to node04. In order to log into these 4 nodes, I have to first log in to node00. I am trying to run some distributed graph functions. The graph software is installed in node01 and is supposed to be synchronised to the other nodes using mpiexec.
What I've done:
Made sure all passwordless login are setup, every machine can ssh to any other machine with no issues.
Have a hostfile in the home directory.
echo $PATH gives /home/myhome/bin:/home/myhome/.local/bin:/usr/include/openmpi:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
echo $LD_LIBRARY_PATH gives
/usr/lib/openmpi/lib
This has previously worked before, but it just suddenly started giving these errors. I got my administrator to install fresh machines but it still gave such errors. I've tried doing it one node at a time but it gave the same errors. I'm not entirely familiar with command line at all so please give me some suggestions. I've tried reinstalling OpenMPI from source and from sudo apt-get install openmpi-bin. I'm on Ubuntu 16.04 LTS.
You should focus on fixing:
Failed to parse XML input with the minimalistic parser. If it was not
generated by hwloc, try enabling full XML support with libxml2.
[node01:06177] [[6421,0],0] ORTE_ERROR_LOG: Error in file base/plm_base_launch_support.c at line 891

Creating/Migrating rBac in Yii2

I'm just getting started with Yii2 and I am following a tutorial here about setting up Yii2/AdminLTE and I am unable to finish the setup as I am getting errors in Terminal on the last step.
The part I am not able to finish is:
finaly we create rbac dbmanager with simple code, you can see in
folder "console/RbacController" with specific level for :
Admin : can do everything Editor : can edit, add and view Author : can
add and view viewer ; just viewer create rbac :
"yii migrate --migrationPath=#yii/rbac/migrations"
"yii rbac/init"
dont forget to chmod -R 777 on your web/assets if linux environment
and please free to update your setting on menu setting.
So in terminal on my mac, I tried both:
yii migrate --migrationPath=#yii/rbac/migrations
with the error: -bash: yii: command not found
and
/.yii migrate --migrationPath=#yii/rbac/migrations
with error: -bash: /.yii: No such file or directory.
I was able to complete the beginning of the tutorial, it is just this last step. I am already working in my yii2-advanced-adminlte directory
UPDATED:
Added screenshot of terminal window
Normally the yii command is located in
fro advanced template in project directory parent of backend, frontend, console and not in console
be sure of find the right dir and then accessing this try launche your command
yii migrate --migrationPath=#yii/rbac/migrations
eventually adjust your path to rbac/ migrations
Found it out, the problem was using MAMP I had to manually set the php bin to 5.5.23 in terminal because once I started down the path scaisEdge showed me I was getting a No such File or Folder error.
Eventually this is the command that worked for me (check your php MAMP path):
/Applications/MAMP/bin/php/php5.5.23/bin/php yii migrate
Source link: http://www.yiiframework.com/forum/index.php/topic/47043-error-on-using-db-migration-w-mysql#entry222568

How to set path to Mono so Supervisor knows about it?

I am following this tutorial (Hosting Nancy with Nginx on Ubuntu) with one change. I am using the Spark view engine instead of the built in view engine.
Spark view engine throws an error building any view when the Nancy host is running under supervisor.
System.SystemException: Error running mcs: Cannot find the specified file
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters,string[]) <0x00577>
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters,string[]) <0x00033>
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters,string[]) <0x0004d>
at Spark.Compiler.BatchCompiler.Compile (bool,string,string[]) <0x007f4>
at Spark.Compiler.CSharp.CSharpViewCompiler.CompileView (System.Collections.Generic.IEnumerable`1>,System.Collections.Generic.IEnumerable`1>) <0x00087>
at Spark.SparkViewEngine.CreateEntryInternal (Spark.SparkViewDescriptor,bool) <0x002af>
at Spark.SparkViewEngine.CreateEntry (Spark.SparkViewDescriptor) <0x0004f>
at Nancy.ViewEngines.Spark.SparkViewEngine/<>c__DisplayClass2.b__1 (Nancy.ViewEngines.ViewLocationResult) <0x00023>
at Nancy.ViewEngines.DefaultViewCache/<>c__DisplayClass1`1.b__0 (Nancy.ViewEngines.ViewLocationResult) <0x00023>
If I run the environment setting script /opt/mono/env.sh and then run my host from the command prompt, the website works.
I think it must be due to my Nancy host not being able to find Mono when running under supervisor.
For reference:
#env.sh
export PATH=/opt/mono/bin:$PATH
export LD_LIBRARY_PATH=/opt/mono/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH
I am using Mono 3.8.0 from here:
http://download.opensuse.org/repositories/home:/tpokorra:/mono/xUbuntu_14.04/
How do I set these paths so that Nancy host can find Mono when running under supervisor?
I needed to set the environment option in my supervisor configuration file.
Here is the setting that worked for the above example.
environment=PATH="/opt/mono/bin:$PATH"

Authentication error from server: SASL(-13): user not found: unable to canonify

Ok, so I'm trying to configure and install svnserve on my Ubuntu server. So far so good, up to the point where I try to configure sasl (to prevent plain-text passwords).
So; I installed svnserve and made it run as a daemon (also installed it as a startup script with the command svnserve -d -r /var/svn).
My repository is in /var/svn and has following configuration (to be found in /var/svn/myrepo/conf/svnserve.conf) (I left comments out):
[general]
anon-access = none
auth-access = write
realm = my_repo
[sasl]
use-sasl = true
min-encryption = 128
max-encryption = 256
Over to sasl, I created a svn.conf file in /usr/lib/sasl2/:
pwcheck_method: auxprop
auxprop_plugin: sasldb
sasldb_path: /etc/my_sasldb
mech_list: DIGEST-MD5
I created it in that folder as the article at this link suggested: http://svnbook.red-bean.com/nightly/en/svn.serverconfig.svnserve.html#svn.serverconfig.svnserve.sasl (and also because it existed and was listed as a result when I executed locate sasl).
Right after that I executed this command:
saslpasswd2 -c -f /etc/my_sasldb -u my_repo USERNAME
Which also asked me for a password twice, which I supplied. All going great.
When issuing the following command:
sasldblistusers2 -f /etc/my_sasldb
I get the - correct, as far as I can see - result:
USERNAME#my_repo: userPassword
Restarted svnserve, also restarted the whole server, and tried to connect.
This was the result from my TortoiseSVN client:
Authentication error from server: SASL(-13): user not found: unable to canonify
user and get auxprops
I have no clue at all in what I'm doing wrong. I've been scouring the web for the past few hours, but haven't found anything but that I might need to move the svn.conf file to another location - for example, the install location of subversion itself. which svn results in /usr/bin/svn, thus I moved the svn.conf to /usr/bin (although that doesn't feel right to me).
Still doesn't work, even after a new reboot.
I'm running out of ideas. Anyone else?
EDIT
I tried changing this (according to what some other forums on the internet told me to do): in the file /etc/default/saslauthd, I changed
START=no
MECHANISMS="pam"
to
START=yes
MECHANISMS="sasldb"
(Actually I had already changed START=no to START=yes before, but I forgot to mention it). But still no luck (I did reboot the whole server).
It looks like svnserve uses default values for SASL...
Check /etc/sasl2/svn.conf to be readable by the svnserver process owner.
If /etc/sasl2/svn.conf is owned by user root, group root and --rw------, svnserve uses the default values.
You will not be warned by any log file entry..
see section 4 of https://svn.apache.org/repos/asf/subversion/trunk/notes/sasl.txt:
This file must be named svn.conf, and must be readable by the svnserve process.
(it took me more than 3 days to understand both svnserve-sasl-ldap and this pitfall at the same time..)
I recommend to install the package cyrus-sasl2-doc and to read the section Cyrus SASL for System Administrators carefully.
I expect this is caused by the SASL API for the call
result = sasl_server_new(SVN_RA_SVN_SASL_NAME,
hostname, b->realm,
localaddrport, remoteaddrport,
NULL, SASL_SUCCESS_DATA,
&sasl_ctx);
if (result != SASL_OK)
{
svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
sasl_errstring(result, NULL, NULL));
SVN_ERR(write_failure(conn, pool, &err));
return svn_ra_svn__flush(conn, pool);
}
as you may see, handling the access failure by svnserve is not foreseen, only Ok or error is expected...
I looked in /var/log/messages and found
localhost svnserve: unable to open Berkeley db /etc/sasldb2: No such file or directory
When I created the sasldb to the above file and got the permissions right, it worked. Looks like it ignores or does not use the sasl database path.
There was another suggestion that rebooting solved the problem but that option was not available to me.

Resources