-
Notifications
You must be signed in to change notification settings - Fork 841
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
Better error messages for "invariant violated: multiple results when describing installed package" #1408
Comments
The "invariant violated" part of that messages means Stack hit a condition that it didn't expect should ever happen and doesn't know how to deal with. In other words: this is a crashing bug, not a bad error message. The reason this shouldn't happen is that Stack unregisters local packages before rebuilding them, meaning there should only ever be a single version of any package in the local package database, but you've hit a condition where, for some reason, there is more than one. Would you mind sending me the output of First thing I'd try to get past it is rename your |
@borsboom - happen to have an email I can forward that to? Probably has some internal info in there I shouldn't be sharing. |
Sure, you can send it to [email protected]. |
Assuming this condition was caused by a misuse of the custom snapshot feature, perhaps the error message could be expanded to include something like: "If you're using custom snapshots, you may have violated one of stack's invariants and may need to wipe your ~/.stack/snapshots cache directory." |
So it looks like there are two versions of |
That's very possible, maybe that's the source of the issue. Up to you folks whether you want to surface the specific error to the user more explicitly. |
We also ran into this, and we're also using custom snapshots. I found that I changed the version of a package in the snapshot without renaming the snapshot. So perhaps a message to that effect would be a good idea. As for fixing it, for us just re-running the original stack command that caused it fixed the problem. |
This should be resolved in this experimental branch https://github.com/commercialhaskell/stack/tree/863-extensible-snapshots , as a side effect of the work on #863 |
Replaced old label in-progress with "in progress" (see #1491 (comment)). |
I'd be very interested to hear if the #3249 PR for extensible snapshots addresses this, the fact that we cache the snapshot information by a unique hash of the contents of the file would hopefully fix it. |
I just ran into this using Stack 1.4.0, for what it's worth. |
I am closing this issue given the passage of time and because the form of the bug report is different in Stack 2.13.1. |
When running stack install below with a custom snapshot, I get the error that I pasted below. It'd be great if the error was more explicit about what exactly went wrong, and perhaps suggestions as far as how to move forward:
The code that throws this is here: https://github.com/commercialhaskell/stack/blob/master/src/Stack/Build/Execute.hs#L1110
Also, any advice on how to move past this?
The text was updated successfully, but these errors were encountered: