Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 410335 - dev-db/unixODBC-2.3.1: Can't open lib '/usr/lib64/libmyodbc5.so' (from dev-db/myodbc)
Summary: dev-db/unixODBC-2.3.1: Can't open lib '/usr/lib64/libmyodbc5.so' (from dev-db...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jesus Rivero (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-31 14:21 UTC by Alexandr Tiurin
Modified: 2012-04-18 12:17 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info dev-db/unixODBC (emi1,14.62 KB, text/plain)
2012-03-31 14:27 UTC, Alexandr Tiurin
Details
strace (strace,44.48 KB, text/plain)
2012-04-18 10:33 UTC, Alexandr Tiurin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Tiurin 2012-03-31 14:21:14 UTC
After update from 2.3.0-r1  to 2.3.1

~> isql 'test' -v  
[01000][unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmyodbc5.so' : file not found
[ISQL]ERROR: Could not SQLConnect

~> ls /usr/lib64/libmyodbc5.so /usr/lib64/libmyodbc5-5.1.6.so
300K -rwxr-xr-x 1 root root 297K Янв  3 19:17 /usr/lib64/libmyodbc5-5.1.6.so
   0 lrwxrwxrwx 1 root root   19 Янв  3 19:17 /usr/lib64/libmyodbc5.so -> libmyodbc5-5.1.6.so


~> cat /etc/unixODBC/odbcinst.ini 
[MySQL]
Description = ODBC for MySQL
Driver      = /usr/lib64/libmyodbc5.so
FileUsage   = 1

[SQLITE]
Description = SQLITE3 ODBC DRIVER
Driver64 = /usr/lib64/libsqlite3odbc.so
Setup64 = /usr/lib64/libsqlite3odbc.so
UsageCount = 1
CPTimeout =
CPReuse = 









Reproducible: Always
Comment 1 Alexandr Tiurin 2012-03-31 14:27:20 UTC
Created attachment 307289 [details]
emerge --info dev-db/unixODBC
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2012-03-31 14:34:12 UTC
(In reply to comment #0)
> After update from 2.3.0-r1  to 2.3.1
> 
> ~> isql 'test' -v  
> [01000][unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmyodbc5.so' :
> file not found
> [ISQL]ERROR: Could not SQLConnect

With your odbcinst.ini below I get:

$ isql 'test' -v
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect

> ~> ls /usr/lib64/libmyodbc5.so /usr/lib64/libmyodbc5-5.1.6.so
> 300K -rwxr-xr-x 1 root root 297K Янв  3 19:17 /usr/lib64/libmyodbc5-5.1.6.so
>    0 lrwxrwxrwx 1 root root   19 Янв  3 19:17 /usr/lib64/libmyodbc5.so ->
> libmyodbc5-5.1.6.so
> ~> cat /etc/unixODBC/odbcinst.ini 
> [MySQL]
> Description = ODBC for MySQL
> Driver      = /usr/lib64/libmyodbc5.so
> FileUsage   = 1

This type of whitespacing is known to kill unixODBC configs. Remove the extra whitespacing before equal signs.

And please provide better information on howto reproduce the failure.
Comment 3 Alexandr Tiurin 2012-03-31 15:05:06 UTC
> This type of whitespacing is known to kill unixODBC configs. Remove the extra whitespacing before equal signs.

Ok, but not helped me.

~# od -c /etc/unixODBC/odbcinst.ini
0000000   [   M   y   S   Q   L   ]  \n   D   e   s   c   r   i   p   t
0000020   i   o   n   =   "   O   D   B   C       f   o   r       M   y
0000040   S   Q   L   "  \n   D   r   i   v   e   r   =   /   u   s   r
0000060   /   l   i   b   6   4   /   l   i   b   m   y   o   d   b   c
0000100   5   .   s   o  \n   F   i   l   e   U   s   a   g   e   =   1
0000120  \n  \n   [   S   Q   L   I   T   E   ]  \n   D   e   s   c   r
0000140   i   p   t   i   o   n   =   "   S   Q   L   I   T   E   3    
0000160   O   D   B   C       D   R   I   V   E   R   "  \n   D   r   i
0000200   v   e   r   6   4   =   /   u   s   r   /   l   i   b   6   4
0000220   /   l   i   b   s   q   l   i   t   e   3   o   d   b   c   .
0000240   s   o  \n   S   e   t   u   p   6   4   =   /   u   s   r   /
0000260   l   i   b   6   4   /   l   i   b   s   q   l   i   t   e   3
0000300   o   d   b   c   .   s   o  \n   U   s   a   g   e   C   o   u
0000320   n   t   =   1  \n   C   P   T   i   m   e   o   u   t   =  \n
0000340   C   P   R   e   u   s   e   =  \n
0000351


> And please provide better information on howto reproduce the failure.

Oh, sorry, "test" is a name of my configuration in ~/.odbc.ini 

[test]
Description="MySQL database test"
Driver=MySQL
Server=localhost
Database=Syslog
Port=3306
UserName=slUser
Comment 4 Jesus Rivero (RETIRED) gentoo-dev 2012-04-16 19:24:20 UTC
I can't reproduce this either in x86 nor amd64. 

How did you create the odbcinst.ini entry? did you run 

emerge --config =dev-db/myodbc-5.1.6

as suggested by the ebuild?

Could you attach an strace log to see if we could figure out whats happening?

Closing as NEEDINFO. Please reopen when you have the strace log. 

Thanks for the report
Comment 5 Alexandr Tiurin 2012-04-18 10:31:45 UTC
A long time ago I created the odbcinst.ini by hands. And now I deleted all /etc/unixUDBC/* and ran 
emerge --config =dev-db/myodbc-5.1.6.

As result 

# cat /etc/unixODBC/odbc.ini 
[ODBC Data Sources]
myodbc-5.1-test=MySQL ODBC myodbc-5.1.6 Driver Testing DSN

[myodbc-5.1-test]
Description=MySQL ODBC myodbc-5.1.6 Driver Testing DSN
Driver=myodbc-5.1
Socket=/var/run/mysqld/mysqld.sock
Server=localhost
User=root
Database=test
Option=3

and

# cat /etc/unixODBC/odbcinst.ini 
[myodbc-5.1]
Description=MySQL ODBC myodbc-5.1.6 Driver
Driver=/usr/lib/libmyodbc5.so
UsageCount=1


Then

~ % isql 'myodbc-5.1-test' -v
[01000][unixODBC][Driver Manager]Can't open lib '/usr/lib/libmyodbc5.so' : file not found
[ISQL]ERROR: Could not SQLConnect
Comment 6 Alexandr Tiurin 2012-04-18 10:33:29 UTC
Created attachment 309405 [details]
strace
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2012-04-18 11:38:50 UTC
(In reply to comment #6)
> Created attachment 309405 [details]
> strace

I'm not sure if this has any relavence but the strace is showing lines like:

open("/path/to/libodbcinst.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)

But the file installed by unixODBC is /usr/lib64/libodbcinst.so.2 with 2 instead of 1.

The unixODBC bump from 2.3.0 to 2.3.1 raised .so versioning by one (and it's allowed to do so).

Question is, where is this .so.1 hardcoded at? Why it isn't looking for .so.2?
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2012-04-18 11:51:23 UTC
You have recompiled myodbc after upgrading unixODBC, right? 
Try that first. 
If it doesn't work, then try to compile myodbc like:

EXTRA_ECONF="--enable-odbcinstlink" emerge -1 myodbc

(Just following a hunch.)
Comment 9 Alexandr Tiurin 2012-04-18 12:10:38 UTC
I'm not remember about recompile, but now after 
emerge -1 myodbc
the problem is solved.
Many thanks!
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2012-04-18 12:17:31 UTC
None of this unixODBC/myodbc/etc. 'foo' is linked, but called by dlopen() instead, so 'revdep-rebuild' won't catch these.

Changed to resolution to WORKSFORME (since nothing was really broken, but working as designed.)