avik-pal / Wandb.jl

Unofficial Julia bindings for logging experiments to wandb.ai
https://avik-pal.github.io/Wandb.jl/stable/
MIT License
80 stars 10 forks source link

`Can't connect to HTTPS URL because the SSL module is not available.` when OpenSSL_jll is loaded before Wandb. #39

Open lassepe opened 5 days ago

lassepe commented 5 days ago

On a fresh Julia 1.10 install in a clean environment, the reproducer below causes the error:

ERROR: LoadError: Python: CommError: Can't connect to HTTPS URL because the SSL module is not available.

Interestingly, this error only appears when Wandb is loaded after CairoMakie.

using CairoMakie: CairoMakie
using Wandb: Wandb

# trigger ssl error
function provoke_error(logger)
    logging_dict = Dict{String,Any}()
    logging_dict["samples"] = Wandb.Image(CairoMakie.scatter(randn(100)))
    Wandb.log(logger, logging_dict; step=1)
end

logger = Wandb.WandbLogger(; project="test")
provoke_error(logger)
lassepe commented 3 days ago

The offender seems to be OpenSSL_jll. The following will also trigger the issue:

using OpenSSL_jll
using Wandb: Wandb

# trigger ssl error
function provoke_error(logger)
    logging_dict = Dict{String,Any}()
    logging_dict["samples"] = Wandb.Image(rand(2, 2))
    Wandb.log(logger, logging_dict; step=1)
end

logger = Wandb.WandbLogger(; project="test")
provoke_error(logger)
lassepe commented 3 days ago

Downgrading OpenSSL_jll to v1 seems to fix the issue. I don't think that should be the permanent solution but can be a workaround for now.