Pkg.jl: SystemError: opening file "C:\\Users\\justi\\.julia\\registries\\General\\Registry.toml": No such file or directory

Created on 12 Feb 2020  ·  27Comments  ·  Source: JuliaLang/Pkg.jl

If you have a question please search or post to our Discourse site: https://discourse.julialang.org.
We use the GitHub issue tracker for bug reports and feature requests only.

If you're submitting a bug report, be sure to include as much relevant information as
possible, including a minimal reproducible example and the output of versioninfo().
If you're experiencing a problem with a particular package, open an issue on that
package's repository instead.
When i type Pkg.add("IJulia")
it returns: SystemError: opening file "C:\Users\justi\.julia\registries\General\Registry.toml": No such file or directory

Thanks for contributing to the Julia project!

Most helpful comment

Can you try to delete C:\Users\justi\.julia\registries\General and try again?

All 27 comments

Can you try to delete C:\Users\justi\.julia\registries\General and try again?

it works, thanks for solving my problem

获取 Outlook for iOShttps://aka.ms/o0ukef


发件人: Fredrik Ekre notifications@github.com
发送时间: Wednesday, February 12, 2020 1:11:49 AM
收件人: JuliaLang/Pkg.jl Pkg.jl@noreply.github.com
抄送: Tong, Jiacheng jiacheng-tong@uiowa.edu; Author author@noreply.github.com
主题: [External] Re: [JuliaLang/Pkg.jl] SystemError: opening file "C:\Users\justi\.julia\registries\General\Registry.toml": No such file or directory (#1667)

Can you try to delete C:Usersjusti.juliaregistriesGeneral and try again?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/JuliaLang/Pkg.jl/issues/1667?email_source=notifications&email_token=AI64ZNYUEB42DY7RGAOD4E3RCOOLLA5CNFSM4KTT5VUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELPVZ5Y#issuecomment-585063671, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AI64ZN5LGJJ23V47ENVPOITRCOOLLANCNFSM4KTT5VUA.

Perhaps we can detect this ourselves and re-download General if this is the case?

Can you try to delete C:\Users\justi\.julia\registries\General and try again?

when you say delete how do you mean facing the same issue over here when tried to add the general after removing it since DataFrames was having issues with versioning

julia> Pkg.Registry.add("General")
Cloning registry from "https://github.com/JuliaRegistries/General.git"
ERROR: SystemError: opening file "C:\Users\andrewa\.julia\registries\General\Registry.toml": No such file or directory
Stacktrace:
[1] systemerror(::String, ::Int32; extrainfo::Nothing) at .error.jl:168
[2] #systemerror#50 at .error.jl:167 [inlined]
[3] systemerror at .error.jl:167 [inlined]
[4] open(::String; read::Bool, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing) at .iostream.jl:254
[5] open(::String, ::String) at .iostream.jl:310
[6] open(::typeof(Pkg.TOML.parse), ::String, ::Vararg{String,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at .io.jl:296
[7] open at .io.jl:296 [inlined]
[8] parsefile at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgextTOMLsrcTOML.jl:50 [inlined]
[9] read_registry(::String; cache::Bool) at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcTypes.jl:974
[10] read_registry at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcTypes.jl:969 [inlined]
[11] (::Pkg.Types.var"#92#95"{Pkg.Types.Context,String,Pkg.Types.RegistrySpec})(::String) at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcTypes.jl:946
[12] mktempdir(::Pkg.Types.var"#92#95"{Pkg.Types.Context,String,Pkg.Types.RegistrySpec}, ::String; prefix::String) at .file.jl:682
[13] mktempdir at .file.jl:680 [inlined] (repeats 2 times)
[14] clone_or_cp_registries(::Pkg.Types.Context, ::Array{Pkg.Types.RegistrySpec,1}, ::String) at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcTypes.jl:911
[15] clone_or_cp_registries at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcTypes.jl:905 [inlined]
[16] #add#6 at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcRegistry.jl:29 [inlined]
[17] add at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcRegistry.jl:28 [inlined]
[18] #add#5 at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcRegistry.jl:26 [inlined]
[19] add at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcRegistry.jl:26 [inlined]
[20] add(::Array{String,1}; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcRegistry.jl:25
[21] add at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcRegistry.jl:25 [inlined]
[22] #add#1 at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcRegistry.jl:24 [inlined]
[23] add(::String) at D:buildbotworkerpackage_win64buildusrsharejuliastdlibv1.4PkgsrcRegistry.jl:24

I see this error too from time to time on Windows computers (last time on a Windows computer with julia 1.5.1 from a student). Removing C:\Users\<name>\.julia\registries\General always resolved the problem, but it would be nice to know the root cause of it. Unfortunately, this issue is very difficult to reproduce.

Here are other reports:
https://discourse.julialang.org/t/unable-to-install-ijulia/47160/2
https://github.com/JuliaLang/julia/issues/37521

Is there any information that would be helpful to collect the next time this issue shows up? Maybe Linux and Mac handle better transient network issues when doing a git checkout than Windows?

it would be nice to know the root cause of it.

Windows or some program on your computer deletes it.

Here is another example where Windows deleted folders even: https://github.com/JuliaLang/Pkg.jl/issues/2017#issue-700367297, and here are a bunch more https://discourse.julialang.org/search?q=Registry.toml%22%3A%20No%20such%20file%20or%20directory

It's absolutely bananas that Windows just deletes stuff, but that seems to be what happens.

Yesterday, I had the first time seen this error (/Users/admin/.julia/registries/General/Registry.toml": No such file or directory while installing the first julia package; julia 1.5.1, I think) on a student's Mac. I thought that this problem was Windows specific.

I had a look at the code, and it is really strange:

The error is from a later stage after the registry has been copied to the correct place.

Hi, such things seem to happen also outside of Julia...

https://www.tenforums.com/general-support/121122-empty-folders-disappearing.html
https://www.tenforums.com/general-support/121891-downloads-folder-windows-10-1809-a.html
https://techcommunity.microsoft.com/t5/storage-at-microsoft/windows-10-and-storage-sense/ba-p/428270

There seems to be a thing like StorageSense which may be involved. Also some people report about
deactivating AV software like avast. No clear picture though.

Disclaimer: I am not a windows user, just do it occasionally in a VM - for the odd .docx and for testing Julia packges, so all of this was just googled.

I hear about this problem very often from new Pluto users. I think the most common cause is:

  1. Do a pkg> command
  2. It starts updating the registry without a progress bar
  3. After X minutes, I assume that something is broken and I Ctrl+C

The result is either this issue, or an incomplete registry ("package not found" errors) - both have unhelpful error messages.

But using the tarball directly in future Pkg version will also solve this issue, right?

So it seems that there are possibly two problems here: windows possibly deleting files, and slow communication regarding packages. @fonsp: did you experiment with switching of the package server comunication by unsetting JULIA_PKG_SERVER ?

EDIT: May be also related to https://github.com/JuliaLang/Pkg.jl/pull/2175 - it seems that the default for windows is being reset to git cloning.

I'm also getting this

one of my students got this error on Mac:

SystemError: opening file "/Users/sarahutton/.julia/registries/General/Registry.toml": No such file or directory

Hi, I got the same error message even though I had my StorageSense turned off. But I was able to succesfully run the Pkg.add() command after adding, the "/.julia/registries/General" folder to my windows defender exclusions.

to give an idea of prevalence: in my class of 86, ~6 students had this problem, where they needed to delete the General folder.

Is what's happening here something like this?

  1. User initializes the registry, either by their first pkg> add or explicitly pkg> registry add
  2. Sees things going slowly so ctrl-c's, which may occur during the cp here (which is a mv on more recent julia) https://github.com/JuliaLang/Pkg.jl/blob/aaf4e6e8ab784f7435c1bdc56832bc03e014dedb/src/Types.jl#L1027
  3. The cp didn't get as far as copying Registry.toml over, which on windows happens alphabetically after the R dir has copied
  4. The user tries again to add etc.
  5. The logic here checks that the registry dir exists but not the Registry.toml file specifically
    https://github.com/JuliaLang/Pkg.jl/blob/aaf4e6e8ab784f7435c1bdc56832bc03e014dedb/src/Types.jl#L1015
  6. Goes on to open the nonexistent Registry.toml file

Full section (this is from Pkg that shipped with 1.5.1 so I could line up with the trace in https://discourse.julialang.org/t/unable-to-install-ijulia/47160)
https://github.com/JuliaLang/Pkg.jl/blob/aaf4e6e8ab784f7435c1bdc56832bc03e014dedb/src/Types.jl#L1013-L1029

If that is what's happening, this might be a fix: https://github.com/JuliaLang/Pkg.jl/pull/2349

This appears to be fixed in 1.6 already, by changing from cp-ing to mv-ing the registry from temp

Just to let you all know, It is not only Windows/Mac issue. I just had it on Linux as well.

That supports the theory that it's the cp being slow and getting interrupted half way through since that isn't Windows-specific (although it's worse on Windows since file operations are so slow there).

Nightly will still do this if a registry dir is present but missing a Registry.toml, which may happen if people use older and newer julia versions together.
This might be a better check to make https://github.com/JuliaLang/Pkg.jl/pull/2356

This also happened to me after Ctrl-C on a pkg> add command, I'm on Windows. Seems you all pretty much have it figured out, and the workaround isn't so bad in the meantime. Thanks for the help!

The issue also happened to me after I shut down installing packages, deleting the General folder actually works for me, thanks.

Can you try to delete C:\Users\justi\.julia\registries\General and try again?

wonderfull

Can you try to delete C:\Users\justi\.julia\registries\General and try again?

This did the trick

Was this page helpful?
0 / 5 - 0 ratings