Skip to content

Import of Gitlab merge requests fails #14955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks
mkauzlar opened this issue Mar 11, 2021 · 5 comments
Open
3 tasks

Import of Gitlab merge requests fails #14955

mkauzlar opened this issue Mar 11, 2021 · 5 comments
Labels
topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them type/bug

Comments

@mkauzlar
Copy link

mkauzlar commented 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

@lunny lunny added the type/bug label Mar 11, 2021
@techknowlogick techknowlogick added issue/duplicate The issue has already been reported. and removed type/bug labels Mar 11, 2021
@techknowlogick
Copy link
Member

Closing as dupe of #13884

@mkauzlar
Copy link
Author

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

@mkauzlar
Copy link
Author

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

@6543 6543 reopened this Mar 11, 2021
@6543 6543 added type/bug topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them and removed issue/duplicate The issue has already been reported. labels Mar 11, 2021
@mkauzlar
Copy link
Author

mkauzlar commented 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)

@6543
Copy link
Member

6543 commented Mar 12, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them type/bug
Projects
None yet
Development

No branches or pull requests

4 participants