fedora-infra / anitya

A cross-distribution upstream release monitoring project
https://release-monitoring.org
GNU General Public License v2.0
245 stars 104 forks source link

SAWarning: New instance XXX with identity key YYY conflicts with persistent instance #1576

Closed Zlopez closed 1 year ago

Zlopez commented 1 year ago

This started happening after the last release, currently affecting https://release-monitoring.org/project/47687/, but it will probably affect more projects.

Here is what I could find in the log:

/usr/local/lib/python3.11/site-packages/anitya/db/models.py:477: SAWarning: New instance <ProjectVersion at 0x7f8c48f425d0> with identity key (<class 'anitya.db.models.ProjectVersion'>, (47687, 'radsecproxy-'), None) conflicts with persistent instance <ProjectVersion at 0x7f8c4896cf50>, referer: https://release-monitoring.org/project/47687/

Found similar issue at another project: https://github.com/stefanofontanelli/ColanderAlchemy/issues/92

Zlopez commented 1 year ago

Found out that this was caused not by bug in Anitya, but by incorrect setup of the project. Version prefix was set to something that caused version to be blank. For example there was one tag that only contained radsecproxy- in project https://release-monitoring.org/project/47687/. So I added that to version filter and the error is gone.

I'm closing this one, but I assume there are more projects with issues like this.