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

Hard-to-debug Julia error message in container #13

Open
Robinlovelace opened this issue Sep 22, 2024 · 4 comments
Open

Hard-to-debug Julia error message in container #13

Robinlovelace opened this issue Sep 22, 2024 · 4 comments

Comments

@Robinlovelace
Copy link
Owner

Julia seems to work in the latest version of this repo running in Devcontainer.

However, when you try to build the website with quarto preview it fails:

6/11 [unnamed-chunk-3]
Julia version 1.10.5 at location /opt/julia/bin will be used.
Loading setup script for JuliaCall...
┌ Error: Error during initialization of module CHOLMOD
│   exception =
│    could not load symbol "SuiteSparse_config_malloc_func_set":
│    /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so.5: undefined symbol: SuiteSparse_config_malloc_func_set
│    Stacktrace:
│      [1] __init__()
│        @ SparseArrays.CHOLMOD /opt/julia/share/julia/stdlib/v1.10/SparseArrays/src/solvers/cholmod.jl:224
│      [2] run_module_init(mod::Module, i::Int64)
│        @ Base ./loading.jl:1134
│      [3] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
│        @ Base ./loading.jl:1122
│      [4] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
│        @ Base ./loading.jl:1067
│      [5] _tryrequire_from_serialized(modkey::Base.PkgId, path::String, ocachepath::String, sourcepath::String, depmods::Vector{Any})
│        @ Base ./loading.jl:1481
│      [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
│        @ Base ./loading.jl:1574
│      [7] _require(pkg::Base.PkgId, env::String)
│        @ Base ./loading.jl:1938
│      [8] __require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base ./loading.jl:1812
│      [9] #invoke_in_world#3
│        @ ./essentials.jl:926 [inlined]
│     [10] invoke_in_world
│        @ ./essentials.jl:923 [inlined]
│     [11] _require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base ./loading.jl:1803
│     [12] macro expansion
│        @ ./loading.jl:1790 [inlined]
│     [13] macro expansion
│        @ ./lock.jl:267 [inlined]
│     [14] __require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1753
│     [15] #invoke_in_world#3
│        @ ./essentials.jl:926 [inlined]
│     [16] invoke_in_world
│        @ ./essentials.jl:923 [inlined]
│     [17] require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1746
│     [18] top-level scope
│        @ /usr/local/lib/R/site-library/JuliaCall/julia/setup.jl:13
│     [19] include(mod::Module, _path::String)
│        @ Base ./Base.jl:495
│     [20] top-level scope
│        @ none:1
└ @ SparseArrays.CHOLMOD /opt/julia/share/julia/stdlib/v1.10/SparseArrays/src/solvers/cholmod.jl:241
┌ Error: Error during initialization of module CHOLMOD
│   exception =
│    could not load symbol "SuiteSparse_config_malloc_func_set":
│    /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so.5: undefined symbol: SuiteSparse_config_malloc_func_set
│    Stacktrace:
│      [1] __init__()
│        @ SparseArrays.CHOLMOD /opt/julia/share/julia/stdlib/v1.10/SparseArrays/src/solvers/cholmod.jl:224
│      [2] run_module_init(mod::Module, i::Int64)
│        @ Base ./loading.jl:1134
│      [3] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
│        @ Base ./loading.jl:1122
│      [4] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
│        @ Base ./loading.jl:1067
│      [5] _tryrequire_from_serialized(modkey::Base.PkgId, path::String, ocachepath::String, sourcepath::String, depmods::Vector{Any})
│        @ Base ./loading.jl:1481
│      [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
│        @ Base ./loading.jl:1574
│      [7] _require(pkg::Base.PkgId, env::String)
│        @ Base ./loading.jl:1938
│      [8] __require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base ./loading.jl:1812
│      [9] #invoke_in_world#3
│        @ ./essentials.jl:926 [inlined]
│     [10] invoke_in_world
│        @ ./essentials.jl:923 [inlined]
│     [11] _require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base ./loading.jl:1803
│     [12] macro expansion
│        @ ./loading.jl:1790 [inlined]
│     [13] macro expansion
│        @ ./lock.jl:267 [inlined]
│     [14] __require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1753
│     [15] #invoke_in_world#3
│        @ ./essentials.jl:926 [inlined]
│     [16] invoke_in_world
│        @ ./essentials.jl:923 [inlined]
│     [17] require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1746
│     [18] include
│        @ ./Base.jl:495 [inlined]
│     [19] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
│        @ Base ./loading.jl:2222
│     [20] top-level scope
│        @ stdin:3
│     [21] eval
│        @ ./boot.jl:385 [inlined]
│     [22] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
│        @ Base ./loading.jl:2076
│     [23] include_string
│        @ ./loading.jl:2086 [inlined]
│     [24] exec_options(opts::Base.JLOptions)
│        @ Base ./client.jl:316
│     [25] _start()
│        @ Base ./client.jl:552
└ @ SparseArrays.CHOLMOD /opt/julia/share/julia/stdlib/v1.10/SparseArrays/src/solvers/cholmod.jl:241
Finish loading setup script for JuliaCall.
  Activating project at `/workspaces/cross_language_projects`
Error:
! Error happens in Julia.
InitError: could not load library "/root/.julia/artifacts/2829a1f6a9ca59e5b9b53f52fa6519da9c9fd7d3/lib/libhdf5.so"
/usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_4' not found (required by /root/.julia/artifacts/2829a1f6a9ca59e5b9b53f52fa6519da9c9fd7d3/lib/libhdf5.so)
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl ./libdl.jl:116
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/inPJn/src/products/library_generators.jl:63 [inlined]
  [4] __init__()
    @ HDF5_jll ~/.julia/packages/HDF5_jll/3C0GU/src/wrappers/x86_64-linux-gnu-libgfortran5-cxx11-mpi+mpich.jl:15
  [5] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1134
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1122
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1067
  [8] _tryrequire_from_serialized(modkey::Base.PkgId, path::String, ocachepath::String, sourcepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1481
  [9] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1574
 [10] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1938
 [11] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [12] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [13] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [14] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [15] macro expansion
    @ ./loading.jl:1790 [inlined]
 [16] macro expansion
    @ ./lock.jl:267 [inlined]
 [17] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [18] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [19] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [20] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
 [21] top-level scope
    @ none:3
 [22] eval(m::Module, e::Any)
    @ Core ./boot.jl:385
 [23] macro expansion
    @ /usr/local/lib/R/site-library/JuliaCall/julia/RmdStd.jl:15 [inlined]
 [24] top-level scope
    @ ./none:14
 [25] eval
    @ ./boot.jl:385 [inlined]
 [26] eval_string(x::String)
    @ Main.JuliaCall /usr/local/lib/R/site-library/JuliaCall/julia/setup.jl:203
 [27] docall(call1::Ptr{Nothing})
    @ Main.JuliaCall /usr/local/lib/R/site-library/JuliaCall/julia/setup.jl:176
during initialization of module HDF5_jll
Backtrace:
  1. global .main()
  2. execute(...)
  3. rmarkdown::render(...)
  4. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
  5. knitr:::process_file(text, output)
     ...
 15. JuliaCall:::stdout_capture_command(buffer)
 16. base::tryCatch(...)
 17. base (local) tryCatchList(expr, classes, parentenv, handlers)
 18. base (local) tryCatchOne(...)
 19. value[[3L]](cond)



Quitting from lines 25-35 [unnamed-chunk-3] (demo.qmd)
Execution halted
Julia exit.

Any ideas @evetion / colleagues?

@Robinlovelace
Copy link
Owner Author

The code clearly can run, just not with Quarto? Image below shows great plot from Julia:

image

@Robinlovelace
Copy link
Owner Author

Related? Devcontainer boots into recovery mode:

image

@evetion
Copy link
Contributor

evetion commented Sep 23, 2024

This is again Julia finding a shared library from the system (which fails on a version mismatch) earlier then the Julia provided one, because R loaded it. You might try to set the LD_LIBRARY_PATH to empty (or print its contents to check this assumption) before any Julia(Call) invocation.

Relates to JuliaInterop/JuliaCall#234

@Robinlovelace
Copy link
Owner Author

Thanks, that's a good basis for debugging. Could it maybe fix actions on Linux if solved also, I wonder...

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