#9923 user unable to fork project on pagure.io
Closed: Fixed 3 years ago by pingou. Opened 3 years ago by kevin.

user @epirat gets a 500 trying to fork quick-docs repo.

I see in logs:

[Sun May 02 23:58:36.055301 2021] [wsgi:error] [pid 413466:tid 139885103544064] [remote 82.218.239.149:624
18] [2021-05-02 23:58:36,052] ERROR in app: Exception on /fedora-docs/quick-docs/ [GET]
[Sun May 02 23:58:36.055339 2021] [wsgi:error] [pid 413466:tid 139885103544064] [remote 82.218.239.149:624
18] Traceback (most recent call last):
[Sun May 02 23:58:36.055343 2021] [wsgi:error] [pid 413466:tid 139885103544064] [remote 82.218.239.149:624
18]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3275, in one
[Sun May 02 23:58:36.055346 2021] [wsgi:error] [pid 413466:tid 139885103544064] [remote 82.218.239.149:624
18]     ret = self.one_or_none()
[Sun May 02 23:58:36.055349 2021] [wsgi:error] [pid 413466:tid 139885103544064] [remote 82.218.239.149:624
18]   File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 3253, in one_or_none
[Sun May 02 23:58:36.055352 2021] [wsgi:error] [pid 413466:tid 139885103544064] [remote 82.218.239.149:624
18]     "Multiple rows were found for one_or_none()"
[Sun May 02 23:58:36.055354 2021] [wsgi:error] [pid 413466:tid 139885103544064] [remote 82.218.239.149:624
18] sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one_or_none()
[Sun May 02 23:58:36.055357 2021] [wsgi:error] [pid 413466:tid 139885103544064] [remote 82.218.239.149:624
18] 
[Sun May 02 23:58:36.055359 2021] [wsgi:error] [pid 413466:tid 139885103544064] [remote 82.218.239.149:624
18] During handling of the above exception, another exception occurred:
...

There's a bunch more to the traceback, in error_log

This may be related to the noggin case issue.

@pingou can you look when you get in?


Adding some more info to this:

The error does not just happen when trying to fork.

It seems that the initial attempt to fork somehow went wrong and now it is impossible for me to see any pages related to that repository, when I am logged in with my account.

Looks like I somehow ended up with two forks, which might be what causes this issue?

Most definitely :)

Metadata Update from @pingou:
- Issue assigned to pingou
- Issue priority set to: Waiting on Assignee (was: Needs Review)
- Issue tagged with: low-gain, low-trouble, ops

3 years ago

Here are the steps to reproduce:

# Back up the DB:
sudo -u postgres pg_dump -C pagure | /usr/bin/pxz -T4 > /backups/pagure-2021-05-03.2.dump.sql.xz
# Find the user's user id
select id, "user" from "users" where "user" = 'epirat';
# Find the annoying fork:
select id, namespace, name, is_fork, user_id from projects where name = 'quick-docs' and user_id = 9885;
# Delete one of the forks:
delete from projects where id = 9837;
DELETE 1

Check the UI to see if things are working: https://pagure.io/fork/epirat/fedora-docs/quick-docs
The error page shows: No git repo found.

So the DB got a duplicated entry and the git repos did not get created. The easiest at this point is to just delete the second fork in the DB and let the user re-create the fork.

@epirat could you try forking the project again?

@epirat could you try forking the project again?

It works fine now, I was able to again see the fedora-docs/quick-docs pages and now fork the repository as expected.

Thanks for the quick fix!

Thanks!

Let us know if you have any other issue

Metadata Update from @pingou:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata
Boards 1
ops Status: Done
Attachments 1