PRs migrated from CodeCommit cause 500 errors when trying to open them in the UI post-migration #14556

Open
opened 2025-11-02 11:16:05 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @tfmm on GitHub (Jun 6, 2025).

Description

When I try to open any of the PRs I migrated from CodeCommit, they all 500 with: 2025/06/06 14:11:12 .../web/repo/issue_view.go:913:preparePullViewReviewAndMerge() [E] GetDefaultMergeMessage: object does not exist [id: refs/heads/Repo, rel_path: ]

I poked around in the database and found that the merged_commit_id in the PRs table is empty for all of these migrated PRs.

Gitea Version

1.24 nightly

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker on Fedora 42.

Database

PostgreSQL

Originally created by @tfmm on GitHub (Jun 6, 2025). ### Description When I try to open any of the PRs I migrated from CodeCommit, they all 500 with: 2025/06/06 14:11:12 .../web/repo/issue_view.go:913:preparePullViewReviewAndMerge() [E] GetDefaultMergeMessage: object does not exist [id: refs/heads/Repo, rel_path: ] I poked around in the database and found that the `merged_commit_id` in the PRs table is empty for all of these migrated PRs. ### Gitea Version 1.24 nightly ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Docker on Fedora 42. ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 11:16:05 -06:00
Author
Owner

@tfmm commented on GitHub (Jun 6, 2025):

In addition to the merged_commit_id, the merger_id and merged_unix columns are empty for these PRs as well

@tfmm commented on GitHub (Jun 6, 2025): In addition to the `merged_commit_id`, the `merger_id` and `merged_unix` columns are empty for these PRs as well
Author
Owner

@tfmm commented on GitHub (Jun 12, 2025):

Still seeing the same error in Gitea Version: 1.24.0+3-g2eecd58bbe I'm unfortunately away and cannot delve into the database right now to see if there are changes to what I previously saw there or not.

@tfmm commented on GitHub (Jun 12, 2025): Still seeing the same error in `Gitea Version: 1.24.0+3-g2eecd58bbe` I'm unfortunately away and cannot delve into the database right now to see if there are changes to what I previously saw there or not.
Author
Owner

@tfmm commented on GitHub (Jun 18, 2025):

I do now see the once-missing data in the database, still getting the 500 errors however.

I also double checked and the repo has both the base and merged commits present in Gitea post migration. I'm not finding anything obvious database side. If there's anything else I can do to help troubleshoot this please let me know.

@tfmm commented on GitHub (Jun 18, 2025): I do now see the once-missing data in the database, still getting the 500 errors however. I also double checked and the repo has both the base and merged commits present in Gitea post migration. I'm not finding anything obvious database side. If there's anything else I can do to help troubleshoot this please let me know.
Author
Owner

@lunny commented on GitHub (Jun 18, 2025):

What's the error log?

@lunny commented on GitHub (Jun 18, 2025): What's the error log?
Author
Owner

@tfmm commented on GitHub (Jun 18, 2025):

Still the same:

2025/06/18 11:48:50 .../web/repo/issue_view.go:918:preparePullViewReviewAndMerge() [E] GetDefaultMergeMessage: object does not exist [id: refs/heads/Repo, rel_path: ]
@tfmm commented on GitHub (Jun 18, 2025): Still the same: ``` 2025/06/18 11:48:50 .../web/repo/issue_view.go:918:preparePullViewReviewAndMerge() [E] GetDefaultMergeMessage: object does not exist [id: refs/heads/Repo, rel_path: ] ```
Author
Owner

@tfmm commented on GitHub (Jun 19, 2025):

I've found something, it appears that during the migration, no default branch is selected in gitea post-migration. If I select the same default branch that was set in codecommit, the PRs load without having to re-migrate or anything. I will look at the aws migration side of things and see if there's something I can find there that might help resolve it.

@tfmm commented on GitHub (Jun 19, 2025): I've found something, it appears that during the migration, no default branch is selected in gitea post-migration. If I select the same default branch that was set in codecommit, the PRs load without having to re-migrate or anything. I will look at the aws migration side of things and see if there's something I can find there that might help resolve it.
Author
Owner

@tfmm commented on GitHub (Jun 19, 2025):

From services/migrations/migrate.go I see that the DefaultBranch is being set, I'm unsure where that would get used, trying to track it down, but not finding anything yet.

@tfmm commented on GitHub (Jun 19, 2025): From `services/migrations/migrate.go` I see that the DefaultBranch is being set, I'm unsure where that would get used, trying to track it down, but not finding anything yet.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14556