go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.59k stars 5.45k forks source link

Can't push lfs files to old repo #9194

Open lonelyleaf opened 4 years ago

lonelyleaf commented 4 years ago

Description

I'm trying to push lfs fils to an repo but get these message:

17:09:37.817: [Yun-TMS] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/dev:dev
Uploading LFS objects:   0% (0/1), 0 B | 0 B/s                                  
Uploading LFS objects:   0% (0/2), 0 B | 0 B/s, done
batch response: Repository or object not found: https://******/gmt/Yun-TMS.git/info/lfs/objects/batch
Check that it exists and that you have proper access to it
warning: redirecting to https://******/yun-tms/Yun-TMS/
error: failed to push some refs to 'https://******/gmt/Yun-TMS.git'

But then I open a new repo on gitea ,add a new remote on local ,and push to server,everything is ok.

Is there any thing I need to do to upgrade my repo on server to support lfs?

Screenshots

lunny commented 4 years ago

We need more details, could you paste some logs here? Nothing extra things need to do when enable lfs on server. Just change the app.ini and restart gitea.

lonelyleaf commented 4 years ago

I thinnk there are no uesful log on server,though I will still post it below.

And I can be sure I have enable lfs on server ,because when I create a new repo on server and add it as a new remote on my local repo,I can push successfully.

[Macaron] 2019-12-09 15:53:22: Completed GET /Hao/config-repo.git/info/refs?service=git-upload-pack 200 OK in 231.083494ms
[Macaron] 2019-12-09 15:53:29: Started GET /gmt/Yun-TMS.git/info/refs?service=git-receive-pack for 10.1.31.23
2019/12/09 15:53:29 ...s/context/context.go:329:func1() [D] Session ID: dba28bf7074ebbd3
2019/12/09 15:53:29 ...s/context/context.go:330:func1() [D] CSRF Token: FaOSLIED0atUv73QgI70Yw8tZTI6MTU3NTg3ODAwOTQ5MDk2MDgxNw
[Macaron] 2019-12-09 15:53:29: Completed GET /gmt/Yun-TMS.git/info/refs?service=git-receive-pack 302 Found in 19.080836ms
[Macaron] 2019-12-09 15:53:29: Started GET /yun-tms/Yun-TMS/info/refs?service=git-receive-pack for 10.1.31.23
2019/12/09 15:53:29 ...s/context/context.go:329:func1() [D] Session ID: b4429d744d064475
2019/12/09 15:53:29 ...s/context/context.go:330:func1() [D] CSRF Token: 4NAvySxs9SpQeML3JZgo1rUtMNk6MTU3NTg3ODAwOTUxOTc2MDg3OQ
[Macaron] 2019-12-09 15:53:29: Completed GET /yun-tms/Yun-TMS/info/refs?service=git-receive-pack 401 Unauthorized in 6.045709ms
[Macaron] 2019-12-09 15:53:30: Started GET /yun-tms/Yun-TMS/info/refs?service=git-receive-pack for 10.1.31.23
2019/12/09 15:53:30 ...s/context/context.go:329:func1() [D] Session ID: 89432364f5fa67fa
2019/12/09 15:53:30 ...s/context/context.go:330:func1() [D] CSRF Token: uu2HJYwY1y74n5lmVDrS4b2nuE06MTU3NTg3ODAxMDE3MDA1MjY5MQ
2019/12/09 15:53:30 ...s/repo_permission.go:154:func1() [T] Permission Loaded for 824731051024:luoqiyi in 824731051104:yun-tms/Yun-TMS:
Permissions: AccessMode: 824731051680:owner, 5 Units, 0 UnitsMode(s): [
Units[0]: ID: 824731051200 RepoID: 824731051232 Type: 824731051712:UnitTypeCode Config: {}
Units[1]: ID: 824731051296 RepoID: 824731051328 Type: 824731051744:UnitTypeIssues Config: {"EnableTimetracker":true,"AllowOnlyContributorsToTrackTime":true,"EnableDependencies":true}
Units[2]: ID: 824731051392 RepoID: 824731051424 Type: 824731051776:UnitTypePullRequests Config: {"IgnoreWhitespaceConflicts":false,"AllowMerge":true,"AllowRebase":true,"AllowRebaseMerge":true,"AllowSquash":true}
Units[3]: ID: 824731051504 RepoID: 824731051536 Type: 824731051808:UnitTypeReleases Config: {}
Units[4]: ID: 824731051600 RepoID: 824731051632 Type: 824731051840:UnitTypeWiki Config: {} ]
[Macaron] 2019-12-09 15:53:31: Completed GET /yun-tms/Yun-TMS/info/refs?service=git-receive-pack 200 OK in 886.450134ms
[Macaron] 2019-12-09 15:53:32: Started GET /gmt/Yun-TMS.git/info/refs?service=git-upload-pack for 10.1.31.21
2019/12/09 15:53:32 ...s/context/context.go:329:func1() [D] Session ID: 12933fe8719772a4
2019/12/09 15:53:32 ...s/context/context.go:330:func1() [D] CSRF Token: IrJNicyl15W9QzmA21_qilG4Q3k6MTU3NTg3ODAxMjM2Mjc0MjAxNQ
[Macaron] 2019-12-09 15:53:32: Completed GET /gmt/Yun-TMS.git/info/refs?service=git-upload-pack 302 Found in 16.305431ms
[Macaron] 2019-12-09 15:53:32: Started GET /yun-tms/Yun-TMS/info/refs?service=git-upload-pack for 10.1.31.21
2019/12/09 15:53:32 ...s/context/context.go:329:func1() [D] Session ID: 353e28e6f9087c41
2019/12/09 15:53:32 ...s/context/context.go:330:func1() [D] CSRF Token: _bCUxZ6XdUDNrPUx_C5lp7fB4mU6MTU3NTg3ODAxMjM4OTg4MTA5Mw
[Macaron] 2019-12-09 15:53:32: Completed GET /yun-tms/Yun-TMS/info/refs?service=git-upload-pack 401 Unauthorized in 6.53012ms
[Macaron] 2019-12-09 15:53:32: Started GET /yun-tms/Yun-TMS/info/refs?service=git-upload-pack for 10.1.31.21
2019/12/09 15:53:32 ...s/context/context.go:329:func1() [D] Session ID: e90ad0fb4d256a63
2019/12/09 15:53:32 ...s/context/context.go:330:func1() [D] CSRF Token: IxBygi_wiJ5pONv6xcTXbxvhsD46MTU3NTg3ODAxMjg0OTM3MDIzMg
2019/12/09 15:53:33 ...s/repo_permission.go:154:func1() [T] Permission Loaded for 824731378832:luoqiyi in 824731378912:yun-tms/Yun-TMS:
Permissions: AccessMode: 824731379472:owner, 5 Units, 0 UnitsMode(s): [
Units[0]: ID: 824731379008 RepoID: 824731379040 Type: 824731379504:UnitTypeCode Config: {}
Units[1]: ID: 824731379104 RepoID: 824731379136 Type: 824731379536:UnitTypeIssues Config: {"EnableTimetracker":true,"AllowOnlyContributorsToTrackTime":true,"EnableDependencies":true}
Units[2]: ID: 824731379200 RepoID: 824731379232 Type: 824731379568:UnitTypePullRequests Config: {"IgnoreWhitespaceConflicts":false,"AllowMerge":true,"AllowRebase":true,"AllowRebaseMerge":true,"AllowSquash":true}
Units[3]: ID: 824731379296 RepoID: 824731379328 Type: 824731379600:UnitTypeReleases Config: {}
Units[4]: ID: 824731379392 RepoID: 824731379424 Type: 824731379632:UnitTypeWiki Config: {} ]
[Macaron] 2019-12-09 15:53:33: Completed GET /yun-tms/Yun-TMS/info/refs?service=git-upload-pack 200 OK in 350.743237ms
[Macaron] 2019-12-09 15:53:34: Started POST /gmt/Yun-TMS.git/info/lfs/objects/batch for 10.1.31.23
2019/12/09 15:53:34 ...s/context/context.go:329:func1() [D] Session ID: 37cfd367bb8b6c8f
2019/12/09 15:53:34 ...s/context/context.go:330:func1() [D] CSRF Token: N_WB_WtT56gIK5YIJTI1jltuaqQ6MTU3NTg3ODAxNDIzNDE1OTQyMA
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

sapk commented 4 years ago

@lonelyleaf do you have rename in the past gmt to yun-tms ? It seems to have a old reference but I don't know if it come from your side or in gitea.

sapk commented 4 years ago

You should be able to review on your side the lfs configuration with git lfs env in your repo.

lonelyleaf commented 4 years ago

Because of novel coronavirus our office is still closing 😂.I will check next few days

techknowlogick commented 4 years ago

Because of novel coronavirus our office is still closing 😂.I will check next few days

Take care of yourself. I’ll make sure stalebot doesn’t touch this ticket so you can take whatever time you need to stay safe.

lonelyleaf commented 4 years ago

@sapk Well,why can't I use git lfs command in docker image?

bash-5.0# git versions
git version 2.24.1
bash-5.0# git lfs
git: 'lfs' is not a git command. See 'git --help'.

The most similar command is
        log
sapk commented 4 years ago

@lonelyleaf lfs is not in the gitea image as it not needed (implemented in go).

When I mean to check your lfs configuration is to find the endpoint defined on your computer (in your local repo).

lonelyleaf commented 4 years ago

@sapk

I did change the owner of the repo on gitea,maybe that is the reason

git-lfs/2.6.1 (GitHub; windows amd64; go 1.11.1; git dc072c3e)
git version 2.20.1.windows.1

Endpoint=https://******/yun-tms/Yun-TMS.git/info/lfs (auth=basic)
LocalWorkingDir=E:\Java\Yun-TMS
LocalGitDir=E:\Java\Yun-TMS\.git
LocalGitStorageDir=E:\Java\Yun-TMS\.git
LocalMediaDir=E:\Java\Yun-TMS\.git\lfs\objects
LocalReferenceDirs=
TempDir=E:\Java\Yun-TMS\.git\lfs\tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=E:\Java\Yun-TMS\.git\lfs
AccessDownload=basic
AccessUpload=basic
DownloadTransfers=basic
UploadTransfers=basic
GIT_EXEC_PATH=D:/Program Files/Git/mingw64/libexec/git-core
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
sapk commented 4 years ago

Yes I think the change of the owner is the reason since lfs part still point to the old reference. At first glance I don't remember how we should handle this part and neither how we do it. Maybe we should advertise to change the remote lfs definition (like needed for standard git command).

I haven't time to look at all the details soon so if someone can have a look at the code don't hesitate.