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

libcurl - could not load library #138

Closed
grinsted opened this issue Aug 17, 2020 · 5 comments
Closed

libcurl - could not load library #138

grinsted opened this issue Aug 17, 2020 · 5 comments

Comments

@grinsted
Copy link

I just installed a fresh julia 1.5 and added ArchGDAL to try to read a geotff from the web.

using ArchGDAL

ArchGDAL.read("https://storage.cloud.google.com/gcp-public-data-landsat/LC08/01/044/034/LC08_L1GT_044034_20130330_20170310_01_T2/LC08_L1GT_044034_20130330_20170310_01_T2_B6.TIF") do dataset
    # work with dataset
end

And that gives me this error

ERROR: InitError: could not load library "C:\Users\ag\.julia\artifacts\93a125a1f028ecc90665616e44072e4da65aea23\bin\libcurl-4.dll"
The specified procedure could not be found.
Stacktrace:
 [1] dlopen(::String, ::UInt32; throw_error::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Libdl\src\Libdl.jl:109
 [2] dlopen at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Libdl\src\Libdl.jl:109 [inlined] (repeats 2 times)
 [3] __init__() at C:\Users\ag\.julia\packages\LibCURL_jll\yitNc\src\wrappers\x86_64-w64-mingw32.jl:79
 [4] _include_from_serialized(::String, ::Array{Any,1}) at .\loading.jl:697
 [5] _require_search_from_serialized(::Base.PkgId, ::String) at .\loading.jl:782
 [6] _tryrequire_from_serialized(::Base.PkgId, ::UInt64, ::String) at .\loading.jl:712
 [7] _require_search_from_serialized(::Base.PkgId, ::String) at .\loading.jl:771
 [8] _tryrequire_from_serialized(::Base.PkgId, ::UInt64, ::Nothing) at .\loading.jl:712
 [9] _require_from_serialized(::String) at .\loading.jl:744
 [10] _require(::Base.PkgId) at .\loading.jl:1040
 [11] require(::Base.PkgId) at .\loading.jl:928
 [12] require(::Module, ::Symbol) at .\loading.jl:923
 [13] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1088
during initialization of module LibCURL_jll 

There is a libcurl-4.dll in that location.

I'm using win10 and ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"

@visr
Copy link
Collaborator

visr commented Aug 17, 2020

Hmm. I get an error as well, but a different one. Could you run the ]st command below and return the results?

curl) pkg> st -m ArchGDAL GDAL GDAL_jll GEOS_jll LibCURL_jll Libtiff_jll PROJ_jll
Status `C:\tmp\curl\Manifest.toml`
  [c9ce4bd3] ArchGDAL v0.4.1
  [add2ef01] GDAL v1.1.3
  [a7073274] GDAL_jll v3.0.4+1
  [d604d12d] GEOS_jll v3.8.1+0
  [deac9b47] LibCURL_jll v7.71.1+0
  [89763e89] Libtiff_jll v4.1.0+0
  [58948b4f] PROJ_jll v7.0.1+0

julia> using ArchGDAL

julia> landsat = "https://storage.cloud.google.com/gcp-public-data-landsat/LC08/01/044/034/LC08_L1GT_044034_20130330_20170310_01_T2/LC08_L1GT_044034_20130330_20170310_01_T2_B6.TIF"

julia> ArchGDAL.read(landsat)
ERROR: GDALError (CE_Failure, code 1):
        Cert verify failed: BADCERT_NOT_TRUSTED

Stacktrace:
 [1] gdaljl_errorhandler(::GDAL.CPLErr, ::Int32, ::Cstring) at C:\Users\visser_mn\.julia\packages\GDAL\yPmFi\src\error.jl:36
 [2] gdalopenex(::String, ::Int64, ::Ptr{Cstring}, ::Ptr{Cstring}, ::Ptr{Cstring}) at C:\Users\visser_mn\.julia\packages\GDAL\yPmFi\src\gdal_h.jl:472
 [3] #read#60 at C:\Users\visser_mn\.julia\packages\ArchGDAL\ohMpc\src\dataset.jl:388 [inlined]
 [4] read(::String) at C:\Users\visser_mn\.julia\packages\ArchGDAL\ohMpc\src\dataset.jl:388
 [5] top-level scope at REPL[8]:1

@grinsted
Copy link
Author

grinsted commented Aug 17, 2020

I got the same:

  [c9ce4bd3] ArchGDAL v0.4.1
  [add2ef01] GDAL v1.1.3
  [a7073274] GDAL_jll v3.0.4+1
  [d604d12d] GEOS_jll v3.8.1+0
  [deac9b47] LibCURL_jll v7.71.1+0
  [89763e89] Libtiff_jll v4.1.0+0
  [58948b4f] PROJ_jll v7.0.1+0

Now, i also get badcert like you ??? So I no longer get the first error. Nothing changed except I restarted my julia session.

visr added a commit to visr/Yggdrasil that referenced this issue Aug 17, 2020
Hopefully will help with yeesian/ArchGDAL.jl#138, which has libcurl init issues.
@visr
Copy link
Collaborator

visr commented Aug 17, 2020

Hmm I just also got a spurious InitError like you. Hopefully a rebuild, JuliaPackaging/Yggdrasil#1494, will help with libcurl initialisation, which was changed recently to pick up the one in the artifact instead of the julia bin folder. At least, that is my understanding of what Elliot told me in Slack #binarybuilder.

And then hopefully we can use this to fix the certificate issue: JuliaGeo/GDAL.jl#94

giordano pushed a commit to JuliaPackaging/Yggdrasil that referenced this issue Aug 18, 2020
Hopefully will help with yeesian/ArchGDAL.jl#138, which has libcurl init issues.
@visr
Copy link
Collaborator

visr commented Aug 18, 2020

Ok with GDAL.jl v1.1.4 this should be fixed now. Only issue is that it doesn't like the image you linked.

julia> landsat_gcp = "https://storage.cloud.google.com/gcp-public-data-landsat/LC08/01/044/034/LC08_L1GT_044034_20130330_20170310_01_T2/LC08_L1GT_044034_20130330_20170310_01_T2_B6.TIF"

julia> ArchGDAL.read(landsat_gcp)
ERROR: GDALError (CE_Failure, code 4):
        Failed to read TopoJSON data

julia> ArchGDAL.read("/vsicurl/$landsat_gcp")
ERROR: GDALError (CE_Failure, code 3):
        Cannot read 91270 bytes

julia> landsat_aws = "https://landsat-pds.s3.amazonaws.com/L8/139/045/LC81390452014295LGN00/LC81390452014295LGN00_B1.TIF"

julia> ArchGDAL.read("/vsicurl/$landsat_aws")
GDAL Dataset (Driver: GTiff/GeoTIFF)
File(s):
  /vsicurl/https://landsat-pds.s3.amazonaws.com/L8/139/045/LC81390452014295LGN00/LC81390452014295LGN00_B1.TIF
  /vsicurl/https://landsat-pds.s3.amazonaws.com/L8/139/045/LC81390452014295LGN00/LC81390452014295LGN00_B1.TIF.ovr
  /vsicurl/https://landsat-pds.s3.amazonaws.com/L8/139/045/LC81390452014295LGN00/LC81390452014295LGN00_MTL.txt

Dataset (width x height): 7621 x 7791 (pixels)
Number of raster bands: 1
  [GA_ReadOnly] Band 1 (Gray): 7621 x 7791 (UInt16)

@visr
Copy link
Collaborator

visr commented Aug 20, 2020

I'll close this since the curl issue is fixed now. Thanks for the report. Do let us know if something else is not right!

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

2 participants