-
Notifications
You must be signed in to change notification settings - Fork 702
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
Error: Could not read index. Did you call 'checkForUpdates'? #5574
Comments
@AndreasPK I've got a hunch about why this is happening... next time this happens, can you try removing only the |
Will do if I remember next time! |
I am also having the same issue, does anyone have an idea? Whenever I run cabal new-repl I get the same response: cabal: Could not read index. Did you 'checkForUpdates'? |
I had forgotten about this. Iirc you can just delete the .cabal folder as a workaround. |
Sorry I don't believe that helped I tried "cabal update" afterwards and the same error message popped up. Unfortunately I have to use the command "cabal tests" which doesn't work either. I apologize if this is not clear. |
Hi, Do you know how to delete the .cabal folder in terminal ? Thanks! |
On Linux: |
I've just installed Haskell Platform 8.6.5 in Windows 10 (latest download from https://www.haskell.org/platform/), and when trying "cabal new-update" it answers with the same message reported here. Downloading the latest package list from hackage.haskell.org I have found no other question regarding this issue, and no solutions so far. |
@fidel-ml could you share the output of Sometimes it is related with the way cabal uses to access internet, by default |
The output of the command is:
Thanks for the help! It seems that I do not have wget... |
I have installed wget. But the error message is the same. The new output is:
I then have checked |
Do you have |
You can also try deleting |
I delete all the 01-index* files, and it started downloading things...
|
@fidel-ml great! |
It worked! |
Grr. Both |
This just happened to me, triggered by hitting Ctrl+C. It seems Cabal does not handle cancellation at any time correctly. Usually that happens when programs do not use atomic writes/renames, but in this case it is that a certain file is simply not present: In my case,
I suspect that somewhere in Cabal there is an assumption that when one of the index-related files is present, all of them are present (which cannot be guaranteed). Probably Cabal should treat any of the files missing as having to do a re-download. |
Same experience as nh2, seemed to be triggered by doing a ctrl-c. rm -fr ~/.cabal doesn't seem like a good workaround as it deletes ~/.cabal/store. How do I then get that directory tree back? |
Delete just |
For future reference, this can also happen if you deleted |
This seems like something aimed at users of cabal-the-library and gives zero indication on how to fix this.
It's rare enough that I don't mind it (that much). But it's not the first time I've run into this issue so
At least the error should give an indication on how to get cabal working again.
Eg deleting the local cabal folder fixed the issue.
edit by @23Skidoo: Current workaround is to delete the
01-index.*
files and retrycabal update
.The text was updated successfully, but these errors were encountered: