Git push with lfs plugins, "Authentication required: Authorization error"

454 views
Skip to first unread message

Yingchun Li

unread,
Feb 16, 2021, 12:31:55 AM2/16/21
to Repo and Gerrit Discussion
Hi
    My server use Apache2 http as the authentication, and I can
clone and push with normal objects, but with the lfs objects, when
push use

git lfs push origin --all

it says:
Authentication required: Authorization error: http://gerrit.local/plugins/lfs/content/default/2d9205f4f882c091ab9e5421e4d3f28d792479d073b1edce12632316b8f93c81                         
Check that you have proper access to the repository

Enabled trace when push :
GIT_TRACE=1 GIT_URL_VERBOSE=1 git lfs push origin --all
Part of its log was:
"
13:11:34.060907 trace git-lfs: creds: git credential fill ("http", "gerrit.local", "")
13:11:34.061710 git.c:444               trace: built-in: git credential fill
13:11:34.061821 run-command.c:664       trace: run_command: 'git credential-store get'
13:11:34.063594 git.c:444               trace: built-in: git credential-store get
13:11:34.063953 trace git-lfs: Filled credentials for http://git-...@gerrit.local/a/sandbox
13:11:34.064251 trace git-lfs: HTTP: POST http://git-...@gerrit.local/a/sandbox.git/info/lfs/objects/batch
13:11:34.067210 trace git-lfs: HTTP: 200
13:11:34.067228 trace git-lfs: creds: git credential approve ("http", "gerrit.local", "")
13:11:34.068117 git.c:444               trace: built-in: git credential approve
13:11:34.068251 run-command.c:664       trace: run_command: 'git credential-store store'
13:11:34.069396 git.c:444               trace: built-in: git credential-store store
13:11:34.069916 trace git-lfs: HTTP: {"objects":[{"oid":"2d9205f4f882c091ab9e5421e4d3f28d792479d073b1edce12632316b8f93c81","size":72786848,"actions":{"upload":{"expires_at":"2021-02-16T05:11:44.066Z","expires_in":10,"href":"http://gerrit.local/plugins/lfs/content/default/2d9205f4f882c091ab9e5421e4d3f28d792479d073b1edce12632316b8f93c81","header":{"Authorization":"84qUzAJ00ziEhthTG06IueKLkR3/SnJ29cIS9ooWJhT7UZqrAt7H9tiYVbUdWAxtFzCjzg/LGo3aYq2zLa9Isxg2hStololwQfrOU0P6bVTJ3p16egrf72gyAJbaZ0pABPWQ5Z37WLMsHOSOjMkkNKgAfKf8Ul60qIbr78vUwrY="}}}}]}
13:11:34.070006 trace git-lfs: tq: starting transfer adapter "basic"
13:11:34.103359 trace git-lfs: HTTP: 401
13:11:34.103442 trace git-lfs: tq: retrying object 2d9205f4f882c091ab9e5421e4d3f28d792479d073b1edce12632316b8f93c81: Authentication required: Authorization error: http://gerrit.local/plugins/lfs/content/default/2d9205f4f882c091ab9e5421e4d3f28d792479d073b1edce12632316b8f93c81
Check that you have proper access to the repository
13:11:34.103456 trace git-lfs: tq: enqueue retry #1 after 0.25s for "2d9205f4f882c091ab9e5421e4d3f28d792479d073b1edce12632316b8f93c81" (size: 72786848)
13:11:34.353708 trace git-lfs: tq: sending batch of size 1
13:11:34.353915 trace git-lfs: api: batch 1 files
"
it return the http error 401.

And checking the apaceh2's log:

[Tue Feb 16 13:12:10.182256 2021] [auth_basic:error] [pid 5893:tid 140064948463360] [client 192.168.10.221:59870] AH01614: client used wrong authentication scheme: /plugins/lfs/content/default/2d9205f4f882c091ab9e5421e4d3f28d792479d073b1edce12632316b8f93c81

seems there are two authentication, one is used for clone,push(they are
same with login), one is used for lfs plugin(which come from user-->setting-->http credential?), don't know how to make both of them work.

I have config the lfs plugin as

Part of my gerrit settings:
[auth]
type = HTTP
emailFormat = {0}@gerrit.local
gitBasicAuthPolicy = HTTP
trustContainerAuth = true
[receive]
enableSignedPush = false
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = proxy-http://*:8081/
[cache]
directory = cache
[lfs]
plugin = lfs

Br,
Yingchun
Reply all
Reply to author
Forward
0 new messages