nimble icon indicating copy to clipboard operation
nimble copied to clipboard

nimble refresh fails

Open stoneface86 opened this issue 1 year ago • 8 comments

Recently installed Nim on a new OS install and I cannot get nimble to download the package list via refresh.

Running nimble refresh --verbose results in:

     Info:  Nimble data file "/home/bit/.nimble/nimbledata2.json" has been loaded.
Downloading Official package list
     Trying https://raw.githubusercontent.com/nim-lang/packages/master/packages.json
   Warning: Could not download: Invalid argument
        ... Additional info: Try again
     Trying https://nim-lang.org/nimble/packages.json
packageinfo.nim(180)     fetchList

    Error:  Refresh failed
        ... Could not download: Invalid argument
        ... Additional info: Try again
     Info:  Nimble data file "/home/bit/.nimble/nimbledata2.json" has been saved.

Trying the same command again results in the same output.

I can easily download the urls nimble tries to via wget. Shouldn't be a network issue on my end, I have a typical setup. Is there a way to do this manually for a temporary fix? Hard to use nimble without the official package list.

nimble -v

nimble v0.14.2 compiled at 2023-08-01 01:21:33
git hash: couldn't determine git hash

stoneface86 avatar Oct 06 '23 05:10 stoneface86

This is related to #1139 and has been fixed. Please wait until: a) your distribution updates Nim/Nimble b) or if you use choosenim, update to the devel branch

This can be closed.

xTrayambak avatar Oct 11 '23 14:10 xTrayambak

This is related to #1139 and has been fixed. Please wait until: a) your distribution updates Nim/Nimble b) or if you use choosenim, update to the devel branch

This can be closed.

Still failed with the devel channel

stoneface86 avatar Oct 12 '23 14:10 stoneface86

I can confirm that this bug is still present.

I've built the latest nimble via koch nimble:

$ nimble -v
nimble v0.14.2 compiled at 2023-12-12 07:35:03
git hash: a1fdbe8912a0e3dfd30cef030bbabef218d84687

and I have .nimble folder containing nimbledata2.json and an empty pkgs2 subfolder.

Running nimble refresh produces:

$ nimble refresh --verbose
    Reading config file at /home/miran/.config/nimble/nimble.ini
     Info:  Nimble data file "/home/miran/.nimble/nimbledata2.json" has been loaded.
    Copying local package list
json.nim(1053)           parseFile

    Error:  cannot read from file: /home/miran/.nimble/packages.json
     Info:  Nimble data file "/home/miran/.nimble/nimbledata2.json" has been saved.

narimiran avatar Dec 12 '23 08:12 narimiran

Copying packages.json from my old nimble folder fixes the problem. But this is not something that a user should do.

narimiran avatar Dec 12 '23 08:12 narimiran

Now I tried to delete the .nimble folder to try again.

It creates nimbledata2.json and empty pkgs2 subfolder, mentioned two comments above. It produces warning about missing nimbledata2.json and then it similarly fails:

$ nimble refresh --verbose
    Reading config file at /home/miran/.config/nimble/nimble.ini
  Warning:  Nimble data file "/home/miran/.nimble/nimbledata2.json" is not found.
    Copying local package list
json.nim(1053)           parseFile

    Error:  cannot read from file: /home/miran/.nimble/packages.json
     Info:  Nimble data file "/home/miran/.nimble/nimbledata2.json" has been saved.

narimiran avatar Dec 12 '23 08:12 narimiran

I have no clue why but I cannot reproduce this bug.

xTrayambak avatar Mar 12 '24 07:03 xTrayambak

I have no clue why but I cannot reproduce this bug.

Did you:

  1. Remove old Nimble files? (So there is no existing packages.json)
  2. Install Nimble via koch nimble?

narimiran avatar Mar 12 '24 07:03 narimiran

Yes, I did. I cannot reproduce this bug when I do that.

xTrayambak avatar Mar 12 '24 08:03 xTrayambak