Pkg.jl: Duplicate key `AutoHashEquals`

Created on 26 Feb 2020  路  5Comments  路  Source: JuliaLang/Pkg.jl

Recently I started to get following error when updating a project of mine:

Resolving package versions...
ERROR: Pkg.TOML.ParserError(17686, 17700, "duplicate key `AutoHashEquals`")
Stacktrace:
 [1] parse(::IOStream) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/ext/TOML/src/TOML.jl:37
 [2] #open#271(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{,Tuple{}}}, ::typeof(open), ::typeof(Pkg.TOML.parse), ::String, ::Vararg{String,N} where N) at ./io.jl:298
 [3] open at ./io.jl:296 [inlined]
 [4] parsefile at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/ext/TOML/src/TOML.jl:50 [inlined]
 [5] #parse_toml#23 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Types.jl:202 [inlined]
 [6] #parse_toml at ./none:0 [inlined]
 [7] load_package_data_raw(::Type, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:125
 [8] deps_graph(::Pkg.Types.Context, ::Dict{Base.UUID,String}, ::Dict{Base.UUID,Pkg.Types.VersionSpec}, ::Dict{Base.UUID,Pkg.Types.Fixed}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:399
...

Really lost here. I noticed that there were some changes in General Registry (https://github.com/JuliaRegistries/General/pull/8953) but can't figure out if it is related or not.

I dont think I changed anything manually in Project/Manifest.toml files.

Most helpful comment

The TOML parser should really print out the file + line number it has problems with instead of just a byte offset.

All 5 comments

Could you post your Project + Manifest and the Pkg operation you are trying to do?

Note, that it has some private packages which I can not share.
I am doing up in activated project

Let's try this instead.

Start Julia then run

using Pkg

@eval Pkg.TOML begin
           parsefile(filename::AbstractString) =
               (@info "parsing file $filename";  open(parse, filename, "r"))
       end

It should now print all the files it parses and when it errors the file should have been printed just above it.

Wow.
Ok, I see that it points to Deps.toml file in my custom registry. And this file indeed has duplicated entries of AutoHashEquals.
I could not see that in Atom because just hides duplicated line. It is not shown even in search.
But I can clearly see it in another text editor. Nice.

@KristofferC Thank so much for this!

The TOML parser should really print out the file + line number it has problems with instead of just a byte offset.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KristofferC picture KristofferC  路  4Comments

StefanKarpinski picture StefanKarpinski  路  3Comments

timholy picture timholy  路  4Comments

omus picture omus  路  4Comments

jebej picture jebej  路  3Comments