-
Notifications
You must be signed in to change notification settings - Fork 20
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
MultipleObjectsReturned #82
Comments
This query will reveal the problematic records, e.g.:
And this query will remove duplicates and resolve this error:
As documented here: https://github.com/cytoscape/cytoscape/wiki/Cytoscape-App-Store#known-error-notifications |
This blog post describes the potential problem with The suggested fix is to enforce uniqueness, e.g., in our case, perhaps something like this...
See https://docs.djangoproject.com/en/1.8/ref/models/options/#django.db.models.Options.unique_together But I'm now confident where/how to implement/test this suggested fix... Any volunteers? |
So this can also happen when select release_id, download_releasedownloadsbydate.when, count(*) as c from download_releasedownloadsbydate group by release_id, download_releasedownloadsbydate.when having c>1;
+------------+------------+---+
| release_id | when | c |
+------------+------------+---+
| NULL | 2014-08-16 | 2 |
| NULL | 2021-08-02 | 2 |
+------------+------------+---+
2 rows in set (4.11 sec) I fixed this by removing one of the two entries above. |
This error is back! The "fix" for the old site was to have a script run every hour to clear duplicates from mysql. Not an ideal solution. We should figure out when/how these duplicates are being created in the first place and fix it there.
If helpful, this particular instance started at around 1:00am PT on 28 Sept 2019 at which point the query for ReleaseDownloadsByDate for the MCODE app returned more than one object and throw the first error. Every attempt to download the app causes this error to repeat.
I suspect django is attempting to increment the download counter for the app and in retrieving the current value for the app for that particular day, it is getting TWO values instead of the expected one value.
The text was updated successfully, but these errors were encountered: