Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimble refresh fails #1149

Open
stoneface86 opened this issue Oct 6, 2023 · 8 comments
Open

nimble refresh fails #1149

stoneface86 opened this issue Oct 6, 2023 · 8 comments

Comments

@stoneface86
Copy link
Contributor

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
@xTrayambak
Copy link
Contributor

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.

ringabout added a commit to nim-lang/Nim that referenced this issue Oct 11, 2023
Issues like nim-lang/nimble#1149 keep popping up. One way or another, we should alleviate the pain.
Araq pushed a commit to nim-lang/Nim that referenced this issue Oct 11, 2023
Issues like nim-lang/nimble#1149 keep popping
up. One way or another, we should alleviate the pain.

Finally, we should consider
nim-lang/nimble#1141 (comment) as
an option using some kind of cron script to update
https://nim-lang.org/nimble/packages.json. It's turning into a really
annoying problem.
@stoneface86
Copy link
Contributor Author

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

@narimiran
Copy link
Member

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
Copy link
Member

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

@narimiran
Copy link
Member

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.

@xTrayambak
Copy link
Contributor

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

@narimiran
Copy link
Member

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?

@xTrayambak
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants