[Mono-aspnet-list] FW: RE: [unixODBC-support] trouble with mysql driver on mono

James Smith james.smith at aleph-one.com
Sun May 9 14:26:04 EDT 2010


Good evening,

 

I'm forwarding the email below to this list as I think it confirms that my
ASP.NET web application is having difficulty connecting to MySQL via sockets
on Ubuntu.

 

Any help would be appreciated!

 

Kind regards,

 

James

 

  _____  

From: James Smith [mailto:james.smith at aleph-one.com] 
Sent: 09 May 2010 19:23
To: 'Support for the unixODBC project'
Subject: RE: [unixODBC-support] trouble with mysql driver on mono

 

Good evening Nick,

 

I posted this as an HTML email to make it easier to read, I hope this is
okay.

 

I realised (after reading the documentation on strace, funny that) that I
could attach it to an existing process and therefore I was able to get some
useful information straight away:

 

[pid  3060] 18:06:49.145934
stat("/var/www_public/shop/config/global.config", {st_mode=S_IFREG|0644,
st_size=732, ...}) = 0

[pid  3060] 18:06:49.146136
lstat("/var/www_public/shop/config/global.config", {st_mode=S_IFREG|0644,
st_size=732, ...}) = 0

[pid  3060] 18:06:49.146335 stat("/var/www_public/shop/config",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

[pid  3060] 18:06:49.146482 lstat("/var/www_public/shop/config",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

[pid  3060] 18:06:49.146630
stat("/var/www_public/shop/config/global.config", {st_mode=S_IFREG|0644,
st_size=732, ...}) = 0

[pid  3060] 18:06:49.147061
lstat("/var/www_public/shop/config/global.config", {st_mode=S_IFREG|0644,
st_size=732, ...}) = 0

[pid  3060] 18:06:49.147295
stat("/var/www_public/shop/config/global.config", {st_mode=S_IFREG|0644,
st_size=732, ...}) = 0

[pid  3060] 18:06:49.148059
lstat("/var/www_public/shop/config/global.config", {st_mode=S_IFREG|0644,
st_size=732, ...}) = 0

[pid  3060] 18:06:49.148272
open("/var/www_public/shop/config/global.config", O_RDONLY) = 9

[pid  3060] 18:06:49.148388 fstat(9, {st_mode=S_IFREG|0644, st_size=732,
...}) = 0

[pid  3060] 18:06:49.148521 time(NULL)  = 1273428409

[pid  3060] 18:06:49.148676 semop(491528, 0x7fa1ed4e9920, 1) = 0

[pid  3060] 18:06:49.148775 semop(491528, 0x7fa1ed4e9920, 1) = 0

[pid  3060] 18:06:49.148863 semop(491528, 0x7fa1ed4e9920, 1) = 0

[pid  3060] 18:06:49.148950 semop(491528, 0x7fa1ed4e9920, 1) = 0

[pid  3060] 18:06:49.149037 semop(491528, 0x7fa1ed4e9970, 1) = 0

[pid  3060] 18:06:49.149124 semop(491528, 0x7fa1ed4e9970, 1) = 0

[pid  3060] 18:06:49.149211 fstat(9, {st_mode=S_IFREG|0644, st_size=732,
...}) = 0

[pid  3060] 18:06:49.149407 read(9,
"\r\n#LOCAL\r\n#appPath=/jms.shop/\r\n#"..., 4096) = 732

[pid  3060] 18:06:49.149671 read(9, "", 4096) = 0

[pid  3060] 18:06:49.149769 semop(491528, 0x7fa1ed4e9890, 1) = 0

[pid  3060] 18:06:49.149863 semop(491528, 0x7fa1ed4e9890, 1) = 0

[pid  3060] 18:06:49.149947 close(9)    = 0

[pid  3060] 18:06:49.150111
stat("/var/www_public/shop/config/errors.config", {st_mode=S_IFREG|0644,
st_size=1059, ...}) = 0

[pid  3060] 18:06:49.150280
lstat("/var/www_public/shop/config/errors.config", {st_mode=S_IFREG|0644,
st_size=1059, ...}) = 0

[pid  3060] 18:06:49.150447 stat("/var/www_public/shop/config",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

[pid  3060] 18:06:49.150594 lstat("/var/www_public/shop/config",
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

[pid  3060] 18:06:49.151011
stat("/var/www_public/shop/config/errors.config", {st_mode=S_IFREG|0644,
st_size=1059, ...}) = 0

[pid  3060] 18:06:49.151165
lstat("/var/www_public/shop/config/errors.config", {st_mode=S_IFREG|0644,
st_size=1059, ...}) = 0

[pid  3060] 18:06:49.151319
stat("/var/www_public/shop/config/errors.config", {st_mode=S_IFREG|0644,
st_size=1059, ...}) = 0

[pid  3060] 18:06:49.151974
lstat("/var/www_public/shop/config/errors.config", {st_mode=S_IFREG|0644,
st_size=1059, ...}) = 0

[pid  3060] 18:06:49.152258
open("/var/www_public/shop/config/errors.config", O_RDONLY) = 9

[pid  3060] 18:06:49.152392 fstat(9, {st_mode=S_IFREG|0644, st_size=1059,
...}) = 0

[pid  3060] 18:06:49.152521 time(NULL)  = 1273428409

[pid  3060] 18:06:49.152608 semop(491528, 0x7fa1ed4e9940, 1) = 0

[pid  3060] 18:06:49.152699 semop(491528, 0x7fa1ed4e9940, 1) = 0

[pid  3060] 18:06:49.152785 semop(491528, 0x7fa1ed4e9940, 1) = 0

[pid  3060] 18:06:49.152870 semop(491528, 0x7fa1ed4e9940, 1) = 0

[pid  3060] 18:06:49.152955 semop(491528, 0x7fa1ed4e9990, 1) = 0

[pid  3060] 18:06:49.153041 semop(491528, 0x7fa1ed4e9990, 1) = 0

[pid  3060] 18:06:49.153127 fstat(9, {st_mode=S_IFREG|0644, st_size=1059,
...}) = 0

[pid  3060] 18:06:49.153296 read(9, "BasketAddFormNoQuantity=You must"...,
4096) = 1059

[pid  3060] 18:06:49.153601 read(9, "", 4096) = 0

[pid  3060] 18:06:49.153694 semop(491528, 0x7fa1ed4e98b0, 1) = 0

[pid  3060] 18:06:49.153784 semop(491528, 0x7fa1ed4e98b0, 1) = 0

[pid  3060] 18:06:49.153860 close(9)    = 0

[pid  3060] 18:06:49.154036 clone(Process 3061 attached

child_stack=0x7fa1e6d651d0,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
parent_tidptr=0x7fa1e6d659e0, tls=0x7fa1e6d65910,
child_tidptr=0x7fa1e6d659e0) = 3061

[pid  3060] 18:06:49.154238 time( <unfinished ...>

[pid  3061] 18:06:49.154284 set_robust_list(0x7fa1e6d659f0, 0x18 <unfinished
...>

[pid  3060] 18:06:49.154311 <... time resumed> NULL) = 1273428409

[pid  3061] 18:06:49.154361 <... set_robust_list resumed> ) = 0

[pid  3060] 18:06:49.154393 getuid( <unfinished ...>

[pid  3061] 18:06:49.154460 _exit(0)    = ?

Process 3061 detached

[pid  3060] 18:06:49.154494 <... getuid resumed> ) = 33

[pid  3060] 18:06:49.154563 open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 9

[pid  3060] 18:06:49.154973 lseek(9, 0, SEEK_CUR) = 0

[pid  3060] 18:06:49.155080 fstat(9, {st_mode=S_IFREG|0644, st_size=960,
...}) = 0

[pid  3060] 18:06:49.155217 mmap(NULL, 960, PROT_READ, MAP_SHARED, 9, 0) =
0x7fa1f04f1000

[pid  3060] 18:06:49.155313 lseek(9, 960, SEEK_SET) = 960

[pid  3060] 18:06:49.156173 munmap(0x7fa1f04f1000, 960) = 0

[pid  3060] 18:06:49.156349 close(9)    = 0

[pid  3060] 18:06:49.156467 open("/var/www/.odbc.ini",
O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EACCES (Permission denied)

[pid  3060] 18:06:49.156605 open("/etc/odbc.ini", O_RDONLY) = 9

[pid  3060] 18:06:49.156703 close(9)    = 0

[pid  3060] 18:06:49.156800 open("/etc/odbc.ini", O_RDONLY) = 9

[pid  3060] 18:06:49.156898 fstat(9, {st_mode=S_IFREG|0644, st_size=465,
...}) = 0

[pid  3060] 18:06:49.157042 mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa1f04f1000

[pid  3060] 18:06:49.157168 read(9, "\n[MySQL]\nDescription         = M"...,
4096) = 465

[pid  3060] 18:06:49.157371 read(9, "", 4096) = 0

[pid  3060] 18:06:49.157480 close(9)    = 0

[pid  3060] 18:06:49.157587 munmap(0x7fa1f04f1000, 4096) = 0

[pid  3060] 18:06:49.157734 socket(PF_FILE, SOCK_STREAM, 0) = 9

[pid  3060] 18:06:49.157873 fcntl(9, F_SETFL, O_RDONLY) = 0

[pid  3060] 18:06:49.157982 fcntl(9, F_GETFL) = 0x2 (flags O_RDWR)

[pid  3060] 18:06:49.158096 connect(9, {sa_family=AF_FILE,
path="/var/run/mysqld/mysqld.sock"}, 110) = 0

[pid  3060] 18:06:49.158292 setsockopt(9, SOL_SOCKET, SO_RCVTIMEO,
"\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0

[pid  3060] 18:06:49.158554 setsockopt(9, SOL_SOCKET, SO_SNDTIMEO,
"\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0

[pid  3060] 18:06:49.158989 setsockopt(9, SOL_IP, IP_TOS, [8], 4) = -1
EOPNOTSUPP (Operation not supported)

[pid  3060] 18:06:49.159139 setsockopt(9, SOL_SOCKET, SO_KEEPALIVE, [1], 4)
= 0

[pid  3060] 18:06:49.159234 read(9,
"?\0\0\0\n5.1.37-1ubuntu5.1\0005\0\0\0s};MO"..., 16384) = 67

[pid  3060] 18:06:49.160189 stat("/usr/share/mysql/charsets/Index.xml",
{st_mode=S_IFREG|0644, st_size=18261, ...}) = 0

[pid  3060] 18:06:49.160500 open("/usr/share/mysql/charsets/Index.xml",
O_RDONLY) = 10

[pid  3060] 18:06:49.160624 read(10, "<?xml version='1.0' encoding=\"ut"...,
18261) = 18261

[pid  3060] 18:06:49.160735 close(10)   = 0

[pid  3060] 18:06:49.163220 geteuid()   = 33

[pid  3060] 18:06:49.163354 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS,
0x7fa1ed4e8980) = -1 ENOTTY (Inappropriate ioctl for device)

[pid  3060] 18:06:49.164153 geteuid()   = 33

[pid  3060] 18:06:49.164327 open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 10

[pid  3060] 18:06:49.164492 lseek(10, 0, SEEK_CUR) = 0

[pid  3060] 18:06:49.164713 fstat(10, {st_mode=S_IFREG|0644, st_size=960,
...}) = 0

[pid  3060] 18:06:49.164902 mmap(NULL, 960, PROT_READ, MAP_SHARED, 10, 0) =
0x7fa1f04f1000

[pid  3060] 18:06:49.165006 lseek(10, 960, SEEK_SET) = 960

[pid  3060] 18:06:49.165126 munmap(0x7fa1f04f1000, 960) = 0

[pid  3060] 18:06:49.165235 close(10)   = 0

[pid  3060] 18:06:49.165351 write(9,
"*\0\0\1\205\242\2@\0\0\0@\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 46)
= 46

[pid  3060] 18:06:49.165542 read(9, "K\0\0\2\377\25\4#28000Access denied for
u"..., 16384) = 79

[pid  3060] 18:06:49.165707 shutdown(9, 2 /* send and receive */) = 0

[pid  3060] 18:06:49.165821 close(9)    = 0

[pid  3060] 18:06:49.166077 gettimeofday({1273428409, 166131}, NULL) = 0

[pid  3060] 18:06:49.166323 gettimeofday({1273428409, 166353}, NULL) = 0

[pid  3060] 18:06:49.166422 gettimeofday({1273428409, 166445}, NULL) = 0

[pid  3060] 18:06:49.166509 gettimeofday({1273428409, 166532}, NULL) = 0

[pid  3060] 18:06:49.166998 gettimeofday({1273428409, 167052}, NULL) = 0

[pid  3060] 18:06:49.167237 gettimeofday({1273428409, 167319}, NULL) = 0

[pid  3060] 18:06:49.168329 gettimeofday({1273428409, 168401}, NULL) = 0

[pid  3060] 18:06:49.168552 stat("/var/www_private/shop/log/09,05,2010.log",
{st_mode=S_IFREG|0600, st_size=495, ...}) = 0

[pid  3060] 18:06:49.168732
lstat("/var/www_private/shop/log/09,05,2010.log", {st_mode=S_IFREG|0600,
st_size=495, ...}) = 0

[pid  3060] 18:06:49.168902 stat("/var/www_private/shop/log",
{st_mode=S_IFDIR|0777, st_size=12288, ...}) = 0

[pid  3060] 18:06:49.169058 lstat("/var/www_private/shop/log",
{st_mode=S_IFDIR|0777, st_size=12288, ...}) = 0

[pid  3060] 18:06:49.169210 stat("/var/www_private/shop/log/09,05,2010.log",
{st_mode=S_IFREG|0600, st_size=495, ...}) = 0

[pid  3060] 18:06:49.169366
lstat("/var/www_private/shop/log/09,05,2010.log", {st_mode=S_IFREG|0600,
st_size=495, ...}) = 0

[pid  3060] 18:06:49.169527 open("/var/www_private/shop/log/09,05,2010.log",
O_WRONLY|O_CREAT, 0666) = 9

[pid  3060] 18:06:49.169643 fstat(9, {st_mode=S_IFREG|0600, st_size=495,
...}) = 0

 

It appears to me that after trying to find the odbc.ini file in the web
application root directory, mono does indeed manage to locate it in the
/etc/ directory:

 

[pid  3060] 18:06:49.156800 open("/etc/odbc.ini", O_RDONLY) = 9

[pid  3060] 18:06:49.156898 fstat(9, {st_mode=S_IFREG|0644, st_size=465,
...}) = 0

[pid  3060] 18:06:49.157042 mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa1f04f1000

[pid  3060] 18:06:49.157168 read(9, "\n[MySQL]\nDescription         = M"...,
4096) = 465

 

The problem is not with the configuration, therefore, but appears to be that
mono cannot open a socket to MySQL:

 

[pid  3060] 18:06:49.158096 connect(9, {sa_family=AF_FILE,
path="/var/run/mysqld/mysqld.sock"}, 110) = 0

[pid  3060] 18:06:49.158292 setsockopt(9, SOL_SOCKET, SO_RCVTIMEO,
"\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0

[pid  3060] 18:06:49.158554 setsockopt(9, SOL_SOCKET, SO_SNDTIMEO,
"\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0", 16) = 0

[pid  3060] 18:06:49.158989 setsockopt(9, SOL_IP, IP_TOS, [8], 4) = -1
EOPNOTSUPP (Operation not supported)

[pid  3060] 18:06:49.159139 setsockopt(9, SOL_SOCKET, SO_KEEPALIVE, [1], 4)
= 0

 

This is my interpretation, anyway. We do know that the connection fails, at
least.

 

Thanks again for your time.

 

Kind regards,

 

James

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20100509/269f32a7/attachment-0001.html 


More information about the Mono-aspnet-list mailing list