mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-21 11:55:31 -05:00
This pull request is broken due to missing fork information. #8575
Closed
opened 2025-11-02 08:11:16 -06:00 by GiteaMirror
·
58 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.1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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#8575
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 @ptman on GitHub (Feb 18, 2022).
Gitea Version
1.16.1
Git Version
whatever is packaged in docker
Operating System
Linux
How are you running Gitea?
Docker
Database
PostgreSQL
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Description
The PR branch was not up to date, so I tried to update it using rebase on the web UI. This resulted in "This pull request is broken due to missing fork information. "
Screenshots
@lunny commented on GitHub (Feb 18, 2022):
Yeah, I think there is a bug of update with rebase.
@jolheiser commented on GitHub (Apr 22, 2022):
This just happened to me over at https://gitea.com/gitea/go-sdk/pulls/580 as well.
Of note, the rebase also removed my GPG signatures. (They are fixed now, but at the time of the update they were gone)
@andre161292 commented on GitHub (May 17, 2022):
This is a serious bug in my opinion, as it happens all the time we're updating our PRs by rebasing them. It should be included in the next bugfix- or at least the major 1.17 release.
@FrankCui-FengqiaoCui commented on GitHub (May 31, 2022):
this issue still exists in the latest try.gitea.io w/ 1.17 dev, is there any plan to fix it?
@lihanglin commented on GitHub (Jun 1, 2022):
I am using the released version 1.16.7 and have the same symptom.
@singuliere commented on GitHub (Jun 1, 2022):
@lihanglin are you using the Gitea image provided in Docker? If you do, can you please show the output of
@lihanglin commented on GitHub (Jun 2, 2022):
@singuliere
Sorry not to clarify the scenario.
I am using the offical prebuild amd64 gitea image which version is 1,16,7 and deployed native w/o docker.
@zeripath commented on GitHub (Jun 3, 2022):
@FrankCui-FengqiaoCui - please check your docker version. 1.17 is running alpine > 3.13 #18500 and docker versions less than 20.10.6 will break with hooks not running.
@lihanglin - I need to know more about your situation.
I would guess that in all of these cases hooks are not running.
If that is the case the PR head ref will not be being updated at the time of updates to the PR branch head.
You can check this, and the simplest way to do this would be to go to a repository that is affected and look at /graph
Look at the head branch of PR and where the associated label of the PR is e.g. https://try.gitea.io/arandomer/pathological/pulls/25 has the head branch
be-brokenSo the commit graph would be:
https://try.gitea.io/arandomer/pathological/graph?branch=refs%2Fheads%2Fbe-broken&branch=refs%2Fpull%2F25%2Fhead
and you can see that these are at the same position. (as they should be.)
If you have the heads at different places then my first suspicion is that you don't have hooks running and we need to go back down the rabbit hole of looking at that. The biggest causes for this are:
If the heads are the same - well then we're gonna need logs, a reproducing testcase, and more information than "this is a serious bug" etc.
@lihanglin commented on GitHub (Jun 3, 2022):
@zeripath
Thanks for your response.
I will get more dig to know if my hook went wrong.
If I have more clue, I would share with you all.
@penguineer commented on GitHub (Jul 6, 2022):
Could this be related to #18189 ?
(I had the similar issue due to a missed breaking change in the configuration.)
@amvasilyev commented on GitHub (Aug 11, 2022):
Hello. We have stumbled upon this issue after migrating to 1.17.0. We have been using 1.16.8 before that and there was no such error.
Any PR that is opened in Gitea is moving to the state 'This pull request is broken due to missing fork information.' after the new commits are added to the tracking branch.
This may be related with the fact that new commits are no longer displayed in the feed on the starting screen.
Docker version 19.03.2, build 6a30dfca03
gitea/gitea 1.17.0 71d4bdcd6398 11 days ago 247MB
Currently the host machine is Debian Stretch and I am currently stuck with 19.03 engine.
@amvasilyev commented on GitHub (Aug 11, 2022):
I think that the issue is definitely in heads not being updated. I got to the testing repository:
The gitea is storing data directly on the host machine:
@99rgosse commented on GitHub (Aug 11, 2022):
I could reproduce 👍
I have a production server with Gitea 1.16.8, and a development server which is under v1.17
Now that I can reproduce, I will debug it
@amvasilyev commented on GitHub (Aug 11, 2022):
In our situation every PR is broken when a new commit is pushed to the tracking branch.
The default policy for broken repositories is to make a rebase when accepting changes from the request.
Is it worth to try to use the binary directly instead of the Docker?
@99rgosse commented on GitHub (Aug 11, 2022):
the docker is made from the official binary, this won't change.
Could you please confirm that your PR that are failing came from a fork ? As the bug I was able to reproduce ??
The error message I get is from here https://github.com/go-gitea/gitea/blob/release/v1.17/services/repository/push.go#L164
@amvasilyev commented on GitHub (Aug 11, 2022):
No. For the test purposes I have created a test a brand new repository. The whole commit tree is here:
After the first commit, I have created a
prtestbranch. From that branch the PR to the same repository has been opened. When I have pushed the third commit, the PR moved to the broken state.After grepping the logs of gitea I do not see the message with the
gitRepo.GetCommitmessage, i.e.:The change would be the removal of the Docker layer. The idea is from this comment:
I also carefully reread the original issue and in my case the issue is not the same, but resulting state is the same.
@amvasilyev commented on GitHub (Aug 11, 2022):
I have set up the temporary instance of gitea 1.17.0 running inside the docker container. The issue was reproduced in this environment too. Therefore there is minor chance that the issue came alongside with the migration.
Then in this additional installation I have swapped the docker image with the native binary. In this setup the issue is gone. Therefore the source of my issue is the old version of docker runtime.
@99rgosse commented on GitHub (Aug 12, 2022):
Back to the fork problem I dug up this https://github.com/go-gitea/gitea/blob/release/v1.17/routers/web/repo/pull.go#L563
if pull.HeadRepo == nil || !headBranchExist || headBranchSha != sha { ctx.Data["IsPullRequestBroken"] = trueConditions I have is that headBranchSha != sha because the fork was made with signed commits
"Updating by rebase" will then rebase the commits on top of master, but as it is a Gitea commits side operation, commits are not signed anymore, thus they have not the same SHA.
@lunny / @zeripath I would like to help work on a PR for this issue, could you please tell me your opinion ?
I have not yet figured out how to check this behavior. Maybe with a git diff between unsigned & signed, then accept that the SHA are different, even if not signed ?
Or completely remove possibility to do this from gitea side when you have signed commits ? (Github does not do this rebasing feature I think)
@andre161292 commented on GitHub (Sep 12, 2022):
Any update on this? It's not working for me as well with Docker version 20.10.18 and Gitea 1.17.2.
Can i help out with any more information or logs?
@99rgosse commented on GitHub (Sep 13, 2022):
I worked out the way to update the fork without broking the PR.
Problem is still that the PR gets different commit sha's than the fork, then it fails the merging (security checking the checksums are identical) => I was not able to workaround this (no time)
My first idea would be to flash a message "Gitea cannot rebase on signed commits, please rebase manually your fork" (the Github way to do it)
If we are to allow rebasing by gitea, this would mean gitea should be able to force push to fork to make the checksums corresponds.
@hieptuanle commented on GitHub (Oct 8, 2022):
Upgrading Docker Engine version from 19 to 20.10.18 fixed the issue for me.
@zeripath commented on GitHub (Oct 8, 2022):
Ah so this is YET another duplicate of: https://github.com/go-gitea/gitea/issues/16428, https://github.com/go-gitea/gitea/pull/16451, https://github.com/go-gitea/gitea/pull/16170, https://github.com/go-gitea/gitea/issues/16464, https://github.com/go-gitea/gitea/issues/16484
See https://github.com/go-gitea/gitea/pull/18050
We put a huge warning in to tell people to upgrade their dockers for 1.17.
@zeripath commented on GitHub (Oct 8, 2022):
@99rgosse I don't understand your comment or how it's being reproduced.
@lunny commented on GitHub (Oct 25, 2022):
The bug could be reproduced when click the
update branch by rebasein pull request UI.@lunny commented on GitHub (Oct 25, 2022):
related #16125
@zeripath commented on GitHub (Oct 26, 2022):
AHA!That is the information I needed.I bet this update is not updating the PR headsNope that should still be happening and it is doing the correct thing on my test instance.
@zeripath commented on GitHub (Oct 26, 2022):
~~Right... ~~
So the problem is likely:8430f738e2/services/pull/update.go (L68-L74)This
does notdirectly causes an update the head refs which should also be being done as part of the post-receive hook.Now... I don't understand why this defer is there because when the post-receive hook is run then that is when the PR should be updated.~~So either: ~~
* This whole defer should be removed.* OR it needs to do the update of the PR heads.Looking a bit closer this should still cause an update of the ref head so I still don't understand and I still cannot reproduce this.
@zeripath commented on GitHub (Oct 26, 2022):
Right we need some logs.
Please add tracing logs for
services/pull:Then reproduce the issue following a rebase and give me the logs.
That way at least I'll be able to see something.
@zeripath commented on GitHub (Oct 26, 2022):
I cannot reproduce this.
From my above review this is almost certainly related to issues from docker not running hooks and is a duplicate of the many reports of that issue.
If anyone can reproduce - please give us logs.
@lunny commented on GitHub (Oct 27, 2022):
It could be reproduced from a Gitea instance which upgraded from v1.15. The PR created in version v1.15, after upgraded, click the button may cause this problem. The gitea instance running with systemd
@99rgosse commented on GitHub (Oct 27, 2022):
Nota : upgrading to 1.17.3 leads to no more PR Broken for me
I'm not sure my use case is the same as others.
The most secure way for me to reproduce is to have :
as you can see, now the PR is not broken in the end, in the past, this check in https://github.com/go-gitea/gitea/blob/release/v1.17/routers/web/repo/pull.go#L563 was generating the PR is broken parameter
@kutay-celebi commented on GitHub (Nov 9, 2022):
Upgrading Docker to 20.10.21 fixed my problem.
@Vylpes commented on GitHub (Dec 21, 2022):
Having this issue too - Upgrading docker didn't fix it for me
@ghost commented on GitHub (Dec 30, 2022):
This is also reproducible by me almost every time. I can provide logs. My Gitea version is Gitea 1.19.0+dev-245-g9dcaf14a1
@lunny commented on GitHub (Dec 31, 2022):
Please upload the logs
@ghost commented on GitHub (Jan 1, 2023):
@lunny Sure, here are the logs as provided by my instance admin. (We use docker too)
gitea-prrebaselog.txt
@ghost commented on GitHub (Jan 2, 2023):
Okay, I managed to reproduce the same bug on a self hosted instance of mine. It's using Gitea 1.18.0, The docker version is
20.10.5+dfsg1, build 55c4c88. I have managed to reproduce the bug on both postgresql and sqlite3 databases. Logs attached here:good_gitea_pr_rebase_log_postgresql.txt
good_gitea_pr_rebase_log_sqlite3.txt
I can also give you some more additional information:
(This steps worked for me 100% of times both on my self-hosted instance and the other instance)
I have also realized that it's not needed to fork the repo to create this issue, for example, just creating a new branch on the original repo and following the steps from four onwards is enough to trigger the bug as well.
@zekexiao commented on GitHub (Jan 11, 2023):
Same in 1.17.3, organization repo branches cannot RP.
workaround: push to a personal frok repo, then PR.
@MHOOO commented on GitHub (Jan 15, 2023):
Same for me. Gitea 1.17.4. It worked for a while, but suddenly stopped. The repository was public when the error first appeared. Since then, I've tried to make it private, as well as putting it into an organization. None of that worked.
@zeripath commented on GitHub (Jan 18, 2023):
Thank you @NebulaOrion that is the information needed for me to figure out what is happening.
The problem is:
The code that does this doesn't correctly update the head branch.
I believe that:
aa87b36900/services/pull/merge.go (L609)is the faulty line -- the question is what is the correct push here. Likely it should be a push to the original head but then we need to get a second push to occur updating the git pr head.
@zeripath commented on GitHub (Jan 19, 2023):
hmm... I wonder if this is actually an issue with force-pushes in general.Nope.I suspect it's a bug inpushUpdatesNo it's in the pushing environment!
@Vylpes commented on GitHub (Jan 20, 2023):
Still getting this error on 1.18.2 when merging in changes because the PR was outdated
@zeripath commented on GitHub (Jan 21, 2023):
@Vylpes please could you explain how you reproduce the error, because I cannot reproduce on main or on 1.18.2.
@delvh commented on GitHub (Jan 21, 2023):
Hmm, I just noticed that the fix can only be part of the solution:
The solution works for repos that have forks that send PRs.
I think I've seen this message on PRs in a repo that doesn't have forks.
So, perhaps, there is a part two to this problem?
(However, that was around 1.14 or so, so I don't know if this is still relevant)
@MHOOO commented on GitHub (Jan 21, 2023):
In my case the repository is definitely not a fork, yet I'm still having
this issue
delvh @.***> schrieb am Sa., 21. Jan. 2023, 14:33:
@Vylpes commented on GitHub (Jan 21, 2023):
@zeripath Pretty much all I did was:
This is on an organisation repo, no forks, just from a
feature/*branch todevelop. I've tried PRs that were made before updating and making new PRs@zeripath commented on GitHub (Jan 21, 2023):
@Vylpes I cannot reproduce that on 1.18.2 or on try. (see https://try.gitea.io/testOrf/test-18802/pulls/1, https://try.gitea.io/testOrf/test-18802/pulls/2, https://try.gitea.io/testOrf/test-18802/pulls/3, https://try.gitea.io/testOrf/test-18802/pulls/4)
If your PR was broken already it will remain broken - just push an empty commit and it should resync.
@Vylpes commented on GitHub (Jan 21, 2023):
@zeripath Then I have no clue why my instance is still doing it - I've pushed an empty commit and it doesn't fix it (nor does it show in the commits list in the PR).
Is there anything I can give you other than that to help? Or is there a way I can "reset" my instance without losing repo data?
@zeripath commented on GitHub (Jan 22, 2023):
It sounds like your hooks aren't running.
How are you pushing? SSH or Https?
What are you running on Linux, windows, docker etc? Are your repos mounted on an executable partition?
Have you resynchronized your hooks?
@Vylpes commented on GitHub (Jan 22, 2023):
That might actually be it - As drone isn't picking up on anything either which is also webhook related.
Https
Docker running on a Linux host. The repos are in a volume formatted with ext4, which I and all users have execute permissions on.
I've clicked on "Resynchronize pre-receive, update and post-receive hooks of all repositories." in the admin dashboard but no fix
@Vylpes commented on GitHub (Jan 22, 2023):
I think I fixed it, I moved my data into a different partition and its working now. Must have not liked where it was.
Thanks for the support :)
@zeripath commented on GitHub (Jan 22, 2023):
It was likely mounted noexec
@zekexiao commented on GitHub (Feb 9, 2023):
After upgrade 1.18.3 still have this issues, should I disable some option like "PR rebase"?
@zeripath commented on GitHub (Feb 9, 2023):
@alluLinger explain how you make the break happen. Make sure that pushes in general are working - that is your dashboard gets updates when you push.
I need details for how to make the bug occur and information about your system.
I need logs.
I'm not a mind reader.
@zekexiao commented on GitHub (Feb 13, 2023):
@zeripath
I can't reproduce it on a new repo/new instance.
on my origin repo got a 500 code after I hit create a PR. the logs I need ask our ops, will post it later.
@zekexiao commented on GitHub (Feb 13, 2023):
log here: log.txt
looks like this error:
f6cb7860a2/services/pull/pull.go (L478)on Windows Server, gitea version 1.18.3 with sqlite.
@zekexiao commented on GitHub (Feb 13, 2023):
@lunny @zeripath
I think I fix this by remove ".git/hooks/pre-push" on server. I found our server repo has a empty file "hooks/pre-push" so
error: waitpid for (NULL) failed: No child processes.when commit a PR will pre-push first then the error occured, so finally
missing fork information.#6460
@zeripath commented on GitHub (Feb 13, 2023):
Ah. We don't use pre-push so something may have put that there that wasn't Gitea. If a broken pre-push was causing this issue then I'm afraid it's not due to Gitea and whilst there is potentially a way we can avoid this - we can't consider this a bug in Gitea.