ERROR: METADATA cannot be updated. Resolve problems manually

Power in my building was cut off when I was updating the packages. After power is resumed, I tried to re-update, but was thrown the following errors. What’s quickest way to get this resolved? Uninstall all packages and re-install? Thanks!!

ERROR: METADATA cannot be updated. Resolve problems manually in /home/chobbes/.julia/v0.5/METADATA.
GitError(Code:EMERGECONFLICT, Class:Checkout, 214 conflicts prevent checkout)
 in macro expansion at ./libgit2/error.jl:99 [inlined]
 in #checkout_tree#33(::Base.LibGit2.CheckoutOptions, ::Function, ::Base.LibGit2.GitRepo, ::Base.LibGit2.GitCommit) at ./libgit2/repository.jl:148
 in checkout_tree(::Base.LibGit2.GitRepo, ::Base.LibGit2.GitCommit) at ./libgit2/repository.jl:148
 in ffmerge!(::Base.LibGit2.GitRepo, ::Base.LibGit2.GitAnnotated) at ./libgit2/merge.jl:59
 in #merge!#69(::Base.LibGit2.MergeOptions, ::Base.LibGit2.CheckoutOptions, ::Function, ::Base.LibGit2.GitRepo, ::Array{Base.LibGit2.GitAnnotated,1}, ::Bool) at ./libgit2/merge.jl:132
 in (::Base.#kw##merge!)(::Array{Any,1}, ::Base.#merge!, ::Base.LibGit2.GitRepo, ::Array{Base.LibGit2.GitAnnotated,1}, ::Bool) at ./<missing>:0
 in (::Base.LibGit2.##119#124{String,String,Bool,Base.LibGit2.MergeOptions,Base.LibGit2.CheckoutOptions,Base.LibGit2.GitRepo})(::Base.LibGit2.GitReference) at ./libgit2/libgit2.jl:423
 in with(::Base.LibGit2.##119#124{String,String,Bool,Base.LibGit2.MergeOptions,Base.LibGit2.CheckoutOptions,Base.LibGit2.GitRepo}, ::Base.LibGit2.GitReference) at ./libgit2/types.jl:638
 in (::Base.#kw##merge!)(::Array{Any,1}, ::Base.#merge!, ::Base.LibGit2.GitRepo) at ./<missing>:0
 in (::Base.Pkg.Entry.##35#41)(::Base.LibGit2.GitRepo) at ./pkg/entry.jl:372
 in with(::Base.Pkg.Entry.##35#41, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:638
 in update(::String, ::Set{String}) at ./pkg/entry.jl:354
 in (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at ./pkg/dir.jl:31
 in cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at ./file.jl:59
 in #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N}) at ./pkg/dir.jl:31
 in update() at ./pkg/pkg.jl:210
 in eval(::Module, ::Any) at ./boot.jl:234
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
 in macro expansion at ./REPL.jl:95 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68
 in (::Base.Pkg.Entry.##35#41)(::Base.LibGit2.GitRepo) at ./pkg/entry.jl:378
 in with(::Base.Pkg.Entry.##35#41, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:638
 in update(::String, ::Set{String}) at ./pkg/entry.jl:354
 in (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at ./pkg/dir.jl:31
 in cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at ./file.jl:59
 in #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N}) at ./pkg/dir.jl:31
 in update() at ./pkg/pkg.jl:210

Try

cd /home/chobbes/.julia/v0.5/METADATA
git reset --hard

Thanks for the hint. It almost work fully sucessfully. Yet, I still got the following error about PyPlot. In fact, PyPlot is up-to-date on my machine and I also have had everything else updated. Totally puzzled.

WARNING: Couldn't initialize pyplot.  (might need to install it?)
INFO: To do a standard install of pyplot, copy and run this:

if !Plots.is_installed("PyPlot")
    Pkg.add("PyPlot")
end
withenv("PYTHON" => "") do
    Pkg.build("PyPlot")
end
import Conda
Conda.add("qt=4.8.5")

# now restart julia!


ERROR: LoadError: invalid redefinition of constant pycolors
 in _initialize_backend(::Plots.PyPlotBackend) at /home/chobbes/.julia/v0.5/Plots/src/backends/pyplot.jl:66
 in backend() at /home/chobbes/.julia/v0.5/Plots/src/backends.jl:182
 in Plots.Plot{T<:Plots.AbstractBackend}() at /home/chobbes/.julia/v0.5/Plots/src/types.jl:85
 in #plot#261 at /home/chobbes/.julia/v0.5/Plots/src/plot.jl:50 [inlined]
 in plot(::ApproxFun.Fun{ApproxFun.Chebyshev{ApproxFun.Segment{Float64}},Float64}) at /home/chobbes/.julia/v0.5/Plots/src/plot.jl:46
 in include_from_node1(::String) at ./loading.jl:488
while loading /home/chobbes/Dropbox/scripts/test1.jl, in expression starting on line 10

Can you do using PyPlot on its own from a fresh Julia session?

Same problem here, but I don’t know how it originated. Any tips?

Are you using Julia 0.5.2?

Hello! I had the same problem (laptop battery died while updating) and I tried the above suggestion (git reset --hard in the METADATA folder), but It gave me the following error:

PS C:\Users\sebastian\.julia\v0.6\METADATA> git reset --hard
error: bad signature
fatal: index file corrupt

I am using Julia v0.6.1 on Windows and the error given by Pkg.update() is:

INFO: Updating METADATA...
ERROR: METADATA cannot be updated. Resolve problems manually in C:\Users\sebastian\.julia\v0.6\METADATA.
GitError(Code:ENOTFOUND, Class:Odb, Object not found - no match for id (c8857205f70595998d4e26e76ff892f6dd974773))
macro expansion at .\libgit2\error.jl:99 [inlined]
#fetch#41(::Base.LibGit2.FetchOptions, ::String, ::Function, ::Base.LibGit2.GitRemote, ::Array{AbstractString,1}) at .\libgit2\remote.jl:226
(::Base.LibGit2.#kw##fetch)(::Array{Any,1}, ::Base.LibGit2.#fetch, ::Base.LibGit2.GitRemote, ::Array{AbstractString,1}) at .\<missing>:0
#fetch#84(::String, ::String, ::Array{AbstractString,1}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::Base.LibGit2.GitRepo) at .\libgit2\libgit2.jl:312
(::Base.Pkg.Entry.##33#39)(::Base.LibGit2.GitRepo) at .\pkg\entry.jl:371
with(::Base.Pkg.Entry.##33#39, ::Base.LibGit2.GitRepo) at .\libgit2\types.jl:608
update(::String, ::Set{String}) at .\pkg\entry.jl:354
(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at .\pkg\dir.jl:36
cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at .\file.jl:59
#cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at .\pkg\dir.jl:36
update() at .\pkg\pkg.jl:228
eval(::Module, ::Any) at .\boot.jl:235
eval_user_input(::Any, ::Base.REPL.REPLBackend) at .\REPL.jl:66
macro expansion at .\REPL.jl:97 [inlined]
(::Base.REPL.##1#2{Base.REPL.REPLBackend})() at .\event.jl:73
Stacktrace:
 [1] (::Base.Pkg.Entry.##33#39)(::Base.LibGit2.GitRepo) at .\pkg\entry.jl:378
 [2] with(::Base.Pkg.Entry.##33#39, ::Base.LibGit2.GitRepo) at .\libgit2\types.jl:608
 [3] update(::String, ::Set{String}) at .\pkg\entry.jl:354
 [4] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at .\pkg\dir.jl:36
 [5] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at .\file.jl:59
 [6] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at .\pkg\dir.jl:36
 [7] update() at .\pkg\pkg.jl:228

did anyone managed to solve this?

I get this on OSX and Julia 0.6.2

julia> Pkg.update()
INFO: Updating METADATA...
ERROR: METADATA cannot be updated. Resolve problems manually in /Users/amrods/.julia/v0.6/METADATA.
GitError(Code:ENOTFOUND, Class:Odb, Object not found - no match for id (a1306cc82d07a8f3b3334bc84d1ce92fdec90317))
macro expansion at ./libgit2/error.jl:99 [inlined]
#fetch#41(::Base.LibGit2.FetchOptions, ::String, ::Function, ::Base.LibGit2.GitRemote, ::Array{AbstractString,1}) at ./libgit2/remote.jl:226
(::Base.LibGit2.#kw##fetch)(::Array{Any,1}, ::Base.LibGit2.#fetch, ::Base.LibGit2.GitRemote, ::Array{AbstractString,1}) at ./<missing>:0
#fetch#84(::String, ::String, ::Array{AbstractString,1}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::Base.LibGit2.GitRepo) at ./libgit2/libgit2.jl:312
(::Base.Pkg.Entry.##33#39)(::Base.LibGit2.GitRepo) at ./pkg/entry.jl:371
with(::Base.Pkg.Entry.##33#39, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:608
update(::String, ::Set{String}) at ./pkg/entry.jl:354
(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at ./pkg/dir.jl:36
cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at ./file.jl:70
#cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at ./pkg/dir.jl:36
update() at ./pkg/pkg.jl:228
eval(::Module, ::Any) at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib:?
eval_user_input(::Any, ::Base.REPL.REPLBackend) at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib:?
macro expansion at ./REPL.jl:97 [inlined]
(::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73
Stacktrace:
 [1] (::Base.Pkg.Entry.##33#39)(::Base.LibGit2.GitRepo) at ./pkg/entry.jl:378
 [2] with(::Base.Pkg.Entry.##33#39, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:608
 [3] update(::String, ::Set{String}) at ./pkg/entry.jl:354
 [4] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at ./pkg/dir.jl:36
 [5] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at ./file.jl:70
 [6] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at ./pkg/dir.jl:36
 [7] update() at ./pkg/pkg.jl:228

My solution was to delete the .julia folder and start fresh.

Came across the same problem again. This time with JuliaPro (v0.6.2). The old trick doesn’t work any more, neither do other methods mentioned above. Any other workaround? Thanks!!

After doing a hard reset at the terminal

cd /home/chobbes/.julia/v0.5/METADATA
git reset --hard

I still get

Pkg.update()
INFO: Updating METADATA...
ERROR: METADATA cannot be updated. Resolve problems manually in /home/chobbes/.julia/v0.6/METADATA.
GitError(Code:ERROR, Class:Net, curl error: Failed to connect to 127.0.0.1 port 43743: Connection refused
)
macro expansion at ./libgit2/error.jl:99 [inlined]
#fetch#41(::Base.LibGit2.FetchOptions, ::String, ::Function, ::Base.LibGit2.GitRemote, ::Array{AbstractString,1}) at ./libgit2/remote.jl:226
(::Base.LibGit2.#kw##fetch)(::Array{Any,1}, ::Base.LibGit2.#fetch, ::Base.LibGit2.GitRemote, ::Array{AbstractString,1}) at ./<missing>:0
#fetch#84(::String, ::String, ::Array{AbstractString,1}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::Base.LibGit2.GitRepo) at ./libgit2/libgit2.jl:312
(::Base.Pkg.Entry.##33#39)(::Base.LibGit2.GitRepo) at ./pkg/entry.jl:371
with(::Base.Pkg.Entry.##33#39, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:608
update(::String, ::Set{String}) at ./pkg/entry.jl:354
(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at ./pkg/dir.jl:36
cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at ./file.jl:70
#cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at ./pkg/dir.jl:36
update() at ./pkg/pkg.jl:228
macro expansion at /home/chobbes/.julia/v0.6/Atom/src/repl.jl:118 [inlined]
anonymous at ./<missing>:?
eval(::Module, ::Any) at ./boot.jl:235
eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:66
macro expansion at ./REPL.jl:97 [inlined]
(::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73
Stacktrace:
 [1] (::Base.Pkg.Entry.##33#39)(::Base.LibGit2.GitRepo) at ./pkg/entry.jl:378
 [2] with(::Base.Pkg.Entry.##33#39, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:608
 [3] update(::String, ::Set{String}) at ./pkg/entry.jl:354
 [4] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at ./pkg/dir.jl:36
 [5] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at ./file.jl:70
 [6] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at ./pkg/dir.jl:36
 [7] update() at ./pkg/pkg.jl:228
 [8] macro expansion at /home/chobbes/.julia/v0.6/Atom/src/repl.jl:118 [inlined]
 [9] anonymous at ./<missing>:?
1 Like

I also have the METADATA cannot be updated problem with a fresh install of JuliaPro v0.6.2 on Windows 7. In my case the problem is with git certificates:

julia> Pkg.update()
INFO: Updating METADATA...
ERROR: METADATA cannot be updated. Resolve problems manually in C:\Users\Paul\AppData\Local\JuliaPro-0.6.2.2\pkgs-0.6.2.
2\v0.6\METADATA.
GitError(Code:ECERTIFICATE, Class:OS, user cancelled certificate check: )
macro expansion at .\libgit2\error.jl:99 [inlined]

Any help would be greatly appreciated.

Just to be sure the problem is not caused by some leftovers from previous installations, I uninstalled JuliaPro and manually removed all folders with julia in their name (over 2GB) and reinstalled. The problem still remains:

julia> Pkg.update()
INFO: Updating METADATA...
ERROR: METADATA cannot be updated. Resolve problems manually in C:\Users\Paul\AppData\Local\JuliaPro-0.6.2.2\pkgs-0.6.2.
2\v0.6\METADATA.
GitError(Code:ECERTIFICATE, Class:OS, user cancelled certificate check: )
macro expansion at .\libgit2\error.jl:99 [inlined]
#fetch#41(::Base.LibGit2.FetchOptions, ::String, ::Function, ::Base.LibGit2.GitRemote, ::Array{AbstractString,1}) at .\l
ibgit2\remote.jl:226
(::Base.LibGit2.#kw##fetch)(::Array{Any,1}, ::Base.LibGit2.#fetch, ::Base.LibGit2.GitRemote, ::Array{AbstractString,1})
at .\<missing>:0
#fetch#84(::String, ::String, ::Array{AbstractString,1}, ::Nullable{Base.LibGit2.AbstractCredentials}, ::Function, ::Bas
e.LibGit2.GitRepo) at .\libgit2\libgit2.jl:312
(::Base.Pkg.Entry.##33#39)(::Base.LibGit2.GitRepo) at .\pkg\entry.jl:371
with(::Base.Pkg.Entry.##33#39, ::Base.LibGit2.GitRepo) at .\libgit2\types.jl:608
update(::String, ::Set{String}) at .\pkg\entry.jl:354
(::Base.Pkg.Dir.##3#6{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at .\pkg\dir.jl:33
cd(::Base.Pkg.Dir.##3#6{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at .\file.jl:59
withenv(::Base.Pkg.Dir.##2#5{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}},String}, ::Pair{String,String
}, ::Vararg{Pair{String,String},N} where N) at .\env.jl:157
#cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at .\pkg\dir.jl:32
update() at .\pkg\pkg.jl:228
eval(::Module, ::Any) at .\boot.jl:235
eval_user_input(::Any, ::Base.REPL.REPLBackend) at .\REPL.jl:66
macro expansion at .\REPL.jl:97 [inlined]
(::Base.REPL.##1#2{Base.REPL.REPLBackend})() at .\event.jl:73
Stacktrace:
 [1] (::Base.Pkg.Entry.##33#39)(::Base.LibGit2.GitRepo) at .\pkg\entry.jl:378
 [2] with(::Base.Pkg.Entry.##33#39, ::Base.LibGit2.GitRepo) at .\libgit2\types.jl:608
 [3] update(::String, ::Set{String}) at .\pkg\entry.jl:354
 [4] (::Base.Pkg.Dir.##3#6{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at .\pkg\dir.jl:33
 [5] cd(::Base.Pkg.Dir.##3#6{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at .\file.jl:59
 [6] withenv(::Base.Pkg.Dir.##2#5{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}},String}, ::Pair{String,S
tring}, ::Vararg{Pair{String,String},N} where N) at .\env.jl:157
 [7] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at .\pkg\dir.jl:32
 [8] update() at .\pkg\pkg.jl:228

This looks like a known Windows problem with the TLS (IIRC) version because Git now requires the latest version. There was a thread earlier about this issue and there is a Microsoft knowledge base article pointing to an update and also including a quick fixme file that usually works.

I noticed these prerequisites on Julia downloads page, but my Windows claims that these updates (Update to enable TLS 1.1 and TLS 1.2 as a default secure protocols in WinHTTP in Windows and Windows Management Framework 5.1) are already installed.

However Microsoft notes that various things such as adding language packs can negate these updates. In my case, I found I had to reapply the quick fix they provide near the bottom of the relevant KB.

The “easy fix” fixed it. Just installing the update was not sufficient. Thank you for the clue.

Glad it worked for you. That issue had me pulling out what little hair I have left for a bit!

I had a similar problem with JuliaPro 0.6.3.1 on Windows 7 Pro. “easy fix” didn’t seem to work. Perhaps due to my locale…?
But, Pkg.update() worked today somehow!

1 Like