Issue #6573 resolved

500 Error while accessing "Pull requests" (BB-7759)

Sergey EDev
created an issue

Hello!

I've just got 500 error while trying to view my "Pull Requests" tab.

A problem seems to be reproduced in the following way:

1) Create user 2) Fork some public repository (let it be "A") into "B" 3) Make some changes in "B" 4) Create a "Pull Request" with the changes you made 5) Start "Pull Request" review with the administrator / admin grop of the "A" repository 6) Delete user created at step 1.

After that you have polling "Pull Request" in your repository "A", but you cannot see it because of a 500 error.

Debugging hash: b12a95a8e37d4e62b0b82b092f8193ec$a2fa515e48c169ba316d5696bb5c5ede

Thank you!

Comments (13)

  1. Erik van Zijst staff

    I'm unsure as to which account you created the fork under? Under the account of your temporary user? If so, that would mean that you deleting the user would also delete the repository containing the PR's changes.

    Or did you fork the repo under a team?

  2. Sergey EDev reporter

    I have the team public repository. I created a public fork with a test user (not in the team). Then I made some changes and sent a pull request (with a test user). After that I logged in with my main user (having admin rights in a public repo as a team member) and I could view the created pull request.

    Later I deleted the test user (so and the fork too). I logged in with my main account again and I still saw a pull request notification, but if I clicked on "Pull Request", I got a 500 error.

    I fond a work around a few hours ago - I could open the created pull request via direct link. I looked at another created pull requests, links looked like https://bitbucket.org/[TEAM_NAME]/[REPO_NAME]/pull-request/[ID]/[REQUEST_NAME], where ID is a request number and request_name is a one filled in with a test user. So I directly opened that requests and denied them.

  3. Erik van Zijst staff

    I'm confused. You say you can access the PR just fine by going directly to the link, but that you get a 500 if you access it through a notification? What notification do you mean? And what link does that notification contain?

  4. Sergey EDev reporter

    it seems I forgot to mention some details:

    The problem first occured when I deleted a temporary user and its repository. At the same time, there were some pending PRs, one of them had been merged into public repo before (while the temporary user was alive). When the user user was deleted, I still could saw "Poll Requests" tab with open PR counter (e.g. "Poll Requests (1)") both in my account tab (https://bitbucket.org/dashboard/pullrequests) and in the team repo tab (https://bitbucket.org/[TEAM_NAME]/[REPO_NAME]/pull-requests).But I could not open that links due to a 500 error.

    After that, I created a user with the same name and forked public repo with the same name again. I pushed some changes and created one more PR with the temporary user, after creating I was forwarded to a PR editor tab. I switched to my main account and checked notifications (https://bitbucket.org/account/notifications/) and there was a link to the created PR. I could access PR by a direct link. I played around a bit and changed [ID] and [REQUEST_NAME] in https://bitbucket.org/[TEAM_NAME]/[REPO_NAME]/pull-request/[ID]/[REQUEST_NAME] link and I managed to open old PR directly (which were created with the deleted temporary user). I declined the PRs and the 500 error was gone.

  5. Erik van Zijst staff

    Fair enough. The debug ID you provided contains enough info for us to fix it and I've raised an internal issue for it.

    FWIW, it should only affect the workflow where you keep creating and then deleting user accounts that have created PRs and so things should be fine for now as long as you avoid that.

  6. Brian Nguyen staff

    Hi,

    The pull request list should now be fixed if the pull request creator has been deleted.

    You still will not be able to view the pull request itself (the diff will not load), since it is technically invalid, but at least the you can see the list.

    Cheers, Brian

  7. Log in to comment