Registry initialisation problem

I recently downloaded the v1.0.1 build on Linux to a machine where I previously had v0.6 installed.

I seem to have a problem that the registry? wasn’t initialised. Thus I cannot add any packages. I’m not sure if it is a firewall or proxy problem. I’m almost tempted to blame the v1.0.1 zip, but since I don’t see others complaining about the same problem, my guess is the problem is on my side.

julia> Pkg.update()
 Resolving package versions...

(v1.0) pkg> status
    Status `~/.julia/environments/v1.0/Project.toml`

(v1.0) pkg> update
 Resolving package versions...

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

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

Trying to dig a bit:

ls ~/.julia
clones  lib  logs  registries  v0.6

On another machine where I have version 1.0 working I have

ls ~/.julia
clones       compiled     dev          environments lib          logs         packages     registries   v0.6

So it seems the ~/.julia/environments folder is missing.
How do I kick the new Package manage to init?

using Pkg

julia> Pkg.init()
ERROR: UndefVarError: init not defined
Stacktrace:
 [1] getproperty(::Module, ::Symbol) at ./sysimg.jl:13
 [2] top-level scope at none:0

Alternatively how do I check that my proxy settings isn’t stuffed for use with the new package manager?
wget www.julialang.org works, thus wget can get through.
On Julia v0.6, Pkg.update() still works thus the Julia git used by the old package manager still works.

The environments folder will be created on demand and that is not the problem here.

What is the content of the .julia/registries directory?

msr-rx@SAMuRaI-RX1:~/.julia/registries$ ls
General
msr-rx@SAMuRaI-RX1:~/.julia/registries$ ls -la
total 12
drwxrwxr-x 3 msr-rx msr-rx 4096 Oct 26 12:50 .
drwxrwxr-x 8 msr-rx msr-rx 4096 Oct 29 09:31 ..
drwxrwxr-x 3 msr-rx msr-rx 4096 Oct 26 12:50 General
msr-rx@SAMuRaI-RX1:~/.julia/registries$ ls -la General/
total 12
drwxrwxr-x 3 msr-rx msr-rx 4096 Oct 26 12:50 .
drwxrwxr-x 3 msr-rx msr-rx 4096 Oct 26 12:50 ..
drwxrwxr-x 6 msr-rx msr-rx 4096 Oct 26 12:50 .git
msr-rx@SAMuRaI-RX1:~/.julia/registries$ ls -la General/.git/
total 36
drwxrwxr-x 6 msr-rx msr-rx 4096 Oct 26 12:50 .
drwxrwxr-x 3 msr-rx msr-rx 4096 Oct 26 12:50 ..
-rw-rw-r-- 1 msr-rx msr-rx  209 Oct 26 12:50 config
-rw-rw-r-- 1 msr-rx msr-rx   73 Oct 26 12:50 description
-rw-rw-r-- 1 msr-rx msr-rx   23 Oct 26 12:50 HEAD
drwxrwxr-x 2 msr-rx msr-rx 4096 Oct 26 12:50 hooks
drwxrwxr-x 2 msr-rx msr-rx 4096 Oct 26 12:50 info
drwxrwxr-x 4 msr-rx msr-rx 4096 Oct 26 12:50 objects
drwxrwxr-x 4 msr-rx msr-rx 4096 Oct 26 12:50 refs
msr-rx@SAMuRaI-RX1:~/.julia/registries$ cd General/
msr-rx@SAMuRaI-RX1:~/.julia/registries/General$ ls
msr-rx@SAMuRaI-RX1:~/.julia/registries/General$ git status
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)
msr-rx@SAMuRaI-RX1:~/.julia/registries/General$ git pull
remote: Enumerating objects: 208, done.
remote: Counting objects: 100% (208/208), done.
remote: Compressing objects: 100% (185/185), done.
remote: Total 146240 (delta 46), reused 117 (delta 19), pack-reused 146032
Receiving objects: 100% (146240/146240), 18.10 MiB | 193.00 KiB/s, done.
Resolving deltas: 100% (71665/71665), done.
From https://github.com/JuliaRegistries/General
 * [new branch]      kc/fixes   -> origin/kc/fixes
 * [new branch]      kc/rename  -> origin/kc/rename
 * [new branch]      kc/the_great_cap -> origin/kc/the_great_cap
 * [new branch]      master     -> origin/master
 * [new branch]      pdmats     -> origin/pdmats
 * [new branch]      sk/cappening -> origin/sk/cappening
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master

msr-rx@SAMuRaI-RX1:~/.julia/registries/General$ git status
On branch master

Initial commit

nothing to commit (create/copy files and use "git add" to track)

It seems I have a git which points to the initial commit instead of the current latest version. I’m guessing I need to switch to branch master?

Hmm… I wonder how you ended up there. Anyway, you can just remove .julia/registries and Pkg will download a (hopefully correct) version of the General registry when you try to add something.

Thanks, that worked!
Attached is the log in case someone else gets to this state and needs to recover:

msr-rx@SAMuRaI-RX1:~/.julia$ rm -rf registries/
msr-rx@SAMuRaI-RX1:~/.julia$ /opt/julia-1.0.1/bin/julia 
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.1 (2018-09-29)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(v1.0) pkg> status
    Status `~/.julia/environments/v1.0/Project.toml`

(v1.0) pkg> update
   Cloning default registries into /home/msr-rx/.julia/registries
   Cloning registry General from "https://github.com/JuliaRegistries/General.git"
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...

(v1.0) pkg> status
    Status `~/.julia/environments/v1.0/Project.toml`

(v1.0) pkg> add DSP
 Resolving package versions...
 Installed VersionParsing ─── v1.1.3
 Installed Conda ──────────── v1.1.1
 Installed Reexport ───────── v0.2.0
 Installed URIParser ──────── v0.4.0
 Installed AbstractFFTs ───── v0.3.2
 Installed FFTW ───────────── v0.2.4
 Installed BinDeps ────────── v0.8.10
 Installed DSP ────────────── v0.5.1
 Installed Polynomials ────── v0.5.1
 Installed JSON ───────────── v0.19.0
 Installed Compat ─────────── v1.3.0
 Installed SpecialFunctions ─ v0.7.2
 Installed BinaryProvider ─── v0.5.2
  Updating `~/.julia/environments/v1.0/Project.toml`
  [717857b8] + DSP v0.5.1
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [621f4979] + AbstractFFTs v0.3.2
  [9e28174c] + BinDeps v0.8.10
  [b99e7846] + BinaryProvider v0.5.2
  [34da2185] + Compat v1.3.0
  [8f4d0f93] + Conda v1.1.1
  [717857b8] + DSP v0.5.1
  [7a1cc6ca] + FFTW v0.2.4
  [682c06a0] + JSON v0.19.0
  [f27b6e38] + Polynomials v0.5.1
  [189a3867] + Reexport v0.2.0
  [276daf66] + SpecialFunctions v0.7.2
  [30578b45] + URIParser v0.4.0
  [81def892] + VersionParsing v1.1.3
  [2a0f44e3] + Base64 
  [ade2ca70] + Dates 
  [8bb1440f] + DelimitedFiles 
  [8ba89e20] + Distributed 
  [b77e0a4c] + InteractiveUtils 
  [76f85450] + LibGit2 
  [8f399da3] + Libdl 
  [37e2e46d] + LinearAlgebra 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [a63ad114] + Mmap 
  [44cfe95a] + Pkg 
  [de0858da] + Printf 
  [3fa0cd96] + REPL 
  [9a3f8284] + Random 
  [ea8e919c] + SHA 
  [9e88b42a] + Serialization 
  [1a1011a3] + SharedArrays 
  [6462fe0b] + Sockets 
  [2f01184e] + SparseArrays 
  [10745b16] + Statistics 
  [8dfed614] + Test 
  [cf7118a7] + UUIDs 
  [4ec0a83e] + Unicode 
  Building Conda ───────────→ `~/.julia/packages/Conda/uQitS/deps/build.log`
  Building FFTW ────────────→ `~/.julia/packages/FFTW/p7sLQ/deps/build.log`
  Building SpecialFunctions → `~/.julia/packages/SpecialFunctions/fvheQ/deps/build.log`

Yes, I wonder how that happened. My guess is I had a crash during the initial update (I was working over ssh have at times had crashes due to slow network connections resulting in perceived inactivity).

1 Like

Yea, sounds likely. https://github.com/JuliaLang/Pkg.jl/pull/588 should help in situations like this, since after that PR we clone to a temporary directory, and then only if that succeeds copy it to .julia/registries.

Thank you! That works for me as well.
Before that the Julia 1.0 also only used custom registry but not the General one. After deleting and reinstalling the registries it works fine!

1 Like

I am still getting this error after removing the .julia/registry folder

I first get an IOError permission denied (EACCESS) the first time then I get a missing Registry.toml error.

I get this error when i also run “registry add General” which I thought was supposed to be the think that got my the toml in the first place.

I had a similar problem with a different package. @fredrikekre’s solution worked for me, thank you!