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

could not load library "C:\Users\Thor\.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll" #211

Closed
anthonyagudelox3 opened this issue Nov 27, 2019 · 20 comments

Comments

@anthonyagudelox3
Copy link

Hey, I am trying to use a function in the BioServices.jl package, efetch() which utilizes MbedTLS.jl. When I run efetch I get the following error and says could not load library "C:\Users\Thor.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll":

Stacktrace:
[1] #request#1(::Nothing, ::Type, ::Int64, ::Base.Iterators.Pairs{Symbol,Nothing,Tuple{Symbol},NamedTuple{(:iofunction,),Tuple{Nothing}}}, ::typeof(HTTP.request), ::Type{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::String) at C:\Users\Thor.julia\packages\HTTP\6Smhf\src\ConnectionRequest.jl:41
[2] (::getfield(HTTP, Symbol("#kw##request")))(::NamedTuple{(:iofunction,),Tuple{Nothing}}, ::typeof(HTTP.request), ::Type{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::String) at .\none:0
[3] #request#1(::Base.Iterators.Pairs{Symbol,Nothing,Tuple{Symbol},NamedTuple{(:iofunction,),Tuple{Nothing}}}, ::typeof(HTTP.request), ::Type{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}, ::HTTP.URIs.URI, ::Vararg{Any,N} where N) at C:\Users\Thor.julia\packages\HTTP\6Smhf\src\ExceptionRequest.jl:19
[4] (::getfield(HTTP, Symbol("#kw##request")))(::NamedTuple{(:iofunction,),Tuple{Nothing}}, ::typeof(HTTP.request), ::Type{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::String) at .\none:0
[5] (::getfield(Base, Symbol("###50#51#53")){ExponentialBackOff,getfield(HTTP.RetryRequest, Symbol("##2#3")){Bool,HTTP.Messages.Request},typeof(HTTP.request)})(::Base.Iterators.Pairs{Symbol,Nothing,Tuple{Symbol},NamedTuple{(:iofunction,),Tuple{Nothing}}}, ::getfield(Base, Symbol("##50#52")){getfield(Base, Symbol("###50#51#53")){ExponentialBackOff,getfield(HTTP.RetryRequest, Symbol("##2#3")){Bool,HTTP.Messages.Request},typeof(HTTP.request)}}, ::Type, ::Vararg{Any,N} where N) at .\error.jl:249
[6] #request#1(::VersionNumber, ::String, ::Nothing, ::Nothing, ::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:retry_non_idempotent,),Tuple{Bool}}}, ::typeof(HTTP.request), ::Type{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::String) at .\none:0
[7] (::getfield(HTTP, Symbol("#kw##request")))(::NamedTuple{(:retry_non_idempotent,),Tuple{Bool}}, ::typeof(HTTP.request), ::Type{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::String) at .\none:0
[8] #request#1(::Int64, ::Bool, ::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:retry_non_idempotent,),Tuple{Bool}}}, ::typeof(HTTP.request), ::Type{HTTP.RedirectRequest.RedirectLayer{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::String) at C:\Users\Thor.julia\packages\HTTP\6Smhf\src\RedirectRequest.jl:24
[9] (::getfield(HTTP, Symbol("#kw##request")))(::NamedTuple{(:retry_non_idempotent,),Tuple{Bool}}, ::typeof(HTTP.request), ::Type{HTTP.RedirectRequest.RedirectLayer{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer{Union{}}}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::String) at .\none:0
[10] #request#5(::Array{Pair{SubString{String},SubString{String}},1}, ::String, ::Nothing, ::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:retry_non_idempotent,),Tuple{Bool}}}, ::typeof(HTTP.request), ::String, ::String, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{UInt8,1}) at C:\Users\Thor.julia\packages\HTTP\6Smhf\src\HTTP.jl:308
[11] #request at .\none:0 [inlined] (repeats 2 times)
[12] #efetch#5 at C:\Users\Thor.julia\packages\BioServices\KPZxN\src\eutils.jl:126 [inlined]
[13] #efetch at .\none:0 [inlined] (repeats 2 times)
[14] top-level scope at REPL[6]:1
caused by [exception 1]
could not load library "C:\Users\Thor.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll"
The specified procedure could not be found.

I am running julia 1.2.0
on a Windows 10 machine and the following packages installed:

"CSV" => v"0.5.14"
"TextAnalysis" => v"0.6.0"
"BioMedQuery" => v"0.6.4"
"Atom" => v"0.10.1"
"Juno" => v"0.7.2"
"Conda" => v"1.3.0"
"HTTP" => v"0.8.7"
"DecFP" => v"0.4.8"
"LinearAlgebra" => nothing
"Missings" => v"0.4.3"
"ScikitLearn" => v"0.5.1"
"BioServices" => v"0.3.2"
"StatsBase" => v"0.32.0"
"VariantVisualization" => v"0.4.0"
"Tables" => v"0.2.11"
"EzXML" => v"0.9.4"
"MbedTLS" => v"0.7.0"
"Languages" => v"0.4.2"
"DataFrames" => v"0.19.4"
"Printf" => nothing
"MySQL" => v"0.7.1"
"LightXML" => v"0.8.1"

@anthonyagudelox3
Copy link
Author

Is anyone watching?

@kescobo
Copy link

kescobo commented Jan 24, 2020

Hi Anthony - Sorry no one has replied to you. I'm afraid I won't be much help fixing the issue, but have you tried building MbedTLS itself? In the REPL, just do ] build MbedTLS.

@anthonyagudelox3
Copy link
Author

Hi Anthony - Sorry no one has replied to you. I'm afraid I won't be much help fixing the issue, but have you tried building MbedTLS itself? In the REPL, just do ] build MbedTLS.

Hey Kevin- No worries, and I have tried building MbedTLS. Building the package works fine.

@kescobo
Copy link

kescobo commented Jan 27, 2020

Ok, that's good - does this solve the original issue, or do you still end up with the same error?

@anthonyagudelox3
Copy link
Author

Unfortunately, I still end up with the same issue.

@kescobo
Copy link

kescobo commented Jan 27, 2020

:-( I'm afraid I don't have a good idea where to go next (not a windows user). What's the actual error message (just above the stack trace)?

Might also be helpful to share the actual query (if you can), I can see if I get some other error on mac/linux that might be illuminating.

@anthonyagudelox3
Copy link
Author

The actual error is:

ERROR: LoadError: error compiling #getconnection: error compiling #getconnection#11: error compiling #sslconnection#18: error compiling global_sslconfig: error compiling #SSLConfig#46: could not load library "C:\Users\Thor.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll"
The specified procedure could not be found.

The query being:
EUtils.efetch(db = "pubmed", tool = "BioJulia", retmode = "xml", rettype = "null", id = request_str)

Where request_str being:

request_str = [7683506, 21273794, 20502278, 12837696, 9671894, 10910540, 1726111, 12925463, 14977895, 8354293, 21126967, 11874162, 11196419, 19856865, 14711867, 11077942, 19369394, 10071840, 17653692, 24052503, 19828801, 22875049, 1756527, 21094951, 21392146, 1641273, 7562289, 8157019, 11149114, 19588439, 20526778, 21056307, 9988814, 15678510, 20071566, 16856062, 17921123, 11474660, 17728088, 19803911, 16510632, 10321674, 22654787, 304806, 9751753, 15818055, 22491902, 22414880, 17377412, 23920104, 9458929, 9175950, 16837240, 11339911, 12439489, 24368157, 21197428, 16251172, 18724063, 22009856, 11912289, 10070119, 17314118, 11529543, 12865310, 17686002, 9124602, 11406028, 12148961, 21093581, 21166684, 15131465, 12427391, 19571582, 20510913, 17095552, 16497715, 22243792, 17395122, 18987014, 20618699, 23889750, 17675357, 19282364, 1797514, 12839290, 10378403, 16446602, 18450898, 11285060, 17055193, 3777985, 11293640, 17401502, 15695923, 9470905, 12439523, 12827239, 16792994, 10709119, 17439630, 20192887, 11373920, 19338208, 18185082, 17143058, 20172976, 22958386, 16936265, 17468132, 21294065, 3292100, 6351537, 7694463, 10544751, 21212851, 7597092, 10765604, 23485951, 12756873, 21815258, 14759308, 23841577, 17900453, 18851856, 15956731, 12671173, 15538630, 21382466, 23772774, 15177670, 21801864, 18674658, 21656057, 20308837, 19718578, 12526770, 18166549, 23359489, 2238843, 20452493, 23666920, 19336370, 9065108, 15353504, 16263773, 17855451, 13009470, 17074544, 24335141, 16936247, 19099817, 21338666, 24288432, 11433084, 20570286, 24709930, 11673754, 22682000, 798269, 12904590, 16157128, 19521336, 16357110, 23972758, 11703405, 24439811, 18838246, 15809210, 20069051, 8040778, 22044007, 16679958, 23194157, 24124699, 12496176, 4717441, 18317236, 21447942, 23307787, 21975772, 21643846, 17368647, 11815549, 20234144, 1614456, 7643957, 20003277, 20495079, 15507966, 23942554, 1302425, 1773923, 15764963, 12478992, 9593950, 1349050, 12367822, 11158594, 12763109, 9002665, 19234164, 1403464, 15493717, 14671170, 16276336, 12915475, 12169829, 17449701, 8835397, 17667860, 15163335, 9183569, 22421261, 23828585, 17443204, 19144956, 20177288, 23651728, 2591339, 8238198, 10782394, 16938879, 24225293, 19515978, 19309286, 20419149, 10471825, 16580281, 11035337, 11861414, 23236705, 9160976, 118051, 21034609, 21701445, 17119993, 10469778, 24188066, 18754838, 17446182, 781206, 9595363, 8917583, 11520397, 15718365, 19446788, 14723749, 21883885, 15703196, 16652108, 20420200, 9240577, 2364907, 9357932, 10926289, 16510184, 17136231, 19106236, 23529685, 23295978, 15214004, 17127271, 19026292, 16982938, 16202930, 17703185, 17339775, 10909993, 16356438, 7538729, 10576642, 21960125, 12050275, 18568888, 16238543, 21659962, 22568870, 22676722, 8680517, 17711923, 15867044, 17703412, 15745646, 18276950, 15232008, 22355322, 23161670, 24923732, 8886630, 15733276, 22744848, 9528914, 12904319, 22426431, 17344923, 24518760, 3029767, 11935406, 17428554]

@kescobo
Copy link

kescobo commented Jan 27, 2020

Alright, the good news is that your code works fine on my mac.

The bad news is that's the end of the help I can offer. I'm tagging the contributors to the EUtils package - maybe they have an idea? @mirestrepo @fernandogelin @mcmcgrath13 @ibacher

@anthonyagudelox3
Copy link
Author

Alright, the good news is that your code works fine on my mac.

The bad news is that's the end of the help I can offer. I'm tagging the contributors to the EUtils package - maybe they have an idea? @mirestrepo @fernandogelin @mcmcgrath13 @ibacher

Thanks for the help Kevin! Hopefully we can figure out why it is not working on my windows machine.

@anthonyagudelox3
Copy link
Author

So I was able to get the function to work on a coworkers mac as well. So it looks like the function does not work for Windows unfortunately. Do you know of any way to get it up and running on Windows?

@kescobo
Copy link

kescobo commented Jan 30, 2020

I have no idea, hopefully someone else will chime in...

@stevengj
Copy link
Member

Is there an error message when you do build MbedTLS at the pkg> prompt?

@kescobo
Copy link

kescobo commented Jan 30, 2020

I asked that earlier - seems it built fine

@aviks
Copy link
Member

aviks commented Jan 30, 2020

I can confirm that this works for rme in Windows 10, with MbedTLS 0.7.0

Some troubleshooting ideas:

I presume you have checked that the dll exists in that location: C:\Users\Thor\.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll ?

On the Julia prompt, could you try using Libdl; dlopen("C:\Users\Thor\.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll") . What is the output?

Just to check if this is a problem with a particular site (doesn't seem so, but still, to verify) can you do: using HTTP; HTTP.get("https://google.com")

Can you check the dll using dependency walker?

@quinnj
Copy link
Member

quinnj commented Jan 31, 2020

Those are good ideas from @aviks. Another idea would be to add/download https://github.com/JuliaBinaryWrappers/MbedTLS_jll.jl and see if the problem still exists there (this would involve ccall-ing the function in question yourself).

@anthonyagudelox3
Copy link
Author

julia> dlopen("C:\Users\Thor.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll")
ERROR: syntax: invalid escape sequence
Stacktrace:
[1] top-level scope at REPL[3]:0

I can confirm that this works for rme in Windows 10, with MbedTLS 0.7.0

Some troubleshooting ideas:

I presume you have checked that the dll exists in that location: C:\Users\Thor\.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll ?

On the Julia prompt, could you try using Libdl; dlopen("C:\Users\Thor\.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll") . What is the output?

Just to check if this is a problem with a particular site (doesn't seem so, but still, to verify) can you do: using HTTP; HTTP.get("https://google.com")

Can you check the dll using dependency walker?

I checked to see if the if the problem is site specific and HTTP.get("https://google.com") works fine.

As for dlopen("C:\Users\Thor.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll") it gives the following error:

dlopen("C:\Users\Thor.julia\packages\MbedTLS\a1JFn\deps\usr\bin")
ERROR: syntax: invalid escape sequence
Stacktrace:
[1] top-level scope at REPL[3]:0

I also tried dependency walker and I get the following error when I attempt to open the dll file:

Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: A circular dependency was detected.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

@anthonyagudelox3
Copy link
Author

I can confirm that this works for rme in Windows 10, with MbedTLS 0.7.0

Some troubleshooting ideas:

I presume you have checked that the dll exists in that location: C:\Users\Thor\.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll ?

On the Julia prompt, could you try using Libdl; dlopen("C:\Users\Thor\.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll") . What is the output?

Just to check if this is a problem with a particular site (doesn't seem so, but still, to verify) can you do: using HTTP; HTTP.get("https://google.com")

Can you check the dll using dependency walker?

@stevengj
Copy link
Member

Use

dlopen(raw"C:\Users\Thor.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll")

so that the backslashes aren't treated as escapes.

@anthonyagudelox3
Copy link
Author

Okay so running dlopen(raw"C:\Users\Thor.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll") gives:

julia> dlopen(raw"C:\Users\Thor.julia\packages\MbedTLS\a1JFn\deps\usr\bin\libmbedtls.dll")
Ptr{Nothing} @0x0000000000d50000

@anthonyagudelox3
Copy link
Author

It looks like the using MbedTLS 0.7.0 on Julia v1.4.0 over Julia v1.1.1 seems to resolve the issue.

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