#5391 Deleting spam project with pagure-admin raises `sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one()`
Opened 2 years ago by zlopez. Modified 7 months ago

When trying to delete this project https://pagure.io/33820x-pdf-dumps-for-any-vibrant-career from pagure as a spam it will raise the following error:

Error: Multiple rows were found for one()
ERROR:root:Generic error catched:
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3275, in one
    ret = self.one_or_none()
  File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3253, in one_or_none
    "Multiple rows were found for one_or_none()"
sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one_or_none()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/pagure/cli/admin.py", line 1374, in main
    args.func(args)
  File "/usr/lib/python3.6/site-packages/pagure/cli/admin.py", line 907, in do_delete_project
    project = _get_project(args.project, user=args.user)
  File "/usr/lib/python3.6/site-packages/pagure/cli/admin.py", line 618, in _get_project
    session, namespace=namespace, name=name, user=user
  File "/usr/lib/python3.6/site-packages/pagure/lib/query.py", line 2865, in _get_project
    return query.one()
  File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3278, in one
    "Multiple rows were found for one()"
sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one()

Accessing the web url throws 500 with the same backtrace. It seems that some spam account was able to create this project twice too quick and the Pagure allowed it.

Is there some other way to delete the project?

NOTE: This spam project is currently visible on https://pagure.io/browse/projects/


Metadata Update from @wombelix:
- Issue set to the milestone: 6.0

7 months ago

Log in to comment on this ticket.

Metadata