AudioSegment.from_file fails if I specify 'wav' - audio

This is a potential 'gotcha' which I'll document here in case anyone else trips over it.
I'm running a conversion on files that may be in .wav or .mov format. The test looks like this:
if pic[0].audiodesc.path.lower().endswith('.wav'):
sound = AudioSegment.from_file(pic[0].audiodesc.path)
sound.export(mp3_filepath, format = 'mp3', bitrate = '64k')
elif pic[0].audiodesc.path.lower().endswith('.mov'):
sound = AudioSegment.from_file(pic[0].audiodesc.path, 'mov')
sound.export(mp3_filepath, format = 'mp3', bitrate = '64k')
In AudioSegment.from_file(pic[0].audiodesc.path), if I specify .., 'wav') then the encoding fails with:
avconv version 9.20-6:9.20-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers built on Dec 7 2016 21:22:31 with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
/tmp/tmpGhtAOn: Operation not permitted

Removing the 'wav' fixes the problem.

Related

Jack server Cannot create new client on Raspbian Jessie Lite

I have installed Jack 2 on Raspberry Pi 3 with Raspbian Jessie Lite following the instructions from here https://github.com/iani/RPI-first-steps#step-3-get-and-install-jack-audio-drivers and added user to "realtime" group like this http://jackaudio.org/faq/linux_rt_config.html.
When I start Jack server with following command:
$ jackd -P75 -dalsa -dhw:0 -p1024 -n3 -s -r44100
everything seems fine and Jack server output is:
jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 75
self-connect-mode is "Don't restrict self connect requests"
creating alsa driver ... hw:0|hw:0|1024|3|44100|0|0|nomon|swmeter|soft-mode|32bit
configuring for 44100Hz, period = 1024 frames (23.2 ms), buffer = 3 periods
ALSA: final selected sample format for capture: 24bit little-endian in 3bytes format
ALSA: use 3 periods for capture
ALSA: final selected sample format for playback: 24bit little-endian in 3bytes format
ALSA: use 3 periods for playback
But when I try to run for instance Pure Data as jack client I get this output from Pure Data:
Connect: can't connect named semaphore name = jack_sem.1000_default_system err = No such file or directory
Cannot read socket fd = 9 err = No such file or directory
CheckRes error
JackSocketClientChannel read fail
Cannot open pure_data_0 client
error: JACK: server returned status 33
while Jack server is complaining:
ClientNotify fails name = system notification = 0 val1 = 0 val2 = 0
NotifyAddClient new_client fails name = pure_data_0
Cannot notify add client
Cannot create new client
I tried to play mp3 with mplayer using jack but it seems to behave similarly. Mplayer looks like it is playing the mp3 but there's no audio output and the console output is:
Selected audio codec: MPEG 1.0/2.0/2.5 layers I, II, III [mpg123]
AUDIO: 44100 Hz, 2 ch, s16le, 160.0 kbit/11.34% (ratio: 20000->176400)
AO: [pulse] Init failed: Connection refused
[AO_ALSA] alsa-lib: pcm_hw.c:1557:(snd_pcm_hw_open) open '/dev/snd/pcmC0D0p' failed (-16): Device or resource busy
[AO_ALSA] alsa-lib: pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
[AO_ALSA] Playback open error: Device or resource busy
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
Connect: can't connect named semaphore name = jack_sem.1000_default_system err = No such file or directory
Cannot open MPlayer [939] client
Cannot read socket fd = 9 err = No such file or directory
CheckRes error
JackSocketClientChannel read fail
[JACK] cannot open server
[AO SDL] Samplerate: 44100Hz Channels: Stereo Format s16le
[AO_ALSA] alsa-lib: pcm_hw.c:1557:(snd_pcm_hw_open) open '/dev/snd/pcmC0D0p' failed (-16): Device or resource busy
[AO_ALSA] alsa-lib: pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
[AO SDL] Unable to open audio: No available audio device
AO: [null] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 20.1 (20.0) of 269.6 (04:29.6) 2.9%
Jack server's output is similar to the prior case:
ClientNotify fails name = system notification = 0 val1 = 0 val2 = 0
NotifyAddClient new_client fails name = MPlayer [939]
Cannot notify add client
Cannot create new client
I am really new to working with sound on linux and although I have read something about linux audio architecture I'm getting lost. I tried to google all different error messages from console outputs but didn't manage to find answer. Maybe I'm missing something really basic here.
Any suggestions are appreciated.
Thanks in advance.

How to connect select data from Informix database in python3 using pyodbc / unixODBC

I'm having a problem selecting data from Informix database tables using python3.5 and pyodbc/unixODBC.
I have a little py file (ifx.py) the contents of which are:
import pyodbc
db=pyodbc.connect('DSN=Test1')
db.execute("SELECT * FROM customer ")
and I get an error :
pyodbc.Error: ('HY000', '[HY000] [Informix][Informix ODBC Driver]Invalid byte in codeset conversion input. (21000) (SQLExecDirectW)')
All the searches I've done imply something to do with LOCALE settings, but I check and they're all set the same:
CLIENT_LOCALE=en_US.819
DB_LOCALE=en_US.819
dbs_collate=en_US.819
If I use the unixODBC 'isql' utility I can connect to and query the data happily.
Version Information.
unixODBC.x86_64 0:2.2.14-14.el6
pyodbc.version => '4.0.6'
Linux => Red Hat Enterprise Linux Server release 6.8
python3.5 => Python 3.5.3
Database => IBM Informix Dynamic Server Version 12.10.FC6X5
ClientSDK => IBM Informix CSDK Version 4.10, IBM Informix-ESQL Version 4.10.FC6
Environment Variable ODBCINI points to /etc/odbc.ini. Contents are:
[ODBC Data Sources]
Test1=IBM INFORMIX ODBC DRIVER
;
; Define ODBC Database Driver's Below - Driver Configuration Section
;
[Test1]
Driver=/opt/informix/lib/cli/iclis09b.so
Description=IBM INFORMIX ODBC DRIVER
Database=eunice
LogonID=
pwd=
Servername=indika_test
Port=9916
CursorBehavior=0
CLIENT_LOCALE=en_US.819
DB_LOCALE=en_US.819
TRANSLATIONDLL=/opt/informix/lib/esql/igo4a304.so
/etc/odbcinst.ini contents:
[ODBC Drivers]
IBM INFORMIX ODBC DRIVER=Installed
[IBM INFORMIX ODBC DRIVER]
Driver=/opt/informix/lib/cli/iclit09b.so
Setup=/opt/informix/lib/cli/iclit09b.so
APILevel=1
ConnectFunctions=YYY
DriverODBCVer=03.51
FileUsage=0
SQLLevel=1
smProcessPerConnect=Y
and odbcinst -j output is
unixODBC 2.2.14
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /etc/odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
Thanks in advance for any help or suggestions.
This is probably due to an multibyte character in the customer table, which can not be converted to Latin 1, ISO 8859-1 from UTF8. Even with same codes set on both CLIENT_LOCALE and DB_LOCALE, an ODBC client makes an internal conversion from UTF-8 to 8859. If there are any 2-byte chars (chars beyond extended-ascii 255) they will not convert to a Latin-1 client. I would look at the data in customer table and identify the problematic data.
It is possible (or likely) that there is an Unicode encoding mismatch.
On my Debian system, the python builds (both 2.7 and 3.4) use UCS-4 encoding. You can verify with this command:
python3 -c "import sys;print(sys.maxunicode<66000 and'UCS2'or'UCS4')"
Once you find the encoding, you need to make sure the Informix odbc.ini file has the same Unicode encoding. In my odbc.ini file,
[ODBC]
;uncomment the below line for UNICODE connection
UNICODE=UCS-4
I hope this resolves your issue.
Thanks for the responses. It was unicode mismatch.
db=pyodbc.connect('DSN=Test1')
db.setdecoding(pyodbc.SQL_WCHAR, encoding='UTF-8')
db.setdecoding(pyodbc.SQL_CHAR, encoding='UTF-8')
db.setencoding(encoding='UTF-8')
By adding setencoding and setdecoding I was able to successfully select data form the Informix DB.

Segmentation fault when trying to execute recovered filesystem in a digital video tuner

Let me introduce where this thing comes from.
A few years ago I got a digital video tuner, which had a closed source version of Linux. The manufacturers of this device didn't want to share the source code of the OS, neither I was able to find it on internet. The SoC is a Celestial/Cavium CSM1800.
Doing some dubious things, I accidentally executed the update procedure and wiped the NAND flash. Luckily, I had dumped the contents of the mtd partitions (there are 2 mapped to this NAND flash, Kernel 3M and the rest is a JFFS2 partition).
This board has U-Boot loaded on another memory (a 1MB SPI), so "it wasn't totally bricked" because of the NAND wipe.
Back to the thing. I had a corrupt (dunno how it got corrupted) dump of the kernel, but after a lot of tinkering, I extracted the vmlinux (i.e. not gzip compressed) from the zImage. It seems the gzip unpack algorithm was bad, really weird.
After creating a new uImage using the vmlinux previously unpacked, I used the "fatload" command to load it and the thing booted, but of course it couldn't find the JFFS2 partition.
Then I tried writing the raw dump of the JFFS2 which I got from /dev/mtdblockX into the NAND, in the originally specified partition (after the 3M of the original kernel).
After booting, the kernel spit out a lot of errors concerning bad magics, empty flash, etc.
Well, after this I tried unpacking the JFFS2 in a Mint Virtual Machine, and I could extract the files. Since this tuner has an USB, I formatted a usb stick in ext2 and copied the files from the unpacked JFFS2 filesystem.
After crafting some bootargs to run from the usb stick instead of the NAND, I got the typical "Kernel panic - not syncing: Attempted to kill init!".
I quickly tried to specify the sh command in init via the bootargs. Same thing. So I downloaded a static linked binary version of busybox. I copied it to the /bin/ (where the original one resided), marked as executable, and tried again. This time, I got a shell!
The thing is, when I try to run ANY of the original applications, I got a "Segmentation fault" and nothing else.
Besides this, the /proc is not filled with anything, and I really don't have a clue why!
Other files, like text files or plain text files were OK, but im not discarding the possibility of a corrupted dump.
Finally, I tried to chroot to the unpacked JFFS2 in the Mint VM. Same "Segmentation fault" errors, but at least a core dump is created. I tried gdb-multiarch in that core dump, but only 2 frames appear, and since there are no symbols, nothing useful is shown there. (In fact, only the 2 frames addresses are only shown).
Some usefull (or not?) things:
binwalk of the vmlinux image
104288 0x19760 ASCII cpio archive (SVR4 with no CRC),
file name: "/dev", file name length: "0x00000005", file size:
"0x00000000"
104404 0x197D4 ASCII cpio archive (SVR4 with no CRC),
file name: "/dev/console", file name length: "0x0000000D", file size:
"0x00000000"
104528 0x19850 ASCII cpio archive (SVR4 with no CRC),
file name: "/root", file name length: "0x00000006", file size:
"0x00000000"
104644 0x198C4 ASCII cpio archive (SVR4 with no CRC),
file name: "TRAILER!!!", file name length: "0x0000000B", file size:
"0x00000000"
1856733 0x1C54DD Certificate in DER format (x509 v3),
header length: 4, sequence length: 1284
1856853 0x1C5555 Certificate in DER format (x509 v3),
header length: 4, sequence length: 1288
2597693 0x27A33D Certificate in DER format (x509 v3),
header length: 4, sequence length: 1292
2597797 0x27A3A5 Certificate in DER format (x509 v3),
header length: 4, sequence length: 1292
2598317 0x27A5AD Certificate in DER format (x509 v3),
header length: 4, sequence length: 5380
2598397 0x27A5FD Certificate in DER format (x509 v3),
header length: 4, sequence length: 5380
3292029 0x323B7D Certificate in DER format (x509 v3),
header length: 4, sequence length: 1292
3292033 0x323B81 Certificate in DER format (x509 v3),
header length: 4, sequence length: 1304
3292037 0x323B85 Certificate in DER format (x509 v3),
header length: 4, sequence length: 1308
3469469 0x34F09D Certificate in DER format (x509 v3),
header length: 4, sequence length: 3
3701960 0x387CC8 Linux kernel version "2.6.32.36-SDK-1.1
(ylei#software) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202) ) #7
PREEMPT Wed Feb 15 14:12:59 CST 2012"
3705492 0x388A94 gzip compressed data, maximum
compression, from Unix, last modified: 2012-01-18 04:15:11
3930268 0x3BF89C CRC32 polynomial table, little endian
4692111 0x47988F Unix path:
/S70/S75/505V/F505/F707/F717/P8
readelf output of an executable file (rw_eeprom_byte). It's in spanish, but you could get the idea. http://pastebin.com/H0ZZcAaf (in pastebin so it keeps the spaces and it's more readeable).
uname:
Linux (none) 2.6.32.36-SDK-1.1 #7 PREEMPT Wed Feb 15 14:12:59 CST 2012
armv5tejl GNU/Linux
Original boot (with the original filesystem and kernel):
http://pastebin.com/YL2d2HYj
Any hints? Maybe another firmware that has the same SoC where I can extract the filesystem?
Thanks!
PS1: English is not my native language, so forgive any errors you might see.
PS2: I'm not an expert in Linux, and my strong area is programming embedded devices (withouth linux :P).

File capabilities do not transfer to process once executed

I'm trying to write a program which requires elevated capabilities (rather than simply run it with sudo). However, none of the capabilities I set using setcap seem to transfer into the process once executed. This problem occurs across multiple executables and using different capabilities.
This code uses cap_set_file() to give the CAP_NET_RAW capability to a file passed as a CLA. (Don't ask me why I need this.)
#include <stdio.h>
#include <stdlib.h>
#include <sys/prctl.h>
#include <sys/capability.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#define handle_error(msg) \
do { printf("%s: %s\n", msg, strerror(errno)); exit(EXIT_FAILURE); } while (0)
void print_cap_buf(cap_t cur) {
char *buf;
buf = cap_to_text(cur, NULL);
printf("%s\n", buf);
cap_free(buf);
}
void get_and_print_cap_buf() {
cap_t cur = cap_get_proc();
print_cap_buf(cur);
cap_free(cur);
}
int main(int argc, char *argv[]) {
cap_t file_cap;
printf("Process capabilities: ");
get_and_print_cap_buf(); // Print the current process capability list.
file_cap = cap_from_text("cap_net_raw=ep");
if (file_cap == NULL) handle_error("cap_from_text");
printf("Capabilities to set in file: "); print_cap_buf(file_cap);
if (argc == 2) {
if ( cap_set_file(argv[1], file_cap) != 0) handle_error("cap_set_file");
} else printf("No file specified.\n");
cap_free(file_cap);
return 0;
}
After compiling with gcc:
gcc -Wall -pedantic -std=gnu99 test.c -o tt -lcap
I give it the capabilities with:
sudo setcap "cap_setfcap,cap_fowner,cap_net_raw=eip" tt
and using getcap tt, the output is:
$ getcap tt
tt = cap_fowner,cap_net_raw,cap_setfcap+eip
However, when I run the program, I get the following output (test-client is an executable which creates a raw Ethernet socket):
$ ./tt test-client
Process capabilities: =
Capabilities to set in file: = cap_net_raw+ep
cap_set_file: Operation not permitted
HOWEVER... when I run the program with sudo, all process capabilities come through just fine.
$ sudo ./tt test-client
Process capabilities: = cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_linux_immutable,cap_net_bind_service,cap_net_broadcast,cap_net_admin,cap_net_raw,cap_ipc_lock,cap_ipc_owner,cap_sys_module,cap_sys_rawio,cap_sys_chroot,cap_sys_ptrace,cap_sys_pacct,cap_sys_admin,cap_sys_boot,cap_sys_nice,cap_sys_resource,cap_sys_time,cap_sys_tty_config,cap_mknod,cap_lease,cap_audit_write,cap_audit_control,cap_setfcap,cap_mac_override,cap_mac_admin,cap_syslog,cap_wake_alarm,cap_block_suspend,37+ep
Capabilities to set in file: = cap_net_raw+ep
and the target file "test-client" gets its capabilities set properly.
However, even with CAP_NET_RAW, the client fails on its socket() call with EPERM. I've tried setting CAP_NET_ADMIN in case it needed that as well; same issue. I've tried using CAP_SETPCAP on the program above; no dice. I'm fairly sure I've narrowed it down to some disconnect where the executable file's capabilities aren't getting into the running process.
What am I missing here?
EDIT, the next morning:
Okay, so I've done some more testing and it turns out this code works just fine on a Raspberry Pi. I'm running Lubuntu 16.04 with LXTerminal on my primary machine and that's the one that's failing. It fails inside LXTerminal and also in a text-only shell. Maybe it's an OS bug?
The Lubuntu machine (cat /proc/version):
Linux version 4.4.0-34-generic (buildd#lgw01-20) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2.1) ) #53-Ubuntu SMP Wed Jul 27 16:06:39 UTC 2016
The pi:
Linux version 4.4.11-v7+ (dc4#dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #888 SMP Mon May 23 20:10:33 BST 2016
EDIT AGAIN: --
Tested on a different machine with the same USB key I used to install. Slightly different /proc/version:
Linux version 4.4.0-31-generic (buildd#lgw01-16) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2.1) ) #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016
Works fine. I'm so confused.
I finally got this to work, thanks to the information found here:
https://superuser.com/questions/865310/file-capabilities-setcap-not-being-applied-in-linux-mint-17-1
It turns out that my home directory is being mounted as nosuid, which disables all capability flags.
When running the program on a filesystem without nosuid, it works as expected.
For future readers: if you encounter this issue, make sure your filesystem is not mounted as nosuid. Using the mount command, check for the filesystem that matches where you're storing the data (in my case /home/user) and see if the nosuid flag is set.
$ mount
...
/home/.ecryptfs/user/.Private on /home/user type ecryptfs (rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=***,ecryptfs_sig=***,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs)
(It's an ecryptfs system, so if you selected "Encrypt my home directory" on the Ubuntu install you'll probably have this problem. I couldn't figure out a way to mount this as suid, and probably wouldn't want to anyway.)
I ended up making a new directory /code (it's my filesystem, I can do what I want) which is mounted on a different partition without nosuid.
It would be nice if the man pages for capabilities referenced this fact... (edit: patch submitted, it does now :) )
Just a data point: your code works here on an older LTS machine:
$ uname -vr
3.13.0-63-generic #103-Ubuntu SMP Fri Aug 14 21:42:59 UTC 2015
$ ./tt test-client
Process capabilities: = cap_fowner,cap_net_raw,cap_setfcap+ep
Capabilities to set in file: = cap_net_raw+ep
$ cat /etc/debian_version
jessie/sid
Maybe perhaps it might have something to do with the capabilities of the user's process (invoking ./tt)? As it says in capabilities(7), Capabilities are a
per-thread attribute.

[01000][unixODBC][Driver Manager]Can't open lib '/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so' : file not found

I am trying to acces oracle from linux server. I am using unixODBC.
When i try to acces oracle using isql and i get error that driver manager can't open libsqora.so.12.1.
odbc.ini
[NAME]
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
BindAsFLOAT = F
CloseCursor = F
DisableDPM = F
DisableMTS = T
Driver = Oracle 11g ODBC driver
DSN = DSN_NAME
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MaxLargeData = 0
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
ServerName = ServerName
SQLGetData extensions = F
Translation DLL =
Translation Option = 0
DisableRULEHint = T
UserID = xxxx
Password=<password>
StatementCache=F
CacheBufferSize=20
UseOCIDescribeAny=F
odbcinst.ini
[Oracle 11g ODBC driver]
Description=Oracle ODBC driver for Oracle 11g
Driver=/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so
FileUsage=1
Then, when i use isql to acces oracle i get the following error:
[root#xxxxx lib]# isql -v NAME
[01000][unixODBC][Driver Manager]Can't open lib '/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so' : file not found
[ISQL]ERROR: Could not SQLConnect
I had typo in odbcinst.ini. I have corrected but still same error.
[root#xxxxx tmp]# isql -v NAME
[01000][unixODBC][Driver Manager]Can't open lib '/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1' : file not found
[ISQL]ERROR: Could not SQLConnect
[root#xxxxx tmp]# ls -l /usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1
-rw-r--r-- 1 bin bin 996363 Sep 5 2010 /usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1
[Oracle 11g ODBC driver]
Description=Oracle ODBC driver for Oracle 11g
Driver=/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1
FileUsage=1
ENV
[root#xxxxx tmp]# env
HOSTNAME=xxxxx
SSH2_TTY=/dev/pts/0
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
ODBC_DIR=/usr/local/easysoft/unixODBC
OLDPWD=/usr/local/easysoft
SSH_SESSION_ID=1424
SSH_TTY=/dev/pts/0
LD_LIBRARY_PATH=/usr/local/easysoft/lib:/usr/local/easysoft/unixODBC/lib
A__z="*SHLVL
TNS_ADMIN=/usr/local/easysoft/oracle/InstantClient112/network/
INPUTRC=/etc/inputrc
PWD=/tmp
LANG=en_US.UTF-8
ODBCSYSINI=/etc/
HOME=/root
SHLVL=3
ODBCINI=/etc
LESSOPEN=|/usr/bin/lesspipe.sh %s
ORACLE_HOME=/usr/local/easysoft/oracle/InstantClient112/
G_BROKEN_FILENAMES=1
_=/bin/env
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/easysoft/unixODBC/bin:/opt/oraClient/11.2.0.4/bin
Fixed original issue with LD_LIBRARY_PATH updates but now it is broken again since I am trying to use the 32bit Oracle client.
Installed 32bit oracle client in directory /opt/oraClient/11.2.0.4_32/.
Modified the odbcinst.ini:
[Oracle 11g ODBC driver]
Description=Oracle ODBC driver for Oracle 11g
#Driver=/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1
Driver=/opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1
FileUsage=1
Error:
[root#xxxxx lib]# /usr/local/bin/isql -v NAME
[01000][unixODBC] [Driver Manager]Can't open lib '/opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1' : file not found
[ISQL]ERROR: Could not SQLConnect
If I need to use the 32bit Oracle client, what am i doing wrong...I know it is something in environmental variables.
[root#xxxxx lib]# file /opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1
/opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped
I enable trace but am not able to attach document here. I can email.
More debug info:
[root#xxxxx bin]# ldd /opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1
ldd: warning: you do not have execution permission for `/opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1'
linux-gate.so.1 => (0xffffe000)
libdl.so.2 => /lib/libdl.so.2 (0xf7f2b000)
libm.so.6 => /lib/libm.so.6 (0xf7f02000)
libpthread.so.0 => /lib/libpthread.so.0 (0xf7ee8000)
libnsl.so.1 => /lib/libnsl.so.1 (0xf7ecf000)
libclntsh.so.11.1 => not found
libodbcinst.so.1 => not found
libc.so.6 => /lib/libc.so.6 (0xf7d71000)
/lib/ld-linux.so.2 (0x00134000)
I don't get one the "not found" which may be causing some problems:
[root#xxxxx bin]# ls /opt/oraClient/11.2.0.4_32/lib/libclntsh.so.11.1
/opt/oraClient/11.2.0.4_32/lib/libclntsh.so.11.1
Below is the most recent env output:
[root#xxxxx]# env
HOSTNAME=xxxxx
SSH2_TTY=/dev/pts/0
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
ODBC_DIR=/usr/local/easysoft/unixODBC
SSH_TTY=/dev/pts/0
LD_LIBRARY_PATH=/opt/oraClient/11.2.0.4_32/:/opt/oraClient/11.2.0.4_32/lib/:/usr/local/easysoft/oracle/InstantClient112:/usr/local/easysoft/oracle/InstantClient112/lib/
TNS_ADMIN=/opt/oraClient/11.2.0.4_32/network/
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/easysoft/unixODBC/bin:/opt/oraClient/11.2.0.4_32/bin
INPUTRC=/etc/inputrc
LANG=en_US.UTF-8
ODBCSYSINI=/etc/
SHLVL=4
HOME=/root
ODBCINI=/etc
ORACLE_HOME=/opt/oraClient/11.2.0.4_32/
G_BROKEN_FILENAMES=1
_=/bin/env
This error is misleading:
The file that the error claimed was not present did exist.
I was able to chase down the actual missing file by executing:
# ldd /path/to/your/socalled/missing/file.so
This returned a series of files and one said:
libodbcinst.so.2 => not found
That is was the culprit for me. I then created the link that I needed and voila, the error went away.
ref: http://mailman.unixodbc.org/pipermail/unixodbc-support/2011-November/003018.html
Instant client doesn't have a lib directory. If you've downloaded the instantclient-odbc-linux package and unzipped that in the same location as the basic package then the libsqora.so.11.1 file will be durectly under /usr/local/easysoft/oracle/InstantClient112.
So your .ini should point to:
Driver=/usr/local/easysoft/oracle/InstantClient112/libsqora.so.11.1
Note the extension though; you might want to soft-link that to libsqora.so. If you've moved the .so files into a subdirectory after unzipping (?) then you'd need:
Driver=/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1
It looks like you've reoriganised the instant client files after unzipping, creating a lib directory. I'm not sure if that will directly cause you problems. But you also haven't set LD_LIBRARY_PATH, as the installation instructions suggest:
Installation Steps:
Download the appropriate Instant Client packages for your platform. All installations REQUIRE the Basic package.
Unzip the packages into a single directory such as "instantclient".
Set the library loading path in your environment to the directory in Step 2 ("instantclient"). On many UNIX platforms, LD_LIBRARY_PATH
is the appropriate environment variable. On Windows, PATH should be
used.
Start your application and enjoy.
Clearly step (4) isn't working for you yet, but I think that's because you haven't done step (3); and I think as you've split the files - which might itself cause an issue - you may need to include both .../InstantClient112 and .../InstantClient112/lib in the LD_LIBRARY_PATH variable. And make sure the modified value is exported. I'm not sure why you'd want to rearrange the files though.
sudo apt-get install libaio1 libaio-dev

Resources