pyodbc icon indicating copy to clipboard operation
pyodbc copied to clipboard

pyodbc.Error: ('IM004', "[IM004] [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed (0) (SQLDriverConnect)")

Open PoojaG20 opened this issue 5 years ago • 37 comments
trafficstars

Please first make sure you have looked at:

  • Documentation: https://github.com/mkleehammer/pyodbc/wiki
  • Other issues

Environment

To diagnose, we usually need to know the following, including version numbers. On Windows, be sure to specify 32-bit Python or 64-bit:

  • Python: 3.5.2
  • pyodbc: Installed via - conda install -c anaconda pyodbc -y
  • OS: Ubuntu 16.04
  • DB: MSSQL
  • driver: ODBC Driver 17 for SQL Server

Issue

I have to us it inside a docker container . That container fetches packages from Alpine -miniconda3 image. Pyodbc got installed. Drivers are getting populated but i am getting error - pyodbc.Error: ('IM004', "[IM004] [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed (0) (SQLDriverConnect)") when I try to connect. please help on it.

PoojaG20 avatar Apr 09 '20 11:04 PoojaG20

This is usually caused by missing .rll file. By default it's located in /opt/microsoft/msodbcsql17/share/resources/en_US/msodbcsqlr17.rll. It can also be placed in a relative directory to the driver .so in ../share/resources/en_US/msodbcsqlr17.rll

v-makouz avatar Apr 09 '20 14:04 v-makouz

Hi @v-makouz , thanks for the reply . When I checked my container's directory I can see this .rll file in the path you have mentioned. If its there it has to be accessed by default right or should it be placed somewhere else to be used by container ? Please let me know I am not much aware of it.

PoojaG20 avatar Apr 09 '20 17:04 PoojaG20

If the .rll is in the correct spot then there are a few things to try to isolate the problem, first try running connecting without python: isql -v -k "DRIVER={ODBC Driver 17 for SQL Server};SERVER=<SQL Server>;UID=<username>;PWD=<password>"

if this also fails, try stracing it: strace isql -v -k "DRIVER={ODBC Driver 17 for SQL Server};SERVER=<SQL Server>;UID=<username>;PWD=<password>" The output there may contain clues as to what's the problem

v-makouz avatar Apr 09 '20 17:04 v-makouz

ok @v-makouz I will try "strace" to debug what is the issue as on running isql also i got same issue

PoojaG20 avatar Apr 14 '20 12:04 PoojaG20

@v-makouz On using strace i am getting following logs - execve("/opt/conda/bin/isql", ["isql", "-v", "-k", "DRIVER={ODBC Driver 17 for SQL S"...], 0x7ffd36742538 /* 18 vars */) = 0 brk(NULL)                               = 0x56324e7f4000 readlink("/proc/self/exe", "/opt/conda/bin/isql", 4096) = 19 access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/tls/haswell/x86_64/libodbc.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/tls/haswell/x86_64", 0x7ffeca17ee90) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/tls/haswell/libodbc.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/tls/haswell", 0x7ffeca17ee90) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/tls/x86_64/libodbc.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/tls/x86_64", 0x7ffeca17ee90) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/tls/libodbc.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/tls", 0x7ffeca17ee90) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/haswell/x86_64/libodbc.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/haswell/x86_64", 0x7ffeca17ee90) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/haswell/libodbc.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/haswell", 0x7ffeca17ee90) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/x86_64/libodbc.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/x86_64", 0x7ffeca17ee90) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/libodbc.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300p\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0775, st_size=508888, ...}) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbe555f0000 mmap(NULL, 2577240, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe5537a000 mprotect(0x7fbe553e4000, 2097152, PROT_NONE) = 0 mmap(0x7fbe555e4000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6a000) = 0x7fbe555e4000 mmap(0x7fbe555ec000, 13144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe555ec000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/libedit.so.0", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\240\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0775, st_size=260144, ...}) = 0 mmap(NULL, 244832, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe5533e000 mprotect(0x7fbe55348000, 180224, PROT_NONE) = 0 mmap(0x7fbe55348000, 118784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa000) = 0x7fbe55348000 mmap(0x7fbe55365000, 57344, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x27000) = 0x7fbe55365000 mmap(0x7fbe55374000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x35000) = 0x7fbe55374000 mmap(0x7fbe55377000, 11360, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe55377000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/tls/haswell/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/src_libs/oracle/instantclient/tls/haswell/x86_64", 0x7ffeca17ee50) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/tls/haswell/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/src_libs/oracle/instantclient/tls/haswell", 0x7ffeca17ee50) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/src_libs/oracle/instantclient/tls/x86_64", 0x7ffeca17ee50) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/src_libs/oracle/instantclient/tls", 0x7ffeca17ee50) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/haswell/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/src_libs/oracle/instantclient/haswell/x86_64", 0x7ffeca17ee50) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/haswell/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/src_libs/oracle/instantclient/haswell", 0x7ffeca17ee50) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/src_libs/oracle/instantclient/x86_64", 0x7ffeca17ee50) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/src_libs/oracle/instantclient", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 openat(AT_FDCWD, "/usr/glibc-compat/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=4704, ...}) = 0 mmap(NULL, 4704, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbe5533c000 close(3)                                = 0 openat(AT_FDCWD, "/usr/glibc-compat/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000|\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=118168, ...}) = 0 mmap(NULL, 136312, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe5531a000 mmap(0x7fbe55321000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7fbe55321000 mmap(0x7fbe55331000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7fbe55331000 mmap(0x7fbe55336000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7fbe55336000 mmap(0x7fbe55338000, 13432, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe55338000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320m\2\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1839768, ...}) = 0 mmap(NULL, 1852632, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe55155000 mprotect(0x7fbe5517a000, 1662976, PROT_NONE) = 0 mmap(0x7fbe5517a000, 1355776, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7fbe5517a000 mmap(0x7fbe552c5000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x170000) = 0x7fbe552c5000 mmap(0x7fbe55310000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7fbe55310000 mmap(0x7fbe55316000, 13528, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe55316000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/./tls/haswell/x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/./tls/haswell/x86_64", 0x7ffeca17ee10) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/./tls/haswell/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/./tls/haswell", 0x7ffeca17ee10) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/./tls/x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/./tls/x86_64", 0x7ffeca17ee10) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/./tls/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/./tls", 0x7ffeca17ee10) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/./haswell/x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/./haswell/x86_64", 0x7ffeca17ee10) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/./haswell/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/./haswell", 0x7ffeca17ee10) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/./x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/./x86_64", 0x7ffeca17ee10) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/./libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/opt/conda/bin/../lib/.", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\21\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=14576, ...}) = 0 mmap(NULL, 16656, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe55150000 mmap(0x7fbe55151000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7fbe55151000 mmap(0x7fbe55152000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fbe55152000 mmap(0x7fbe55153000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fbe55153000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/./libtinfow.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\0\1\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0775, st_size=275448, ...}) = 0 mmap(NULL, 256952, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe55111000 mmap(0x7fbe55121000, 102400, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7fbe55121000 mmap(0x7fbe5513a000, 69632, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x29000) = 0x7fbe5513a000 mmap(0x7fbe5514b000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x39000) = 0x7fbe5514b000 close(3)                                = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbe5510f000 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbe5510d000 arch_prctl(ARCH_SET_FS, 0x7fbe55110640) = 0 mprotect(0x7fbe55310000, 12288, PROT_READ) = 0 mprotect(0x7fbe5514b000, 16384, PROT_READ) = 0 mprotect(0x7fbe55153000, 4096, PROT_READ) = 0 mprotect(0x7fbe55336000, 4096, PROT_READ) = 0 mprotect(0x7fbe55374000, 8192, PROT_READ) = 0 mprotect(0x7fbe555e4000, 4096, PROT_READ) = 0 mprotect(0x56324d9ed000, 4096, PROT_READ) = 0 mprotect(0x7fbe5561b000, 4096, PROT_READ) = 0 munmap(0x7fbe5533c000, 4704)            = 0 set_tid_address(0x7fbe55110910)         = 22 set_robust_list(0x7fbe55110920, 24)     = 0 rt_sigaction(SIGRTMIN, {sa_handler=0x7fbe55321680, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7fbe5532e3d0}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {sa_handler=0x7fbe55321720, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fbe5532e3d0}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0 brk(NULL)                               = 0x56324e7f4000 brk(0x56324e815000)                     = 0x56324e815000 ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 stat("/root/.terminfo", 0x56324e7f6d00) = -1 ENOENT (No such file or directory) stat("/opt/conda/share/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat("/etc/termcap", 0x56324e7f6d90)    = -1 ENOENT (No such file or directory) stat("/usr/share/misc/termcap", 0x56324e7f6d90) = -1 ENOENT (No such file or directory) stat("/opt/conda/share/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 access("/opt/conda/share/terminfo/x/xterm", R_OK) = 0 openat(AT_FDCWD, "/opt/conda/share/terminfo/x/xterm", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0664, st_size=3716, ...}) = 0 read(3, "\32\0010\0&\0\17\0\235\1\346\5xterm|xterm terminal"..., 32768) = 3716 read(3, "", 28672)                      = 0 close(3)                                = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TIOCGWINSZ, {ws_row=21, ws_col=155, ws_xpixel=0, ws_ypixel=0}) = 0 ioctl(0, TIOCGWINSZ, {ws_row=21, ws_col=155, ws_xpixel=0, ws_ypixel=0}) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0 rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM CONT TSTP WINCH], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0 openat(AT_FDCWD, "/root/.isql_history", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=142512, ...}) = 0 mmap(NULL, 142512, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbe550ea000 close(3)                                = 0 openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 brk(0x56324e836000)                     = 0x56324e836000 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) brk(0x56324e834000)                     = 0x56324e834000 brk(0x56324e833000)                     = 0x56324e833000 openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/lib/gconv/gconv-modules", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) futex(0x7fbe55315634, FUTEX_WAKE_PRIVATE, 2147483647) = 0 futex(0x7fbe551540c8, FUTEX_WAKE_PRIVATE, 2147483647) = 0 openat(AT_FDCWD, "/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.5.so.2.1", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\262\1\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=2166168, ...}) = 0 mmap(NULL, 2249552, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe54ec4000 mprotect(0x7fbe54ede000, 2007040, PROT_NONE) = 0 mmap(0x7fbe54ede000, 1544192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a000) = 0x7fbe54ede000 mmap(0x7fbe55057000, 458752, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x193000) = 0x7fbe55057000 mmap(0x7fbe550c8000, 57344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x203000) = 0x7fbe550c8000 mmap(0x7fbe550d6000, 78672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe550d6000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/libodbcinst.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240*\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0775, st_size=118176, ...}) = 0 mmap(NULL, 2204056, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe54ca9000 mprotect(0x7fbe54cc0000, 2093056, PROT_NONE) = 0 mmap(0x7fbe54ebf000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7fbe54ebf000 mmap(0x7fbe54ec1000, 8600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe54ec1000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/libkrb5.so.3", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@P\2\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0664, st_size=1064656, ...}) = 0 mmap(NULL, 877584, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe54bd2000 mprotect(0x7fbe54bf7000, 663552, PROT_NONE) = 0 mmap(0x7fbe54bf7000, 364544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7fbe54bf7000 mmap(0x7fbe54c50000, 294912, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7e000) = 0x7fbe54c50000 mmap(0x7fbe54c99000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc6000) = 0x7fbe54c99000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/libgssapi_krb5.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\320\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0664, st_size=370600, ...}) = 0 mmap(NULL, 322224, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe54b83000 mprotect(0x7fbe54b90000, 258048, PROT_NONE) = 0 mmap(0x7fbe54b90000, 204800, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd000) = 0x7fbe54b90000 mmap(0x7fbe54bc2000, 49152, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3f000) = 0x7fbe54bc2000 mmap(0x7fbe54bcf000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4b000) = 0x7fbe54bcf000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\215\n\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0775, st_size=13172960, ...}) = 0 mmap(NULL, 1523040, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe54a0f000 mmap(0x7fbe54ab1000, 520192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa2000) = 0x7fbe54ab1000 mmap(0x7fbe54b30000, 266240, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x121000) = 0x7fbe54b30000 mmap(0x7fbe54b71000, 61440, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x161000) = 0x7fbe54b71000 mmap(0x7fbe54b80000, 11616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe54b80000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3302\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0664, st_size=818984, ...}) = 0 mmap(NULL, 78856, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe549fb000 mmap(0x7fbe549fe000, 49152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fbe549fe000 mmap(0x7fbe54a0a000, 12288, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7fbe54a0a000 mmap(0x7fbe54a0d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11000) = 0x7fbe54a0d000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/x86_64/libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/x86_64/libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/x86_64/libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "x86_64/libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=4704, ...}) = 0 mmap(NULL, 4704, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbe5533c000 close(3)                                = 0 openat(AT_FDCWD, "/lib/libc.musl-x86_64.so.1", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\09k\5\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=592432, ...}) = 0 mmap(NULL, 607032, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe54966000 mprotect(0x7fbe5497b000, 503808, PROT_NONE) = 0 mmap(0x7fbe5497b000, 286720, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7fbe5497b000 mmap(0x7fbe549c1000, 212992, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5b000) = 0x7fbe549c1000 mmap(0x7fbe549f6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8f000) = 0x7fbe549f6000 mmap(0x7fbe549f8000, 9016, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe549f8000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/./libk5crypto.so.3", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0664, st_size=137208, ...}) = 0 mmap(NULL, 122896, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe54947000 mprotect(0x7fbe5494d000, 86016, PROT_NONE) = 0 mmap(0x7fbe5494d000, 61440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7fbe5494d000 mmap(0x7fbe5495c000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7fbe5495c000 mmap(0x7fbe54962000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a000) = 0x7fbe54962000 mmap(0x7fbe54965000, 16, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe54965000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/./libcom_err.so.3", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@ \0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0664, st_size=23144, ...}) = 0 mmap(NULL, 20688, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe54941000 mmap(0x7fbe54943000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fbe54943000 mmap(0x7fbe54944000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fbe54944000 mmap(0x7fbe54945000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7fbe54945000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/./libkrb5support.so.0", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@@\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0664, st_size=62728, ...}) = 0 mmap(NULL, 53896, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe54933000 mprotect(0x7fbe54937000, 32768, PROT_NONE) = 0 mmap(0x7fbe54937000, 20480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7fbe54937000 mmap(0x7fbe5493c000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x7fbe5493c000 mmap(0x7fbe5493f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb000) = 0x7fbe5493f000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/./libcrypto.so.1.1", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\300\7\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0775, st_size=3459120, ...}) = 0 mmap(NULL, 3116936, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe5463a000 mmap(0x7fbe546b5000, 1859584, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7b000) = 0x7fbe546b5000 mmap(0x7fbe5487b000, 557056, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x241000) = 0x7fbe5487b000 mmap(0x7fbe54903000, 184320, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2c8000) = 0x7fbe54903000 mmap(0x7fbe54930000, 12168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe54930000 close(3)                                = 0 openat(AT_FDCWD, "/opt/conda/bin/../lib/./libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/x86_64/libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/x86_64/libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/x86_64/libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "x86_64/libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/libresolv.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/lib/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260C\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=84784, ...}) = 0 mmap(NULL, 96896, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe54622000 mprotect(0x7fbe54626000, 65536, PROT_NONE) = 0 mmap(0x7fbe54626000, 49152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7fbe54626000 mmap(0x7fbe54632000, 12288, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10000) = 0x7fbe54632000 mmap(0x7fbe54636000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x7fbe54636000 mmap(0x7fbe54638000, 6784, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbe54638000 close(3)                                = 0 openat(AT_FDCWD, "/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/tls/haswell/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/tls/haswell/x86_64", 0x7ffeca177750) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/tls/haswell/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/tls/haswell", 0x7ffeca177750) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/tls/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/tls/x86_64", 0x7ffeca177750) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/tls/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/tls", 0x7ffeca177750) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/haswell/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/haswell/x86_64", 0x7ffeca177750) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/haswell/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/haswell", 0x7ffeca177750) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/x86_64", 0x7ffeca177750) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) stat("/home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib", 0x7ffeca177750) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/opt/conda/bin/../lib/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/haswell/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "tls/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "haswell/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/src_libs/oracle/instantclient/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\361\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1321304, ...}) = 0 mmap(NULL, 1323264, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fbe544de000 mmap(0x7fbe544ed000, 630784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7fbe544ed000 mmap(0x7fbe54587000, 626688, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa9000) = 0x7fbe54587000 mmap(0x7fbe54620000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x141000) = 0x7fbe54620000 close(3)                                = 0 mprotect(0x7fbe54620000, 4096, PROT_READ) = 0 mprotect(0x7fbe54636000, 4096, PROT_READ) = 0 mprotect(0x7fbe54903000, 176128, PROT_READ) = 0 mprotect(0x7fbe5493f000, 4096, PROT_READ) = 0 mprotect(0x7fbe54945000, 4096, PROT_READ) = 0 mprotect(0x7fbe54962000, 8192, PROT_READ) = 0 mprotect(0x7fbe549f6000, 4096, PROT_READ) = 0 mprotect(0x7fbe54a0d000, 4096, PROT_READ) = 0 mprotect(0x7fbe54b71000, 45056, PROT_READ) = 0 mprotect(0x7fbe54c99000, 57344, PROT_READ) = 0 mprotect(0x7fbe54bcf000, 8192, PROT_READ) = 0 mprotect(0x7fbe54ebf000, 4096, PROT_READ) = 0 mprotect(0x7fbe550c8000, 32768, PROT_READ) = 0 brk(0x56324e861000)                     = 0x56324e861000 munmap(0x7fbe5533c000, 4704)            = 0 openat(AT_FDCWD, "/usr/glibc-compat/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/share/locale/C.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/share/locale/C.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/glibc-compat/share/locale/C/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/odbcinst.ini", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=163, ...}) = 0 read(3, "[ODBC Driver 17 for SQL Server]\n"..., 4096) = 163 read(3, "", 4096)                       = 0 close(3)                                = 0 openat(AT_FDCWD, "/root/.odbcinst.ini", O_RDONLY) = -1 ENOENT (No such file or directory) futex(0x7fbe54b80d9c, FUTEX_WAKE_PRIVATE, 2147483647) = 0 futex(0x7fbe54b80da8, FUTEX_WAKE_PRIVATE, 2147483647) = 0 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}) = 0 write(1, "[IM004][unixODBC][Driver Manager"..., 83[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed ) = 83 write(2, "[ISQL]ERROR: Could not SQLDriver"..., 40[ISQL]ERROR: Could not SQLDriverConnect ) = 40 exit_group(1)                           = ? +++ exited with 1 +++`

Please help on what am i missing.

PoojaG20 avatar Apr 22 '20 09:04 PoojaG20

Could you post the output of which odbcinst and /opt/conda/bin/odbcinst -j ? You may have multiple driver managers which are causing confusion and conflicts.

v-chojas avatar Apr 22 '20 20:04 v-chojas

which odbcinst gave output as - /opt/conda/bin/odbcinst

and for - /opt/conda/bin/odbcinst -j output is as - unixODBC 2.3.7 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini FILE DATA SOURCES..: /etc/ODBCDataSources USER DATA SOURCES..: /root/.odbc.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8

PoojaG20 avatar Apr 23 '20 04:04 PoojaG20

How did you install the ODBC Driver 17 for SQL Server?

v-chojas avatar Apr 23 '20 19:04 v-chojas

I followed the commands for Alpine Linux - https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017 in Dockerfile

PoojaG20 avatar Apr 24 '20 03:04 PoojaG20

You said the OS was Ubuntu but the strace output looks more like Alpine, so that was confusing. What version of Alpine are you using?

v-chojas avatar Apr 24 '20 14:04 v-chojas

Its a docker based containered app, the image for container is - frolvlad/alpine-miniconda3

PoojaG20 avatar Apr 24 '20 17:04 PoojaG20

Could you attach an ODBC trace? https://www.simba.com/blog/odbc-troubleshooting-tracing/

v-makouz avatar Apr 28 '20 15:04 v-makouz

I'm running into this same issue. Inside a container. The container works fine on my local Ubuntu 20.04 laptop, but not on a Ubuntu 18.04 VM.

The issue might however be a firewall that does not allow the VM to connect to the SQL Server. I will be investigating this theory next.

jpmeijers avatar Jul 21 '20 15:07 jpmeijers

Firewall won't cause this error - it is happening far before the driver even tries to connect to the server.

v-chojas avatar Jul 21 '20 16:07 v-chojas

Yes correct, adding a firewall exception did not help.

This issue is the same as https://github.com/mkleehammer/pyodbc/issues/775

Anyone have an idea how we can debug this further, and why this would be different for the same container on two different hosts?

jpmeijers avatar Jul 22 '20 06:07 jpmeijers

This workaround was successful: https://stackoverflow.com/a/55915387/5343140

It seems like the user as which the container is running exists on my local Ubuntu 20.04 laptop, but not on the Ubuntu 18.04 VM. Adding the $uid of the user to the passwd file when the container starts up solves the issue.

Can this possibly be fixed in a more elegant manner in pyodbc?

jpmeijers avatar Jul 22 '20 07:07 jpmeijers

Attached the working Dockerfile and entrypoint.sh Dockerfile.txt entrypoint.sh.txt

jpmeijers avatar Jul 22 '20 07:07 jpmeijers

Good to see that you figured it out --- it was a permissions/environment issue after all, and thus isn't directly a pyodbc one. Running as a "nonexistent" user can definitely cause things to not work!

v-chojas avatar Jul 22 '20 14:07 v-chojas

I disagree with you. When you are inside a docker container the chance is good that the host OS does not have the same user as what the container is running as. pyodbc clearly does something non-standard here which causes the process to quit.

jpmeijers avatar Jul 22 '20 14:07 jpmeijers

This has nothing to do with pyodbc --- any ODBC application would behave the same. The host is not relevant either, because the issue is that the environment inside the container is incorrect; there should always be a mapping from UIDs to user accounts.

v-chojas avatar Jul 22 '20 15:07 v-chojas

Seems related but let me know if I should create a new issue.

@PoojaG20 did you ever find a solution for frolvlad/alpine-miniconda3? I have a similar issue using the image. I can connect using isql -v <db_name> but when I try to use pyodbc:

import pyodbc

cnxn = pyodbc.connect('DSN=<db_name>')
cursor = cnxn.cursor()

cursor.execute("SELECT @@version;")
row = cursor.fetchone()
while row:
    print(row[0])
    row = cursor.fetchone()

I get:

pyodbc.Error: ('IM004', "[IM004] [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed (0) (SQLDriverConnect)")

Also strace seems fine.

As a side note, from ms-driver installation on Alpine including the optional signature validation in my Dockerfile cause isql to also fail.

sonnehansen avatar Sep 22 '20 19:09 sonnehansen

No, I could not resolve it for miniconda3. What I did was changed image from alpine to ubuntu.

PoojaG20 avatar Sep 23 '20 16:09 PoojaG20

@PoojaG20 so in the end, you didn't manage to resolve this issue? I'm basically having the same issue as well.

knguyen1794 avatar Oct 12 '20 08:10 knguyen1794

In the end I managed to find out what's wrong. When deploying to Azure app service, it's running with a GID 1000 but there isn't such user in etc/passwd. Adding a step of creating this user GID 1000 in my Docker helps solve the problem.

knguyen1794 avatar Oct 19 '20 02:10 knguyen1794

We've been troubleshooting this issue since yesterday on Alpine - Dockerfile to reproduce below (you will need working DB credentials to get it to successfully run the isql test before it moves on to install pyodbc, so you may wish to comment that line out).

Everything is working in isql, but this strange and generic error in pyodbc. This would suggest that it is very much a pyodbc issue, not an environment/permissions problem as has been suggested above.

We tried messing with /etc/passwd and so on as suggested by others, but from the docker build output we can see that we are running commands as root (id =0) and there is an entry for user id = 0 in /etc/passwd, so that seems unlikely to be the cause anyway. We straced the python process and could not find anything amiss.

FROM continuumio/miniconda3:4.9.2-alpine

RUN apk update \
    && apk upgrade \
    && apk --no-cache add --update \
        alpine-sdk \
        ca-certificates \
        gnupg \
        xvfb \
        curl \
        unixodbc-dev

# MS SQL tools and driver
RUN curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.7.2.1-1_amd64.apk && \
    curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.7.1.1-1_amd64.apk && \
    curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.7.2.1-1_amd64.sig && \
    curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.7.1.1-1_amd64.sig
RUN curl https://packages.microsoft.com/keys/microsoft.asc  | gpg --import -
RUN gpg --verify msodbcsql17_17.7.2.1-1_amd64.sig msodbcsql17_17.7.2.1-1_amd64.apk
RUN gpg --verify mssql-tools_17.7.1.1-1_amd64.sig mssql-tools_17.7.1.1-1_amd64.apk
RUN apk add --allow-untrusted msodbcsql17_17.7.2.1-1_amd64.apk
RUN apk add --allow-untrusted mssql-tools_17.7.1.1-1_amd64.apk


# Check that ODBC drivers work - Note: You need correct connection details to get past this line
# If you don't want to run this against an actual database comment it out to get to the next command
RUN sh -c 'echo "SELECT TOP 1 * FROM Schema.Table" | isql -v -k "DRIVER={ODBC Driver 17 for SQL Server};SERVER=aaa.database.windows.net;UID=sss@fff;PWD=xxx;DATABASE=yyy"'

# Install Python and pyodbc
RUN /opt/conda/bin/conda install python=3.8 --yes
RUN /opt/conda/bin/pip install pyodbc==4.0.30

RUN sh -c 'whoami && echo $(id) && cat /etc/passwd'

# Check that PyODBC works
RUN /opt/conda/bin/pip show pyodbc && \
    /opt/conda/bin/python -c "import pyodbc; print(pyodbc.drivers())" && \
    /opt/conda/bin/python -c "import pyodbc; pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER=aaa.database.windows.net;UID=sss@fff;PWD=xxx;DATABASE=yyy')"

Attached is the output of running docker build . with connection details redacted. output.txt

Any help to resolve the issue would be very much appreciated.

michaelbironneau avatar Mar 18 '21 09:03 michaelbironneau

@michaelbironneau Do you have an ODBC trace? That error comes from the ODBC driver, not from pyODBC, so that might shed more light on the issue. Also can I see the strace?

v-makouz avatar Mar 23 '21 20:03 v-makouz

@v-makouz please see the attached files. strace_output.txt odbc_trace_output.txt

michaelbironneau avatar Mar 31 '21 10:03 michaelbironneau

@michaelbironneau Hmm, not seeing anything too suspicious, one of the things to try if possible is run it with the BidTrace on.

To enable BidTrace in /etc/odbcinst.ini file in the driver section add the following:

[ODBC Driver 17 for SQL Server]
BIDTrace=yes
BIDTraceFile=/path/to/file.txt
BIDTraceFileSize=10485760

Size is in bytes, the actual files that will be created will be called file1.txt, file2.txt etc. But in this case there shouldn't be more then one.

The fact that it isn't even trying to load the .rll suggest that it errors out early in the driver init somewhere, but I can't of why it would do so only when called through pyODBC, but not isql, if the connection string is the same the first few actions should be identical. Maybe we can also look at the successful isql ODBC trace and strace, I don't know if it'll useful but maybe there is some relevant difference in terms what calls they make?

v-makouz avatar Apr 01 '21 20:04 v-makouz

@v-makouz Thanks for helping to troubleshoot. Here is the log file:

2021-04-08 08:24:36.719 tid:12 pid:12 /bid/enter FUNCTION: DvrInit <ODBC|DRIVER> 2021-04-08 08:24:36.719 tid:12 pid:12 /bid/FUNCTION: InitializeDll <SNAC> Enter InitializeDll
2021-04-08 08:24:36.719 tid:12 pid:12 /bid/enter FUNCTION: DllMain_Msdart <SNAC|MSDART> hInstance: 0000000000000000{HINSTANCE}, dwReason: 1, lpReserved: 0000000000000000
2021-04-08 08:24:36.719 tid:12 pid:12 /bid/enter FUNCTION: InitializeCSPool <SNAC|MSDART> cPools: 0
2021-04-08 08:24:36.719 tid:12 pid:12 /bid/leave
2021-04-08 08:24:36.719 tid:12 pid:12 /bid/leave
2021-04-08 08:24:36.719 tid:12 pid:12 /bid/FUNCTION: InitializeDll <INFO|SNAC|MSDART> Intialization succeeded
2021-04-08 08:24:36.719 tid:12 pid:12 /bid/FUNCTION: InitializeDll <SNAC> Leave InitializeDll
2021-04-08 08:24:36.719 tid:12 pid:12 /bid/enter FUNCTION: InitializeSharedModules <SNAC> 2021-04-08 08:24:36.720 tid:12 pid:12 /bid/leave
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/<Trace|MARK> line 5536
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/leave
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/<Trace|MARK> line 368
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/leave
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/enter FUNCTION: SQLAllocHandle <API|ODBC|DRIVER> HandleType: 1{SQL_HANDLETYPE}, Handle: 0000000000000000{SQLHANDLE}, OutputHandlePtr: 00005643DDCC2EB8
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/enter FUNCTION: DvrInit <ODBC|DRIVER> 2021-04-08 08:24:36.720 tid:12 pid:12 /bid/FUNCTION: InitializeDll <SNAC> Enter InitializeDll
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/FUNCTION: InitializeDll <SNAC> Leave InitializeDll
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/enter FUNCTION: InitializeSharedModules <SNAC> 2021-04-08 08:24:36.720 tid:12 pid:12 /bid/leave
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/<Trace|MARK> line 5536
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/leave
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/<Trace|MARK> line 368
2021-04-08 08:24:36.720 tid:12 pid:12 /bid/leave
2021-04-08 08:24:36.723 tid:12 pid:12 /bid/enter FUNCTION: DllMain_Msdart <SNAC|MSDART> hInstance: 0000000000000000{HINSTANCE}, dwReason: 0, lpReserved: 0000000000000000
2021-04-08 08:24:36.723 tid:12 pid:12 /bid/leave

michaelbironneau avatar Apr 08 '21 08:04 michaelbironneau

@michaelbironneau The trace doesn't show any explicit errors, but I will try to step through these functions and see if I can see some scenarios where handle alloc fails, but none of the error cases that would have produced Bid output are true.

v-makouz avatar Apr 09 '21 23:04 v-makouz