# Julia artifact was not installed correctly

**URL:** <https://discourse.julialang.org/t/julia-artifact-was-not-installed-correctly/76038>\
**Category:** Specific Domains\
**Tags:** artifacts\
**Created:** [February 8, 2022, 5:33pm UTC](https://discourse.julialang.org/t/julia-artifact-was-not-installed-correctly/76038 "2022-02-08T17:33:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Post date:** [February 8, 2022, 5:34pm UTC](https://discourse.julialang.org/t/julia-artifact-was-not-installed-correctly/76038/1 "2022-02-08T17:34:00Z")

</div>

I love artifacts, but I think currently there are somehow fragile.  
I am constantly using a certain artifact, which after some time gets automatically deleted and I get an error like:

```julia
Artifact "JuliaMono" was not installed correctly. Try `using Pkg; Pkg.instantiate()` to re-install all missing resources.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] _artifact_str( __module__ ::Module, artifacts_toml::String, name::SubString{String}, path_tail::String, artifact_dict::Dict{String, Any}, hash::Base.SHA1, platform::Base.BinaryPlatforms.Platform, lazyartifacts::Any)
   @ Artifacts ~/Downloads/Apps/julia/julia-1.7.2/share/julia/stdlib/v1.7/Artifacts/src/Artifacts.jl:551
 [3] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Base ./essentials.jl:716
 [4] invokelatest(::Any, ::Any, ::Vararg{Any})
   @ Base ./essentials.jl:714
 [5] top-level scope
   @ ~/Downloads/Apps/julia/julia-1.7.2/share/julia/stdlib/v1.7/Artifacts/src/Artifacts.jl:680

```

Unfortunately `using Pkg; Pkg.instantiate()` doesn’t do the trick.  
I used to delete the Artifact.toml and reinstall it and that would work, but right now it doesn’t do the job.

I use the [ArtifactUtills](https://github.com/simeonschaub/ArtifactUtils.jl) package because I still find the Pkg API somehow complicated.

Currently I try to run the example but it also throws an error (didn’t used to):

```julia
julia> using ArtifactUtils, Artifacts # Artifacts provides the artifact string macro

julia> add_artifact!(
           "Artifacts.toml",
           "JuliaMono",
           "https://github.com/cormullion/juliamono/releases/download/v0.030/JuliaMono.tar.gz",
           force=true,
       )
SHA1("6c460cf2eccecd24499618112adbbe7e403fa1ee")

julia> import Pkg; Pkg.instantiate()

julia> artifact"JuliaMono" #gives the error above

```

which gives the error above.

The `Artifact.toml` file is being correctly generated.

If I manually add the folder in `~/julia/artifacts/` then it works normally

I didn’t want to raise an issue in `ArtifactsUtils` because I suspect that it will not be this package’s problem. My guess would be that `Pkg.instantiate()` doesn’t really download the artifact, although it should ?

Tested on a clean Julia 1.7.2 environment.

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [February 9, 2022, 9:48am UTC](https://discourse.julialang.org/t/julia-artifact-was-not-installed-correctly/76038/2 "2022-02-09T09:48:27Z")

</div>

I think that we can start filing an issue. I’m on Julia 1.7.1 and have just added

```nohighlight
[MathJax]
git-tree-sha1 = "74d0a953af18dcd657e42a5cd95e77d791882528"

    [[MathJax.download]]
    sha256 = "ba979bd15d82065aebea460ed77e4b3fe217ca3a7876cc69606147b85d8fb3ce"
    url = "https://github.com/mathjax/MathJax/archive/refs/tags/3.2.0.tar.gz"

```

to `Artifacts.toml`. Here, the sha’s are wrong, but that shouldn’t matter. They are at least different from any other sha that I have in the system.

Next, `> instantiate` doesn’t show updates and I also cannot use the artifact

```julia
julia> artifact"MathJax"
ERROR: Artifact "MathJax" was not installed correctly. Try `using Pkg; Pkg.instantiate()` to re-install all missing resources.

```

EDIT: Running the same in Julia 1.6 does work. There the artifact gets installed. I’m opening an issue.

EDIT2: [https://github.com/JuliaLang/Pkg.jl/issues/2979](https://github.com/JuliaLang/Pkg.jl/issues/2979)

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [February 9, 2022, 3:21pm UTC](https://discourse.julialang.org/t/julia-artifact-was-not-installed-correctly/76038/3 "2022-02-09T15:21:39Z")

</div>

> [@filchristou](#):
>
> My guess would be that `Pkg.instantiate()` doesn’t really download the artifact, although it should ?

Can you try `pkg> up`? That worked for me

---

<div class="post-metadata">

**Author:** ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Post date:** [February 9, 2022, 3:33pm UTC](https://discourse.julialang.org/t/julia-artifact-was-not-installed-correctly/76038/4 "2022-02-09T15:33:37Z")

</div>

For Julia 1.7.2 and the above example

> [@filchristou](#):
>
> Currently I try to run the example but it also throws an error (didn’t used to):

it still doesn’t work no matter if I do `] up`
