-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Change error message when inserting duplicate prefix records #14927
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
Conversation
CodSpeed Performance ReportMerging #14927 will not alter performanceComparing Summary
|
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
conda/core/prefix_data.py
Outdated
if prefix_record.name in self._prefix_records: | ||
raise CondaError( | ||
f"Prefix record insertion error: a record with name {prefix_record.name} already exists " | ||
"in the prefix. This can often be resolved by running `conda clean --all`. " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is conda clean --all
actually fixing this? I don't see anything in the code where it cleans duplicates in conda-meta
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a chance that conda clean --all
removes some of the orphaned prefix records? I looked through the code myself, but wasn't able to actually verify this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be verified thoroughly if we are going to include it in the error message.
Do we know why this happens? 🤔 It shouldn't happen under normal conditions! |
Yes, this is a weird issue. I was trying to manually recreate the conditions under which this happens today and had to do the following:
Subsequent install works because the installation routine is able to tell that Anyways, I think these errors probably resolve themselves. Adding this error message does give the user a feeling like they are solving it though, which I think is important psychologically. Regardless, it keeps them from adding more duplicate issues to this GitHub project. I get that this isn't ideal. Do you think we should instead attempt to clobber what currently exists in the |
Not sure. I was mostly trying to understand whether we had a reliable reproducer that didn't depend on race conditions. If this happens often enough that users are reporting it that much that we have duplicates, there must be a situation that introduces the issue and we should be aware of it. My concern was that we might be papering over the actual cause by saying now "don't report it, you are fine", and I'd rather understand why it happens and fix it. I agree that this is a situation that "shouldn't happen" so I'm puzzled of the high rate of occurrence in the issue tracker. Anyway, no extra actions needed from my side. |
I think the high occurrence happens because we tell people to report this error in the exception message! It gets reported so seldomly that I think we don't really have to worry about this being a huge problem. By seldom, I mean about twice a year. |
Ah ok, I had assumed a bigger incidence. We are good then! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd file this under improvement instead of docs, since it ultimately is about making sure users understand how to resolve the problem when using the tool. Not feeling strongly, though, let's just make sure the PR number is mentioned in the news item.
Co-authored-by: Jannis Leidel <jannis@leidel.info>
Description
Closes: #14922
This changes the error message when inserting duplicate prefix records to something that could actually fix the situation rather than suggestion users create an issue on our GitHub project.
Checklist - did you ...
news
directory (using the template) for the next release's release notes?