Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ccall: could not find function SQLAllocHandle in library #191

Closed
kskoeld opened this issue Mar 24, 2018 · 4 comments
Closed

Error: ccall: could not find function SQLAllocHandle in library #191

kskoeld opened this issue Mar 24, 2018 · 4 comments

Comments

@kskoeld
Copy link

kskoeld commented Mar 24, 2018

Can't get ODBC to work on my Anaconda, Jupyter, Julia 0.6.2 environment on an AWS Linux AMI.
Connecting in python3 notebook using the same odbc settings works (setp as described here https://blog.rjmetrics.com/2016/02/08/setting-up-your-analytics-stack-with-jupyter-notebook-aws-redshift/)

Any help appreciated.

using ODBC
results in
`InitError: ccall: could not find function SQLAllocHandle in library
during initialization of module ODBC

Stacktrace:
[1] SQLAllocHandle(::Int16, ::Ptr{Void}, ::Base.RefValue{Ptr{Void}}) at /home/ec2-user/.julia/v0.6/ODBC/src/API.jl:70
[2] ODBCAllocHandle(::Int16, ::Ptr{Void}) at /home/ec2-user/.julia/v0.6/ODBC/src/Source.jl:4
[3] init() at /home/ec2-user/.julia/v0.6/ODBC/src/ODBC.jl:190
[4] _include_from_serialized(::String) at ./loading.jl:157
[5] _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:200
[6] _require_search_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:236
[7] _require(::Symbol) at ./loading.jl:441
[8] require(::Symbol) at ./loading.jl:405
[9] include_string(::String, ::String) at ./loading.jl:522`

ODBC.dsns()
results in
`UndefVarError: ENV not defined

Stacktrace:
[1] dsns() at /home/ec2-user/.julia/v0.6/ODBC/src/ODBC.jl:100
[2] include_string(::String, ::String) at ./loading.jl:522`

However
show(ENV)
within notebook returns
LESS_TERMCAP_mb= HOSTNAME=ip-172-31-38-16 LESS_TERMCAP_md= LESS_TERMCAP_me= TERM=xterm-256color SHELL=/bin/bash HISTSIZE=1000 EC2_AMITOOL_HOME=/opt/aws/amitools/ec2 SSH_CLIENT=87.158.5.184 63367 22 PYTHON_INSTALL_LAYOUT=amzn LESS_TERMCAP_ue= SSH_TTY=/dev/pts/2 USER=ec2-user LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45: EC2_HOME=/opt/aws/apitools/ec2 LESS_TERMCAP_us= MAIL=/var/spool/mail/ec2-user PATH=/home/ec2-user/anaconda3/bin:/home/ec2-user/anaconda3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin PWD=/home/ec2-user/jupyter JAVA_HOME=/usr/lib/jvm/jre LANG=en_US.UTF-8 AWS_CLOUDWATCH_HOME=/opt/aws/apitools/mon HISTCONTROL=ignoredups SHLVL=1 HOME=/home/ec2-user AWS_PATH=/opt/aws AWS_AUTO_SCALING_HOME=/opt/aws/apitools/as LOGNAME=ec2-user CVS_RSH=ssh AWS_ELB_HOME=/opt/aws/apitools/elb SSH_CONNECTION=87.158.5.184 63367 172.31.38.16 22 LESSOPEN=||/usr/bin/lesspipe.sh %s LESS_TERMCAP_se= _=/home/ec2-user/anaconda3/bin/jupyter OLDPWD=/home/ec2-user JPY_PARENT_PID=23446 OPENBLAS_MAIN_FREE=1 LINES=30 COLUMNS=80

@bdahon
Copy link

bdahon commented Jun 5, 2018

@kskoeld I'm facing the same issue. Did you make any progress on it ?
Thanks

@manuelma
Copy link

manuelma commented Jul 2, 2018

I fixed a similar issue (at least same error msg) by running Pkg.build("ODBC") after I installed my odbc driver.

@shihshen
Copy link

I am seeing the same issue. Here is my callstack.

ERROR: LoadError: InitError: ccall: could not find function SQLAllocHandle in library
Stacktrace:
 [1] SQLAllocHandle at /home/sshen/.julia/packages/ODBC/5L1N8/src/API.jl:106 [inlined]
 [2] ODBCAllocHandle at /home/sshen/.julia/packages/ODBC/5L1N8/src/ODBC.jl:166 [inlined]
 [3] __init__() at /home/sshen/.julia/packages/ODBC/5L1N8/src/ODBC.jl:241
 [4] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:692
 [5] _require_from_serialized(::String) at ./loading.jl:743
 [6] _require(::Base.PkgId) at ./loading.jl:1034
 [7] require(::Base.PkgId) at ./loading.jl:922
 [8] require(::Module, ::Symbol) at ./loading.jl:917
 [9] include at ./boot.jl:328 [inlined]
 [10] include_relative(::Module, ::String) at ./loading.jl:1105
 [11] include(::Module, ::String) at ./Base.jl:31
 [12] exec_options(::Base.JLOptions) at ./client.jl:287
 [13] _start() at ./client.jl:460
during initialization of module ODBC

julia version: Version 1.3.1 (2019-12-30)

@quinnj
Copy link
Member

quinnj commented May 23, 2020

This should be fixed on master; ODBC.jl now ships it's own odbc driver manager (unixODBC for linux, iODBC for osx), so we're guaranteed to have a driver manager that works and is the version we expect.

@quinnj quinnj closed this as completed May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants