Import of Gitlab merge requests fails #6989

Open
opened 2025-11-02 07:12:57 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @mkauzlar on GitHub (Mar 11, 2021).

If we try to migrate without "pull request" option than it works (but without merge requests being migrated).
The migration fails if both issues and pull requests are selected.
If we only choose issues than the issues are migrated.
If we only chose pull requests then the Gitlab merge requests are migrated.

  • Gitea version (or commit ref):1.13.4
  • Git version:2.30.1
  • Operating system:Ubuntu 20.04
    • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • [x ] SQLite
  • Log gist:

2021/03/11 12:31:47 ...es/pull/temp_repo.go:104:createTemporaryRepo() [E] Unable to fetch origin base branch [Group/repo:master -> base, original_base in /var/lib/gitea/data/tmp/local-repo/pull.git228963340]: exit status 1:
2021/03/11 12:31:47 ...rvices/pull/patch.go:56:TestPatch() [E] CreateTemporaryPath: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1
2021/03/11 12:31:47 ...rvices/pull/check.go:220:handle() [E] testPatch[3450]: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1
2021/03/11 12:31:47 ...es/pull/temp_repo.go:104:createTemporaryRepo() [E] Unable to fetch origin base branch [Group/repo:research -> base, original_base in /var/lib/gitea/data/tmp/local-repo/pull.git096113950]: exit status 1:
2021/03/11 12:31:47 ...rvices/pull/patch.go:56:TestPatch() [E] CreateTemporaryPath: Unable to fetch origin base branch [Group/repo:research -> base, original_base in tmpBasePath]: exit status 1
2021/03/11 12:31:47 ...rvices/pull/check.go:220:handle() [E] testPatch[3441]: Unable to fetch origin base branch [Group/repo:research -> base, original_base in tmpBasePath]: exit status 1
2021/03/11 12:31:47 ...rvices/pull/check.go:167:manuallyMerged() [E] PullRequest[3458].setMerged : PullRequest[984] already closed
2021/03/11 12:31:47 ...es/pull/temp_repo.go:104:createTemporaryRepo() [E] Unable to fetch origin base branch [Group/repo:master -> base, original_base in /var/lib/gitea/data/tmp/local-repo/pull.git348178944]: exit status 1:
2021/03/11 12:31:47 ...rvices/pull/patch.go:56:TestPatch() [E] CreateTemporaryPath: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1
2021/03/11 12:31:47 ...rvices/pull/check.go:220:handle() [E] testPatch[3458]: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1
2021/03/11 12:31:47 ...es/pull/temp_repo.go:104:createTemporaryRepo() [E] Unable to fetch origin base branch [Group/repo:master -> base, original_base in /var/lib/gitea/data/tmp/local-repo/pull.git132548841]: exit status 1:
2021/03/11 12:31:47 ...rvices/pull/patch.go:56:TestPatch() [E] CreateTemporaryPath: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1
2021/03/11 12:31:47 ...rvices/pull/check.go:220:handle() [E] testPatch[3468]: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1

Originally created by @mkauzlar on GitHub (Mar 11, 2021). If we try to migrate without "pull request" option than it works (but without merge requests being migrated). The migration fails if both issues and pull requests are selected. If we only choose issues than the issues are migrated. If we only chose pull requests then the Gitlab merge requests are migrated. - Gitea version (or commit ref):1.13.4 - Git version:2.30.1 - Operating system:Ubuntu 20.04 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x ] SQLite - Log gist: > 2021/03/11 12:31:47 ...es/pull/temp_repo.go:104:createTemporaryRepo() [E] Unable to fetch origin base branch [Group/repo:master -> base, original_base in /var/lib/gitea/data/tmp/local-repo/pull.git228963340]: exit status 1: 2021/03/11 12:31:47 ...rvices/pull/patch.go:56:TestPatch() [E] CreateTemporaryPath: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1 2021/03/11 12:31:47 ...rvices/pull/check.go:220:handle() [E] testPatch[3450]: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1 2021/03/11 12:31:47 ...es/pull/temp_repo.go:104:createTemporaryRepo() [E] Unable to fetch origin base branch [Group/repo:research -> base, original_base in /var/lib/gitea/data/tmp/local-repo/pull.git096113950]: exit status 1: 2021/03/11 12:31:47 ...rvices/pull/patch.go:56:TestPatch() [E] CreateTemporaryPath: Unable to fetch origin base branch [Group/repo:research -> base, original_base in tmpBasePath]: exit status 1 2021/03/11 12:31:47 ...rvices/pull/check.go:220:handle() [E] testPatch[3441]: Unable to fetch origin base branch [Group/repo:research -> base, original_base in tmpBasePath]: exit status 1 2021/03/11 12:31:47 ...rvices/pull/check.go:167:manuallyMerged() [E] PullRequest[3458].setMerged : PullRequest[984] already closed 2021/03/11 12:31:47 ...es/pull/temp_repo.go:104:createTemporaryRepo() [E] Unable to fetch origin base branch [Group/repo:master -> base, original_base in /var/lib/gitea/data/tmp/local-repo/pull.git348178944]: exit status 1: 2021/03/11 12:31:47 ...rvices/pull/patch.go:56:TestPatch() [E] CreateTemporaryPath: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1 2021/03/11 12:31:47 ...rvices/pull/check.go:220:handle() [E] testPatch[3458]: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1 2021/03/11 12:31:47 ...es/pull/temp_repo.go:104:createTemporaryRepo() [E] Unable to fetch origin base branch [Group/repo:master -> base, original_base in /var/lib/gitea/data/tmp/local-repo/pull.git132548841]: exit status 1: 2021/03/11 12:31:47 ...rvices/pull/patch.go:56:TestPatch() [E] CreateTemporaryPath: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1 2021/03/11 12:31:47 ...rvices/pull/check.go:220:handle() [E] testPatch[3468]: Unable to fetch origin base branch [Group/repo:master -> base, original_base in tmpBasePath]: exit status 1
GiteaMirror added the topic/repo-migrationtype/bug labels 2025-11-02 07:12:57 -06:00
Author
Owner

@techknowlogick commented on GitHub (Mar 11, 2021):

Closing as dupe of https://github.com/go-gitea/gitea/issues/13884

@techknowlogick commented on GitHub (Mar 11, 2021): Closing as dupe of https://github.com/go-gitea/gitea/issues/13884
Author
Owner

@mkauzlar commented on GitHub (Mar 11, 2021):

I did have a look at #13884 however I did not see any errors relating duplicates (running gitea in dev mode)

@mkauzlar commented on GitHub (Mar 11, 2021): I did have a look at #13884 however I did not see any errors relating duplicates (running gitea in dev mode)
Author
Owner

@mkauzlar commented on GitHub (Mar 11, 2021):

I have found that the problem was that Gitea was searching for a nonexistent Issue:

[I] [SQL] UPDATE task SET repo_id = ?, status = ?, end_time = ?, errors = ? WHERE id=? [0 3 1615480073 issue does not exist [id: 0, repo_id: 202, index: 149] 102]

I created the issue ID 149 in Gitlab and then the migration succeeded.
So, it's not a duplicate entry issue

@mkauzlar commented on GitHub (Mar 11, 2021): I have found that the problem was that Gitea was searching for a nonexistent Issue: > [I] [SQL] UPDATE `task` SET `repo_id` = ?, `status` = ?, `end_time` = ?, `errors` = ? WHERE `id`=? [0 3 1615480073 issue does not exist [id: 0, repo_id: 202, index: 149] 102] I created the issue ID 149 in Gitlab and then the migration succeeded. So, it's not a duplicate entry issue
Author
Owner

@mkauzlar commented on GitHub (Mar 12, 2021):

I investigated a bit further. The migration fails when there is a Gitlab merge request X but there is no Gitlab issue X.
By creating the Gitlab issue X the migration succeeds.

For example to create issues with a specific iid in Gitlab (say from #88 to #136):

for issue in $(seq 88 136) do echo "Creating issue $issue" curl --request POST \ --url https://gitlab.com/api/v4/projects/<Gitlab project ID>/issues \ --header 'content-type: application/json' \ --header 'private-token: <Gitlab API Token>' \ --data '{ "title": "Empty issue for Gitea migration", "iid": "'"$issue"'" }' done

The case of #13884 seems to happen when a merge request references an issue with the same id (not sure about this needs to be tested)

@mkauzlar commented on GitHub (Mar 12, 2021): I investigated a bit further. The migration fails when there is a Gitlab merge request X but there is no Gitlab issue X. By creating the Gitlab issue X the migration succeeds. For example to create issues with a specific iid in Gitlab (say from #88 to #136): `for issue in $(seq 88 136) do echo "Creating issue $issue" curl --request POST \ --url https://gitlab.com/api/v4/projects/<Gitlab project ID>/issues \ --header 'content-type: application/json' \ --header 'private-token: <Gitlab API Token>' \ --data '{ "title": "Empty issue for Gitea migration", "iid": "'"$issue"'" }' done` The case of #13884 seems to happen when a merge request references an issue with the same id (not sure about this needs to be tested)
Author
Owner

@6543 commented on GitHub (Mar 12, 2021):

ok so it's something about our workaround for issue and pull have independend indexes on GL

@6543 commented on GitHub (Mar 12, 2021): ok so it's something about our workaround for issue and pull have independend indexes on GL
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6989