mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-09 21:10:00 -05:00
Migration with pull requests from other gitea instance fails #6195
Closed
opened 2025-11-02 06:47:51 -06:00 by GiteaMirror
·
27 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16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0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#6195
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lakostin on GitHub (Oct 22, 2020).
1.14.0+dev-18-gd453533be
2.26.2
docker Alpine Linux
[x]):2020/10/22 13:25:46 ...ules/task/migrate.go:64:func1() [E] DeleteRepository: repository does not exist [id: 208, uid: 75, owner_name: , name: ]
2020/10/22 13:25:46 modules/task/task.go:51:handle() [E] Run task failed: error while loading reactions: 403 Forbidden
Description
Migration without pull requests works fine for the same repo.
...
@6543 commented on GitHub (Oct 22, 2020):
looks like the account do not have access to the reactions endpoint ... - witch version the gitea instance you are migrationg from has?
@lakostin commented on GitHub (Oct 22, 2020):
same version - 1.14.0+dev-18-gd453533be
@6543 commented on GitHub (Oct 22, 2020):
@lakostin can you tell me the url from the source, or send it to me via email if it should not get public?
@lakostin commented on GitHub (Oct 22, 2020):
impossible cause it's in private network
@6543 commented on GitHub (Oct 22, 2020):
hmm I'll try to reproduce it somehow
@6543 commented on GitHub (Oct 23, 2020):
@lakostin sorry could not reproduce it for now ...
@lakostin commented on GitHub (Oct 23, 2020):
i tried to migrate three different pull requests and all of them failed. maybe its connected with migrations during gitea update? Firstly i had an installation of 12 version of gitea and constantly updated it until the 14 version. is there any way to check it? maybe check db relations?
@lakostin commented on GitHub (Oct 28, 2020):
@6543 ?
@6543 commented on GitHub (Oct 28, 2020):
@lakostin you can use the "doctor" command to check and fix things (
./gitea doctor --help)and two question:
@lakostin commented on GitHub (Oct 28, 2020):
yes, diff works fine for all pull requests in all these projects
no, all the repos are new
@6543 commented on GitHub (Oct 28, 2020):
@lakostin
do you mean v1.12.x to v1.14.0+dev ?
If so what version sha is displayed? (example try.gitea.io show
1.14.0+dev-100-g946bbbe9b)@lakostin commented on GitHub (Oct 28, 2020):
yes
1.14.0+dev-18-gd453533be
@zeripath commented on GitHub (Oct 28, 2020):
OK since #13331 (that is commit
7dfb2fc) was merged you should get a little bit more helpful information regarding this issue.In particular the issue that causes the forbidden should be displayed in the log message.
@lakostin commented on GitHub (Oct 28, 2020):
2020/10/28 21:21:14 ...ules/task/migrate.go:65:func1() [E] DeleteRepository: repository does not exist [id: 4, uid: 1, owner_name: , name: ]
2020/10/28 21:21:14 modules/task/task.go:51:handle() [E] Run task failed: error while loading reactions for pull # 42. Error: 403 Forbidden
@zeripath commented on GitHub (Oct 28, 2020):
So now you need to look on your instance that you're migrating from as to what is special about the reactions on pull #42
That is by looking at
/api/v1/repos/{owner}/{repo}/issues/{index}/reactionson the instance you're migrating from.The error 403 is coming from there.
@zeripath commented on GitHub (Oct 28, 2020):
I guess we should just probably not migrate the reactions if we get a 403 though - it's hardly a significant issue.
@zeripath commented on GitHub (Oct 28, 2020):
Now the issue is why is the
/api/v1/repos/{owner}/{repo}/issues/{index}/reactionscausing a forbidden ?@zeripath commented on GitHub (Oct 28, 2020):
At least in master a Forbidden will predominantly come from:
Which could still be the case ... because this is a pull - and so the correct test is whether the
ctx.Repo.CanRead(models.UnitTypePulls)@zeripath commented on GitHub (Oct 28, 2020):
#13344 will also fix that.
@lakostin commented on GitHub (Oct 29, 2020):
still error:
2020/10/29 10:50:37 ...ules/task/migrate.go:65:func1() [E] DeleteRepository: repository does not exist [id: 2, uid: 1, owner_name: , name: ]
2020/10/29 10:50:37 modules/task/task.go:51:handle() [E] Run task failed: error while listing reactions for comment 5961 in issue #40. Error: 403 Forbidden
there are no reactions though...
gitea=# select * from reaction where comment_id=5961;
id | type | issue_id | comment_id | user_id | created_unix | original_author_id | original_author
----+------+----------+------------+---------+--------------+--------------------+-----------------
(0 rows)
@zeripath commented on GitHub (Oct 29, 2020):
OK #13344 fixed one issue - which has revealed another issue - I've just submitted a second PR to fix that.
The issue is not whether there are reactions or not - it's whether you would be allowed to read the issues or not.
If you gave the user on the gitea you were migrating from access to read issues this problem would go away.
If you were able to update the host gitea to have one of the backports - then similarly the problem would go away.
@lakostin commented on GitHub (Oct 29, 2020):
Which number has the second PR?
I migrate repo with admin user.
@6543 commented on GitHub (Oct 29, 2020):
@zeripath If I guess right the root of THIS specific issue is elsewhere (DB unique constrain) and cause by equal entrys ... caused by missing information on some reactions
If you give me some time I'll file a pull against - still do not have mouch time to write pulls
@zeripath commented on GitHub (Oct 29, 2020):
@lakostin #13352
@6543 So if you look at the @lakostin 's log reports the issue is a 403 Forbidden. Looking at the API issue_reaction.go code the way that happens is if you fail the permissions test there - which precisely #13344 & #13349 both fix.
@zeripath commented on GitHub (Oct 29, 2020):
There very well maybe another equal entries bug - but this report is simply the permissions problem.
@lakostin commented on GitHub (Oct 29, 2020):
after #13352 all migrations completed successfully with pull requests. thank you!
project settings were not migrated, but im not sure if they should..
@6543 commented on GitHub (Oct 30, 2020):
@zeripath yes - to many open issues with similar look :O
@lakostin great to hear :) - and yes settings are not supposed to migrate