Mapping for within Artifacts.toml already exists

I updated an artifact online and wanted therefore to remove the existing (old) artifact I had locally, so I went and found the folder that contained it (in .julia/artifacts/hash/here) and just deleted it. Now I get this error:

julia> using CoffeeBeetles
[ Info: Precompiling CoffeeBeetles [9927b314-560b-4f5c-ae2a-379059c760a4]
ERROR: LoadError: LoadError: Mapping for 'data' within /home/yakir/.julia/packages/CoffeeBeetles/Oeh8N/src/../Artifacts.toml already exists!
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] bind_artifact!(::String, ::String, ::Base.SHA1; platform::Nothing, download_info::Nothing, lazy::Bool, force::Bool) at /home/yakir/julia/usr/share/julia/stdlib/v1.4/Pkg/src/Artifacts.jl:626
 [3] bind_artifact!(::String, ::String, ::Base.SHA1) at /home/yakir/julia/usr/share/julia/stdlib/v1.4/Pkg/src/Artifacts.jl:620
 [4] top-level scope at /home/yakir/.julia/packages/CoffeeBeetles/Oeh8N/src/generate_artifacts.jl:11
 [5] include(::Module, ::String) at ./Base.jl:377
 [6] include(::String) at /home/yakir/.julia/packages/CoffeeBeetles/Oeh8N/src/CoffeeBeetles.jl:1
 [7] top-level scope at /home/yakir/.julia/packages/CoffeeBeetles/Oeh8N/src/CoffeeBeetles.jl:13
 [8] include(::Module, ::String) at ./Base.jl:377
 [9] top-level scope at none:2
 [10] eval at ./boot.jl:331 [inlined]
 [11] eval(::Expr) at ./client.jl:449
 [12] top-level scope at ./none:3
in expression starting at /home/yakir/.julia/packages/CoffeeBeetles/Oeh8N/src/generate_artifacts.jl:6
in expression starting at /home/yakir/.julia/packages/CoffeeBeetles/Oeh8N/src/CoffeeBeetles.jl:13
ERROR: Failed to precompile CoffeeBeetles [9927b314-560b-4f5c-ae2a-379059c760a4] to /home/yakir/.julia/compiled/v1.4/CoffeeBeetles/yhoPD_qsBdb.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272
 [3] _require(::Base.PkgId) at ./loading.jl:1029
 [4] require(::Base.PkgId) at ./loading.jl:927
 [5] require(::Module, ::Symbol) at ./loading.jl:922

How can I fix this?

Not knowing how Julia tracks all the stuff in the .julia directory I would probably nuke the whole .julia directory and let it be rebuilt.

eh… no.

I hope not?

I can’t find this package anywhere (not registered, not known to Google), so it’s hard to diagnose this. It looks like bind_artifact! is complaining that there’s already an entry for the name you’re giving to that artifact. You have to use unbind_artifact!() to remove the existing binding or equivalently, manually delete the stanzas in the Artifacts.toml file that define that artifact binding.

2 Likes

Here’s the repo

Thanks for trying!

I’ll try what you suggested.