Wrong pull request count in a single repo #2953

Closed
opened 2025-11-02 04:55:10 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @xoxys on GitHub (Feb 21, 2019).

  • Gitea version (or commit ref): 1.7.2
  • Git version:
  • Operating system: CentOS 7
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I have a single repository which displays a wrong PR count. If no PR is opened, it displays -1, if one PR is opened it displays 0 and so on. All other repos work fine. If this is not a bug, how to fix this by hand?

Screenshots

image

image

Originally created by @xoxys on GitHub (Feb 21, 2019). - Gitea version (or commit ref): 1.7.2 - Git version: - Operating system: CentOS 7 - Database (use `[x]`): - [X] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description I have a single repository which displays a wrong PR count. If no PR is opened, it displays `-1`, if one PR is opened it displays `0` and so on. All other repos work fine. If this is not a bug, how to fix this by hand? ## Screenshots ![image](https://user-images.githubusercontent.com/3391958/53157449-d3ce8c80-35c1-11e9-9a04-d33956b6fb27.png) ![image](https://user-images.githubusercontent.com/3391958/53158459-ea75e300-35c3-11e9-870c-6bebe4175d0e.png)
GiteaMirror added the issue/staletype/bug labels 2025-11-02 04:55:10 -06:00
Author
Owner

@stale[bot] commented on GitHub (Apr 22, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Apr 22, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@xoxys commented on GitHub (Apr 22, 2019):

Not solved

@xoxys commented on GitHub (Apr 22, 2019): Not solved
Author
Owner

@lafriks commented on GitHub (Apr 22, 2019):

update pr count in repositories table in sql

@lafriks commented on GitHub (Apr 22, 2019): update pr count in repositories table in sql
Author
Owner

@xoxys commented on GitHub (Apr 22, 2019):

@lafriks: I'll give it a try

@xoxys commented on GitHub (Apr 22, 2019): @lafriks: I'll give it a try
Author
Owner

@richmahn commented on GitHub (May 30, 2019):

I had this happen with a user today. The URL is https://git.door43.org/unfoldingWord/en_ugg/pulls/95 showing a -1 for open Pull Requests, and this issue is the culprit, where it somehow closed twice. From the user:

I received an error message (500?) when I merged a change. It did not bringing up the merged successful page and the "Do you want to delete the branch" choice.
That said, it did merge the change I was making. I then went in and manually deleted the branch I merged into master. But there appears to be a problem with the merge procedure. I also note that there is a negative 1 pull request. This may also be part of the problem.

From the gitea.log:

2019/05/30 13:49:49 [...routers/repo/pull.go:943 CompareAndPullRequestPost()] [E] NewPullRequest: newIssue: Error 1062: Duplicate entry '28434-95' for key 'UQE_issue_repo_index'

Maybe tries to insert rather than update?

@richmahn commented on GitHub (May 30, 2019): I had this happen with a user today. The URL is https://git.door43.org/unfoldingWord/en_ugg/pulls/95 showing a `-1` for open Pull Requests, and this issue is the culprit, where it somehow closed twice. From the user: > I received an error message (500?) when I merged a change. It did not bringing up the merged successful page and the "Do you want to delete the branch" choice. > That said, it did merge the change I was making. I then went in and manually deleted the branch I merged into master. But there appears to be a problem with the merge procedure. I also note that there is a negative 1 pull request. This may also be part of the problem. From the gitea.log: > 2019/05/30 13:49:49 [...routers/repo/pull.go:943 CompareAndPullRequestPost()] [E] NewPullRequest: newIssue: Error 1062: Duplicate entry '28434-95' for key 'UQE_issue_repo_index' Maybe tries to insert rather than update?
Author
Owner

@lunny commented on GitHub (May 31, 2019):

@richmahn you issue should have been fixed by my PR https://github.com/go-gitea/gitea/pull/6973 , but it's not back ported to v1.8

@xoxys I think this maybe caused by merging some pull request failed and panic.

@lunny commented on GitHub (May 31, 2019): @richmahn you issue should have been fixed by my PR https://github.com/go-gitea/gitea/pull/6973 , but it's not back ported to v1.8 @xoxys I think this maybe caused by merging some pull request failed and panic.
Author
Owner

@stale[bot] commented on GitHub (Jul 30, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jul 30, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@techknowlogick commented on GitHub (Jul 30, 2019):

Linked PR is merged, closing this ticket.

Please re-open if needed (after updating to latest Gitea)

@techknowlogick commented on GitHub (Jul 30, 2019): Linked PR is merged, closing this ticket. Please re-open if needed (after updating to latest Gitea)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2953