JuliaPlots / PlotlyJS.jl

Julia library for plotting with plotly.js
Other
413 stars 77 forks source link

"Kaleido startup failed" in docker container #483

Closed anj00 closed 4 months ago

anj00 commented 4 months ago

Using the official julia docker image (julia:1.10.2) and PlotlyJS v0.18.13 I get the following error

julia> using PlotlyJS
ERROR: InitError: Kaleido startup failed.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] #start#6
    @ ~/.julia/packages/PlotlyKaleido/aujjS/src/PlotlyKaleido.jl:129
  [3] start
    @ ~/.julia/packages/PlotlyKaleido/aujjS/src/PlotlyKaleido.jl:59 [inlined]
  [4] __init__()
    @ PlotlyJS ~/.julia/packages/PlotlyJS/b6MbQ/src/PlotlyJS.jl:104
  [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] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1581
  [9] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1938
 [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [11] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [12] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [14] macro expansion
    @ ./loading.jl:1790 [inlined]
 [15] macro expansion
    @ ./lock.jl:267 [inlined]
 [16] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [17] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [18] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [19] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
during initialization of module PlotlyJS

Version info

Julia Version 1.10.2
Commit bd47eca2c8a (2024-03-01 10:14 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)
Environment:
  JULIA_GPG = 3673DF529D9049477F76B37566E3C7DC03D6E495
  JULIA_VERSION = 1.10.2
  JULIA_PATH = /usr/local/julia

Status `~/.julia/environments/v1.10/Project.toml`
  [f0f68f2c] PlotlyJS v0.18.13
  [f269a46b] TimeZones v1.13.0

More info which might be relevant. I create manifest file on Win10 machine and then copy it to docker (same algorithm works on my virtual Linux, where latest PlotlyJS does init and work correctly and I just initialize the manifest I just created in windows). However the reason I mention this is that if I instead of initializing the manifest in the docker just manually install PlotlyJS docker I get just a warning instead of a crash julia> using PlotlyJS

┌ Warning: Kaleido startup failed.
└ @ PlotlyKaleido ~/.julia/packages/PlotlyKaleido/uMRVG/src/PlotlyKaleido.jl:24
anj00 commented 4 months ago

Actually debugging why manifest doesn't work yet installing manually does I found that I created manifest 24h ago (which fixed (PlotlyKaleido@v2.2.3) and 20h ago a new version of Kaleido was released (PlotlyKaleido v2.2.4, with a single fix "Make all errors in start warnings, actually throw when calling save_payload"). Which solves the problems I describe in this BR and makes PlotlyJS work in docker in scenarios I am using it (saving json graphs into html files). Problem is solved for me.