ORA-20000: RQuery internal error [rqerConnect, 1, 0, 0]
J’ai récemment rencontré un problème avec ORE sur une machine nouvellement installée. Il s’agissait d’un système OEL7.3 sur lequel l’installation d’ORE n’avait pourtant posé aucun souci.
Globalement, la plupart des commandes fonctionnaient correctement à l’exception des appels ore.doEval qui échouaient avec la pile erreur suivante:
> ore.doEval(function() {
+ library(ORE)
+ }, ore.connect = TRUE)
Error in .oci.GetQuery(conn, statement, data = data, prefetch = prefetch, :
ORA-20000: RQuery internal error [rqerConnect, 1, 0, 0]
ORA-06512: at "RQSYS.RQEVALIMPL", line 77
ORA-06512: at "RQSYS.RQEVALIMPL", line 74
>
Il faut reconnaître que c’est assez léger comme message d’erreur… Mes recherches sur MOS & Google n’ayant rien donné, je décrit ici mes trouvailles. Cela pourra peut-être servir à quelqu’un.
J’ai d’abord commencé par réinstaller tous les composants mais cela n’a rien changé…
Finalement, c’est en lançant R directement sur le serveur de base de données (via l’alias ORE) et en tentant de charger le package ORE que j’ai compris l’origine du dysfonctionnement:
> library(ORE)
Loading required package: OREbase
Loading required package: OREcommon
Attaching package: ‘OREbase’
The following objects are masked from ‘package:base’:
cbind, data.frame, eval, interaction, order, paste, pmax, pmin,
rbind, table
Loading required package: OREembed
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/u01/app/12.1.0/db_1/R/library/png/libs/png.so':
libpng12.so.0: cannot open shared object file: No such file or directory
Error: package ‘OREembed’ could not be loaded
>
On peut effectivement constater que la librairie png.so référence libpng12.so.0 qui n’est pas présente sur mon système:
oracle@ec2-12cR1: /home/oracle [CDB121]# ldd /u01/app/12.1.0/db_1/R/library/png/libs/png.so
linux-vdso.so.1 => (0x00007ffe5179b000)
libpng12.so.0 => not found
libz.so.1 => /lib64/libz.so.1 (0x00007fb222933000)
libm.so.6 => /lib64/libm.so.6 (0x00007fb222631000)
libR.so => /u01/app/12.1.0/db_1/lib/libR.so (0x00007fb222000000)
libc.so.6 => /lib64/libc.so.6 (0x00007fb221c3e000)
/lib64/ld-linux-x86-64.so.2 (0x000055d6e0452000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fb221a3a000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb22181e000)
libOrdBlasLoader.so => /u01/app/12.1.0/db_1/lib/libOrdBlasLoader.so (0x00007fb2215c9000)
libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007fb2212a7000)
libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007fb22106b000)
libreadline.so.6 => /lib64/libreadline.so.6 (0x00007fb220e24000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fb220bc3000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fb2209b3000)
librt.so.1 => /lib64/librt.so.1 (0x00007fb2207aa000)
libgomp.so.1 => /lib64/libgomp.so.1 (0x00007fb220584000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fb22036d000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007fb220144000)
oracle@ec2-12cR1: /home/oracle [CDB121]#
Pourtant, je n’ai eu aucun message d’erreur à l’installation de ORE Server. De plus, la distribution ORE a été installée via yum ce qui aurait du mettre en place les dépendances requises…
J’ai alors installé manuellement libpng12:
[root@ec2-12cR1 ORE]# yum install libpng12
Loaded plugins: ulninfo
Resolving Dependencies
--> Running transaction check
---> Package libpng12.x86_64 0:1.2.50-10.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================
Installing:
libpng12 x86_64 1.2.50-10.el7 ol7_latest 171 k
Transaction Summary
========================================================================================================================================================
Install 1 Package
Total download size: 171 k
Installed size: 615 k
Is this ok [y/d/N]: y
Downloading packages:
libpng12-1.2.50-10.el7.x86_64.rpm | 171 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libpng12-1.2.50-10.el7.x86_64 1/1
Verifying : libpng12-1.2.50-10.el7.x86_64 1/1
Installed:
libpng12.x86_64 0:1.2.50-10.el7
Complete!
[root@ec2-12cR1 ORE]#
Le message obtenu lors d’un appel ore.doEval a alors changé:
> ore.doEval(function() {
+ library(ORE)
+ }, ore.connect = TRUE)
Error in .oci.GetQuery(conn, statement, data = data, prefetch = prefetch, :
ORA-20000: RQuery error
Error in .ore.embed.initCairo(pngargs, imglst.name) :
The package 'Cairo' is required
ORA-06512: at "RQSYS.RQEVALIMPL", line 104
ORA-06512: at "RQSYS.RQEVALIMPL", line 101
>
En chargeant cette fois-ci le package Cairo depuis ORE sur le serveur de base de données, on constate a nouveau un problème de librairie manquante:
> library(ORE)
Loading required package: OREbase
Loading required package: OREcommon
Attaching package: ‘OREbase’
The following objects are masked from ‘package:base’:
cbind, data.frame, eval, interaction, order, paste, pmax, pmin,
rbind, table
Loading required package: OREembed
Loading required package: OREstats
Loading required package: MASS
Loading required package: OREgraphics
Loading required package: OREeda
Loading required package: OREmodels
Loading required package: OREdm
Loading required package: lattice
Loading required package: OREpredict
Loading required package: ORExml
> library(Cairo)
Error : .onLoad failed in loadNamespace() for 'Cairo', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/u01/app/12.1.0/db_1/R/library/Cairo/libs/Cairo.so':
libtiff.so.3: cannot open shared object file: No such file or directory
Error: package or namespace load failed for ‘Cairo’
>
J’ai alors pris le parti de scanner tous les fichiers .so de l’arborescence ORE pour trouver les dépendances manquantes:
oracle@ec2-12cR1: /u01/app/12.1.0/db_1/R/library [CDB121]# find . -name *.so -exec ldd {} \; | grep "not found"
libtiff.so.3 => not found
oracle@ec2-12cR1: /u01/app/12.1.0/db_1/R/library [CDB121]#
Manifestement, c’est la version de libtiff qui diverge entre ce qui est attendu et ce qui est disponible sur mon système:
[root@ec2-12cR1 ORE]# ls -l /usr/lib64/libtiff* lrwxrwxrwx. 1 root root 16 Apr 11 10:01 /usr/lib64/libtiff.so.5 -> libtiff.so.5.2.0 -rwxr-xr-x. 1 root root 479440 Feb 1 08:20 /usr/lib64/libtiff.so.5.2.0 lrwxrwxrwx. 1 root root 18 Apr 11 10:01 /usr/lib64/libtiffxx.so.5 -> libtiffxx.so.5.2.0 -rwxr-xr-x. 1 root root 11408 Feb 1 08:20 /usr/lib64/libtiffxx.so.5.2.0 [root@ec2-12cR1 ORE]#
Ici, c’est compat-libtiff3 qui doit être installé (trouvé à partir de yum whatprovides libtiff.so.3):
[root@ec2-12cR1 ORE]# yum install compat-libtiff3
Loaded plugins: ulninfo
Resolving Dependencies
--> Running transaction check
---> Package compat-libtiff3.x86_64 0:3.9.4-11.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================
Installing:
compat-libtiff3 x86_64 3.9.4-11.el7 ol7_latest 132 k
Transaction Summary
==========================================================================================================================================================
Install 1 Package
Total download size: 132 k
Installed size: 419 k
Is this ok [y/d/N]: y
Downloading packages:
compat-libtiff3-3.9.4-11.el7.x86_64.rpm | 132 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : compat-libtiff3-3.9.4-11.el7.x86_64 1/1
Verifying : compat-libtiff3-3.9.4-11.el7.x86_64 1/1
Installed:
compat-libtiff3.x86_64 0:3.9.4-11.el7
Complete!
[root@ec2-12cR1 ORE]#
Une fois ce package installé, les problèmes ont disparus!
🙂
Merci Beaucoup !
I encountered exactly this issue and your blog saved me a lot of time and effort
fyi I am using R1.5.0 on RHEL 7.3