Pkg instantiate fails

Hi
I copied a project.toml and a manifest.toml from one computer to another

On my ‘new’ computer .julia\registries is somehow empty.

I get the error below. How can I fix that?
Can I update or define a registry somehow?

(Julia) pkg> st
    Status `C:\Users\bernhard.konig\ASync\home\Code\Julia\Project.toml`
→ [1520ce14] AbstractTrees v0.1.0+ #master [https://github.com/Keno/AbstractTrees.jl.git]
→ [6e4b80f9] BenchmarkTools v0.3.1
→ [00ebfdb7] CSTParser v0.3.5+ #v0.7compat [https://github.com/ZacLN/CSTParser.jl.git]
→ [336ed68f] CSV v0.2.5+ #master [https://github.com/JuliaData/CSV.jl.git]
→ [34da2185] Compat v0.68.0
→ [a2441757] Coverage v0.5.3
→ [a93c6f00] DataFrames v0.11.6
→ [31c24e10] Distributions v0.15.0+ #master [https://github.com/JuliaStats/Distributions.jl.git]
→ [5789e2e9] FileIO v0.9.0+ #master [https://github.com/JuliaIO/FileIO.jl.git]
→ [bc5e4493] GitHub v4.0.0
→ [cd3eb016] HTTP v0.6.12
→ [a4bce56a] Iterators v0.3.1
→ [033835bb] JLD2 v0.0.5+ #master [https://github.com/simonster/JLD2.jl.git]
→ [7f8f8fb0] LearnBase v0.1.6
→ [4345ca2d] Loess v0.3.0
→ [739be429] MbedTLS v0.5.11+ #master [https://github.com/JuliaWeb/MbedTLS.jl.git]
→ [4d1e1d77] Nullables v0.0.5
→ [a15396b6] OnlineStats v0.17.4+ #master [https://github.com/joshday/OnlineStats.jl.git]
→ [c46f51b8] ProfileView v0.3.0
→ [92933f4c] ProgressMeter v0.5.5
→ [438e738f] PyCall v1.16.1+ #master [https://github.com/JuliaPy/PyCall.jl.git]
→ [295af30f] Revise v0.3.0+ #master [https://github.com/timholy/Revise.jl.git]
→ [0aa819cd] SQLite v0.5.0
→ [2913bbd2] StatsBase v0.23.0
→ [4c63d2b9] StatsFuns v0.6.0+ #master [https://github.com/JuliaStats/StatsFuns.jl.git]
  [9a3f8284] Random
┌ Warning: Some packages (indicated with a red arrow) are not downloaded, use `instantiate` to instantiate the current environment
└ @ Pkg.Display Display.jl:182

(Julia) pkg> instantiate
ERROR: AssertionError: haskey(hashes, uuid)
Stacktrace:
 [1] version_data!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Operations.jl:346
 [2] #instantiate#52(::Nothing, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\b
uild\usr\share\julia\stdlib\v0.7\Pkg\src\API.jl:514
 [3] (::getfield(Pkg.API, Symbol("#kw##instantiate")))(::NamedTuple{(:manifest,),Tuple{Nothing}}, ::typeof(Pkg.API.instantiate), ::Pkg.Types.Context) at .\<missing>:0
 [4] do_instantiate!(::Pkg.Types.Context, ::Array{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Command, Pkg.REPLMode.Option, Pkg.REPLMode.Rev},1}) at C:\cygwin\home\Administrator\buildbot\worker
\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:776
 [5] #invokelatest#1 at .\essentials.jl:670 [inlined]
 [6] invokelatest at .\essentials.jl:669 [inlined]
 [7] do_cmd!(::Array{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Command, Pkg.REPLMode.Option, Pkg.REPLMode.Rev},1}, ::REPL.LineEditREPL) at C:\cygwin\home\Administrator\buildbot\worker\package
_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:275
 [8] #do_cmd#8(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:235
 [9] do_cmd at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:232 [inlined]
 [10] (::getfield(Pkg.REPLMode, Symbol("##27#30")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at C:\cygwin\home\Administrator\bui
ldbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:950
 [11] top-level scope

I think the new package manager is mainly for working with independent projects. You should copy the whole project to your new computer, cd to the project folder, and run instantiate. Every project can be treated as a single isolated environment, like a .sln solution file or .xxxxproj project file in other language/IDEs. It’s not necessary to use registries for local projects.

Thank you. I can do that.
Still my installation seems broken, even with a new project.toml I get an error (see below)
Any ideas?

julia> pwd()
"C:\\temp"

(v0.7) pkg> init
Initialized project at C:\temp\Project.toml

(temp) pkg> add Revise
ERROR: The following package names could not be resolved:
 * Revise (not found in project, manifest or registry)
Please specify by known `name=uuid`.

(temp) pkg>

I cannot reproduce your issue on my machine with a clean package environment:

# start julia with a clean package environment
➜  temp JULIA_DEPOT_PATH=/Users/gnimuc/test julia
# in julia:
julia> pwd()
"/Users/gnimuc/temp"
(v0.7) pkg> init
Initialized project at /Users/gnimuc/temp/Project.toml

(temp) pkg> add Revise
   Cloning default registries into /Users/gnimuc/test/registries
   Cloning registry Uncurated from "https://github.com/JuliaRegistries/Uncurated.git"
  Updating registry at `~/test/registries/Uncurated`
  Updating git-repo `https://github.com/JuliaRegistries/Uncurated.git`
 Resolving package versions...
Downloaded Compat ───────── v0.68.0
Downloaded DataStructures ─ v0.8.3
Downloaded Revise ───────── v0.4.2
  Updating `Project.toml`
  [295af30f] + Revise v0.4.2
  Updating `Manifest.toml`

I’m not sure whether this is a Windows issue or not, but I guess you could clean up .julia\ folder and see what’s going on.

1 Like

Delete the .julia/registries folder and try again.

We will have to detect this case better.

2 Likes

thank you.

I still get an error. Unfortunately I have almost no knowledge about git. Maybe the server fingerprint ist not stored/trusted (see below)

(v0.7) pkg> instantiate
   Cloning default registries into C:\Users\bernhard.konig\.julia\registries
   Cloning registry Uncurated from "https://github.com/JuliaRegistries/Uncurated.git"
ERROR: GitError(Code:ECERTIFICATE, Class:Net, unknown certificate check failure)
Stacktrace:
 [1] uv_error at .\libuv.jl:80 [inlined]
 [2] #chmod#16(::Bool, ::Function, ::String, ::UInt16) at .\file.jl:813
 [3] chmod at .\file.jl:812 [inlined]
 [4] #rm#9(::Bool, ::Bool, ::Function, ::String) at .\file.jl:250
 [5] #rm at .\<missing>:0 [inlined]
 [6] #clone#2(::String, ::Base.Iterators.Pairs{Symbol,LibGit2.CachedCredentials,Tuple{Symbol},NamedTuple{(:credentials,),Tuple{LibGit2.CachedCredentials}}}, ::Function, ::String, ::String)
n\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\GitTools.jl:72
 [7] #registries#32(::Bool, ::Function) at .\<missing>:0
 [8] registries at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Types.jl:1015 [inlined]
 [9] update_registry(::Pkg.Types.Context) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\API.jl:70
 [10] #instantiate#52(::Nothing, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context) at C:\cygwin\home\Administrator\buildbot\worker\pac
build\usr\share\julia\stdlib\v0.7\Pkg\src\API.jl:491
 [11] (::getfield(Pkg.API, Symbol("#kw##instantiate")))(::NamedTuple{(:manifest,),Tuple{Nothing}}, ::typeof(Pkg.API.instantiate), ::Pkg.Types.Context) at .\<missing>:0
 [12] do_instantiate!(::Pkg.Types.Context, ::Array{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Command, Pkg.REPLMode.Option, Pkg.REPLMode.Rev},1}) at C:\cygwin\home\Administrator\bui
r\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:776
 [13] #invokelatest#1 at .\essentials.jl:670 [inlined]
 [14] invokelatest at .\essentials.jl:669 [inlined]
 [15] do_cmd!(::Array{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Command, Pkg.REPLMode.Option, Pkg.REPLMode.Rev},1}, ::REPL.LineEditREPL) at C:\cygwin\home\Administrator\buildbot\wo
e_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:275
 [16] #do_cmd#8(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:235
 [17] do_cmd at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:232 [inlined]
 [18] (::getfield(Pkg.REPLMode, Symbol("##27#30")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at C:\cygwin\home\Admini
ldbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:950
 [19] top-level scope

I did a manual git clone of the registry (with tortoise git). This worked fine (and I did not need to ‘accept any ssh key’).

this brings me slightly further, but it is still not working.

Does julia come with git?
In my case, I think I first installed Tortoise Git, then Julia, then Git itself.

(v0.7) pkg> instantiate
  Updating registry at `C:\Users\bernhard.konig\.julia\registries\Uncurated`
  Updating git-repo `https://github.com/JuliaRegistries/Uncurated.git`
┌ Warning: Some registries failed to update:
│     - C:\Users\bernhard.konig\.julia\registries\Uncurated - failed to fetch from repo
└ @ Pkg.API API.jl:116
   Cloning git-repo `https://github.com/JuliaStats/StatsFuns.jl.git`
ERROR: GitError(Code:ECERTIFICATE, Class:Net, unknown certificate check failure)
Stacktrace:
 [1] uv_error at .\libuv.jl:80 [inlined]
 [2] #chmod#16(::Bool, ::Function, ::String, ::UInt16) at .\file.jl:813
 [3] chmod at .\file.jl:812 [inlined]
 [4] #rm#9(::Bool, ::Bool, ::Function, ::String) at .\file.jl:250
 [5] #rm at .\<missing>:0 [inlined]
 [6] #clone#2(::Nothing, ::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol},NamedTuple{(:isbare, :credentials),Tuple{Bool,LibGit2.CachedCredentials}}}, ::Function, ::String, ::String) at C:\cygwin
\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\GitTools.jl:72
 [7] #handle_repos_add!#16(::Bool, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at .\<missing>:0
 [8] #handle_repos_add! at .\<missing>:0 [inlined]
 [9] #instantiate#52(::Nothing, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\b
uild\usr\share\julia\stdlib\v0.7\Pkg\src\API.jl:519
 [10] (::getfield(Pkg.API, Symbol("#kw##instantiate")))(::NamedTuple{(:manifest,),Tuple{Nothing}}, ::typeof(Pkg.API.instantiate), ::Pkg.Types.Context) at .\<missing>:0
 [11] do_instantiate!(::Pkg.Types.Context, ::Array{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Command, Pkg.REPLMode.Option, Pkg.REPLMode.Rev},1}) at C:\cygwin\home\Administrator\buildbot\worke
r\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:776
 [12] #invokelatest#1 at .\essentials.jl:670 [inlined]
 [13] invokelatest at .\essentials.jl:669 [inlined]
 [14] do_cmd!(::Array{Union{Pkg.Types.VersionRange, String, Pkg.REPLMode.Command, Pkg.REPLMode.Option, Pkg.REPLMode.Rev},1}, ::REPL.LineEditREPL) at C:\cygwin\home\Administrator\buildbot\worker\packag
e_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:275
 [15] #do_cmd#8(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:235
 [16] do_cmd at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:232 [inlined]
 [17] (::getfield(Pkg.REPLMode, Symbol("##27#30")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at C:\cygwin\home\Administrator\bui
ldbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:950
 [18] top-level scope

Ok.
Eventually Google and this easy fix solved my issue Update to enable TLS 1.1 and TLS 1.2 as default secure protocols in WinHTTP in Windows

see also Errors for Git / Pkg

thank you all.

1 Like

Worked for me on Windows 10, thanks for a clue!