Migrating a GitHub repository that has dependabot pull requests fails #8357

Open
opened 2025-11-02 08:03:31 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @rudism on GitHub (Jan 14, 2022).

Gitea Version

1.15.9

Git Version

2.30.2

Operating System

Arch Linux 5.15.13-arch1-1

How are you running Gitea?

Official docker image gitea/gitea:1 with image version 5dba8012c96f currently active.

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/rudism/862eb9b4653658720f8b7782cac90303

Description

When attempting to migrate a repository from GitHub with issues included, I believe that pull requests created by GitHub's dependabot cause the migration to fail.

This happens on my self-hosted gitea instance with the attached logs, and trying to import the repo on the demo site also fails (I assume for the same reason).

The repo I'm trying to import is https://github.com/rudism/ficdown.js

The logs show this failure:

[E] Run task failed: issue does not exist [id: 0, repo_id: 11, index: 12]

Going to the url for that issue number (12) redirects to one of the dependabot pull requests: https://github.com/rudism/ficdown.js/issues/12

This was happening while the PRs were open, so I tried closing them, but the problem persists. GitHub does not provide a way to delete pull requests, so I can't test that. When I try to migrate the repository without issues it works fine.

Screenshots

No response

Originally created by @rudism on GitHub (Jan 14, 2022). ### Gitea Version 1.15.9 ### Git Version 2.30.2 ### Operating System Arch Linux 5.15.13-arch1-1 ### How are you running Gitea? Official docker image `gitea/gitea:1` with image version `5dba8012c96f` currently active. ### Database PostgreSQL ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist https://gist.github.com/rudism/862eb9b4653658720f8b7782cac90303 ### Description When attempting to migrate a repository from GitHub with issues included, I believe that pull requests created by GitHub's dependabot cause the migration to fail. This happens on my self-hosted gitea instance with the attached logs, and trying to import the repo on the demo site also fails (I assume for the same reason). The repo I'm trying to import is https://github.com/rudism/ficdown.js The logs show this failure: ``` [E] Run task failed: issue does not exist [id: 0, repo_id: 11, index: 12] ``` Going to the url for that issue number (12) redirects to one of the dependabot pull requests: https://github.com/rudism/ficdown.js/issues/12 This was happening while the PRs were open, so I tried closing them, but the problem persists. GitHub does not provide a way to delete pull requests, so I can't test that. When I try to migrate the repository without issues it works fine. ### Screenshots _No response_
GiteaMirror added the type/enhancementtopic/repo-migration labels 2025-11-02 08:03:31 -06:00
Author
Owner

@lunny commented on GitHub (Jan 15, 2022):

It seems there is different information for a user type bot.

@lunny commented on GitHub (Jan 15, 2022): It seems there is different information for a user type bot.
Author
Owner

@KN4CK3R commented on GitHub (Jan 15, 2022):

Works for me locally:
grafik

But I get these errors in the log:

2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.3]
2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[2]: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.3]
2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.4]
2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[3]: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.4]
2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/path-parse-1.0.7]
2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[4]: branch does not exist [name: dependabot/npm_and_yarn/path-parse-1.0.7]
2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/markdown-it-12.3.2]
2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[5]: branch does not exist [name: dependabot/npm_and_yarn/markdown-it-12.3.2]
@KN4CK3R commented on GitHub (Jan 15, 2022): Works for me locally: ![grafik](https://user-images.githubusercontent.com/1666336/149621260-76b2ebf8-1829-4a74-96c3-de1ca09a4103.png) But I get these errors in the log: ```log 2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.3] 2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[2]: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.3] 2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.4] 2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[3]: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.4] 2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/path-parse-1.0.7] 2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[4]: branch does not exist [name: dependabot/npm_and_yarn/path-parse-1.0.7] 2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/markdown-it-12.3.2] 2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[5]: branch does not exist [name: dependabot/npm_and_yarn/markdown-it-12.3.2] ```
Author
Owner

@rudism commented on GitHub (Jan 15, 2022):

@KN4CK3R to replicate you need a GitHub private token with repo API access--the failure only happens if you tick the box to import issues. Without issues it still succeeds (with those errors in the log about missing branches). I don't think there's a safe way for me to generate and share a token on my repo that could be used for testing, so might be a difficult one to replicate generally.

My suspicion is that since the issues don't link to actual issues (instead they redirect to the PR directly) there's something special about the dependabot issues/PRs that the Gitea migration doesn't know how to handle.

@rudism commented on GitHub (Jan 15, 2022): @KN4CK3R to replicate you need a GitHub private token with repo API access--the failure only happens if you tick the box to import issues. Without issues it still succeeds (with those errors in the log about missing branches). I don't think there's a safe way for me to generate and share a token on my repo that could be used for testing, so might be a difficult one to replicate generally. My suspicion is that since the issues don't link to actual issues (instead they redirect to the PR directly) there's something special about the dependabot issues/PRs that the Gitea migration doesn't know how to handle.
Author
Owner

@zeripath commented on GitHub (Jan 15, 2022):

@rudism Could you please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems

And send us the logs from when you try to migrate?

@zeripath commented on GitHub (Jan 15, 2022): @rudism Could you please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems And send us the logs from when you try to migrate?
Author
Owner

@rudism commented on GitHub (Jan 16, 2022):

@zeripath I've added the debug logs to the same gist https://gist.github.com/rudism/862eb9b4653658720f8b7782cac90303#file-docker-debug-log-txt

@rudism commented on GitHub (Jan 16, 2022): @zeripath I've added the debug logs to the same gist https://gist.github.com/rudism/862eb9b4653658720f8b7782cac90303#file-docker-debug-log-txt
Author
Owner

@KN4CK3R commented on GitHub (Jan 16, 2022):

@KN4CK3R to replicate you need a GitHub private token with repo API access--the failure only happens if you tick the box to import issues.

As you can see the screenshot shows the migrated PR on Gitea.

@KN4CK3R commented on GitHub (Jan 16, 2022): > @KN4CK3R to replicate you need a GitHub private token with repo API access--the failure only happens if you tick the box to import issues. As you can see the screenshot shows the migrated PR on Gitea.
Author
Owner

@rudism commented on GitHub (Jan 16, 2022):

I see--I was trying to migrate just the issues and had left pull requests unchecked. However I just tried migrating again with both issues and pull requests and then it worked for me as well.

@rudism commented on GitHub (Jan 16, 2022): I see--I was trying to migrate just the issues and had left pull requests unchecked. However I just tried migrating again with both issues and pull requests and then it worked for me as well.
Author
Owner

@zeripath commented on GitHub (Jan 17, 2022):

Migrate repository from https://github.com/rudism/ficdown.js.git failed: issue does not exist [id: 0, repo_id: 24, index: 12]

Which appears to relate to:

gitea  | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 761.764µs
gitea  | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 13190145] - 541.555µs
gitea  | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 582.743µs
gitea  | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 402.862µs
gitea  | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 424.091µs
gitea  | 2022/01/16 05:38:43 ...rm.io/xorm/engine.go:1139:Get() [I] [SQL] SELECT "id", "repo_id", "index", "poster_id", "original_author", "original_author_id", "name", "content", "milestone_id", "priority", "is_closed", "is_pull", "num_comments", "ref", "deadline_unix", "created_unix", "updated_unix", "closed_unix", "is_locked" FROM "issue" WHERE "repo_id"=$1 AND "index"=$2 LIMIT 1 [24 12] - 540.253µs
@zeripath commented on GitHub (Jan 17, 2022): ``` Migrate repository from https://github.com/rudism/ficdown.js.git failed: issue does not exist [id: 0, repo_id: 24, index: 12] ``` Which appears to relate to: ``` gitea | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 761.764µs gitea | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 13190145] - 541.555µs gitea | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 582.743µs gitea | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 402.862µs gitea | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 424.091µs gitea | 2022/01/16 05:38:43 ...rm.io/xorm/engine.go:1139:Get() [I] [SQL] SELECT "id", "repo_id", "index", "poster_id", "original_author", "original_author_id", "name", "content", "milestone_id", "priority", "is_closed", "is_pull", "num_comments", "ref", "deadline_unix", "created_unix", "updated_unix", "closed_unix", "is_locked" FROM "issue" WHERE "repo_id"=$1 AND "index"=$2 LIMIT 1 [24 12] - 540.253µs ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8357