mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-16 13:13:23 -05:00
LFS: Error 500 when merging pull request #268
Closed
opened 2025-11-02 03:16:39 -06:00 by GiteaMirror
·
18 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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c1
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
No Label
type/bug
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#268
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 @axeloz on GitHub (Jan 23, 2017).
[x]):Description
I wanted to test the master version of Gitea in order to check the new features including LFS.
I added a new repo in Gitea, pushed a mp4 file which I did set for LFS. The file was properly pushed and stored using LFS.
Then I branched the "master" branch into a "dev". I push a "test.html" file into the "dev" branch. Then in Gitea I created a pull request. Gitea said there were no conflict and that the branch can be merged automatically. But when merging, I got a 500 error (see log above). It seems related to the LFS.
Dunno if I did something wrong, but seems to be a bug to me.
Thanks
@lunny commented on GitHub (Jan 23, 2017):
@fabian-z could you give some idea?
@fabian-z commented on GitHub (Jan 23, 2017):
The error is caused by running Gitea under an OS user with the LFS client hooks installed - a workaround is to create a new user account and run Gitea using that account.
This was - apparently incompletely - fixed in my PR by disabling the hooks for external git operations using global command arguments in
code.gitea.io/git.Issue here is that the pull request model uses
code.gitea.io/gitea/modules/processpackage to construct a git command-line: https://github.com/go-gitea/gitea/blob/master/models/pull.go#L284Therefore, the arguments set for
code.gitea.io/gitdon't get applied and the operation errors out.Unfortunately, said package is used in many files to construct custom git command-lines. I originally assumed the
gitpackage would already provide an abstraction layer.We could either instrument these code parts with the necessary arguments, or port the relevant bits for usage with
code.gitea.io/gitand get global argument support with it.@lunny commented on GitHub (Feb 23, 2017):
Since no PR to be sent, I will move this to v1.2
@iCodeSometime commented on GitHub (Jan 24, 2019):
@fabian-z This is still happening with LFS enabled.
I'm unsure how to run gitea as a local user account.
I tried creating a new user account, and set the service to run under this account, and changing RUN_USER in the app.ini to run under that user, but the service will not start under that configuration.
@terokorp commented on GitHub (Mar 16, 2019):
Got same error and here is gitea.log record:
Application Version: 1.7.0
Installed by folloring this: https://docs.gitea.io/en-us/install-from-binary/
@stale[bot] commented on GitHub (May 15, 2019):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
@zeripath commented on GitHub (May 25, 2019):
Ah! I think I understand what's causing this!
Can anyone still reproduce this on 1.8+?
@zeripath commented on GitHub (May 26, 2019):
I think I may finally have found the cause.
I suspect that you have git-lfs version greater than 2.3.4 installed on your server and gitea user has a .gitconfig file containing:
If you remove that that should act as a workaround.
@zeripath commented on GitHub (May 28, 2019):
@Begounet are you able to come up with a minimal example for me? I would love to exactly figure out what is the problem here. I know it's due to the lfs smudge filter but I'd like to catch it in the act.
I think #7062 and this workaround won't be the complete solution because we do need to be aware of lfs additions on merging - i.e. What happens if you add an LFS file through a merge and then delete the adding repository - I'm highly suspicious that this file will be deleted from the LFS.
@Begounet commented on GitHub (May 28, 2019):
I will try to setup a server from my home, using the same LFS and Gitea versions but it will take some times since I am not really used to that kind of stuff. Unfortunately, I cannot provide access to our enterprise private servers.
But I think the most important thing is to at least have once LFS filtered file in the commit you want to merge.
And your workaround indeed worked! Thank you!
Shouldn't be the expected behavior?
@zeripath commented on GitHub (May 28, 2019):
@Begounet Was there anything special about your filter configuration in .gitconfig? Was it exactly the same as I put in https://github.com/go-gitea/gitea/issues/732#issuecomment-495972325 ?
The other question is what version of git do you have?
It appears that my PR #7062 is unlikely to be required as we should be setting these (except for process) anyway:
31557b1274/modules/setting/setting.go (L459-L478)@zeripath commented on GitHub (May 28, 2019):
So perhaps you have the lfs process running...
I'll adjust #7062 to ignore the process at this point instead.
@zeripath commented on GitHub (May 28, 2019):
In terms of the potential deletion bug: Suppose you have repository A and fork B.
You would need to check the LFS directly to see if it has disappeared.
This problem wouldn't just affect users like you who are likely affected by the lfs filter process but every user of LFS.
I think gitea needs to handle lfs filtering itself.
@Begounet commented on GitHub (May 28, 2019):
<repository url>/info/refs?service=git-upload-pack).He told me that there were these lines when he executed "git lfs env":
And then he founds theses lines in the global config (/etc/gitconfig).
@zeripath commented on GitHub (May 29, 2019):
FINALLY! I've managed to reproduce this, and it's stupidly easy to do.
Oh dear.
I'm so sorry this has not been fixed - I can't believe that this has been here for so long.
OK, to reproduce:
Create a repository
git lfs track '*.jpg'git add .gitattributesgit push*.jpg filter=lfs diff=lfs merge=lfs -texton the web interfaceThen with another user, fork the repository
Add a jpg over the web interface
create a pull-request with that jpg
BOOM
@zeripath commented on GitHub (May 31, 2019):
OK I finally have a working and complete bug fix for this in #7082
Now, the problem is that people who have been merging "successfully", i.e. not experiencing #732 won't realise that if they delete their forks their LFS objects will disappear.
@kleszcz commented on GitHub (Jul 9, 2019):
Hi, unfortunately we're experiencing this old "500" error when merging pull requests with files in lfs through Gitea.
Also it comes with error log same as reported in #4463. We've checked for the .gitconfig entries mentioned above and there are none.
@mrsdizzie commented on GitHub (Jul 9, 2019):
@kleszcz the mentioned fix for this not present in the 1.8.3 release that you are using. You would need to use master branch or wait for the 1.9 release (1.9 release candidate will be available very soon and hopefully final 1.9 release not terribly long after).