Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

batch response: Authorization error: when pushing lfs files

Arturo May 14, 2018

Hi there!

I am using my own custom bitbucket server for managing large files but I am getting  the following error when trying to push a commit which contains LFS files. 

lotte@lotte:/media/lotte/data2/deep-learning$ git push origin master
batch response: Authorization error: http://bitbucket.lars.com/scm/di/deep-learning.git/info/lfs/objects/batch
Check that you have proper access to the repository
error: failed to push some refs to 'ssh://git@10.15.56.72:7999/di/deep-learning.git'

I have already given access to the user and generated an ssh key. I have also enabled the lfs option for the repository as explained in here 

 

This is is a more detailed output

 

GIT_TRACE=1 git push origin master
13:49:48.669270 git.c:344 trace: built-in: git 'push' 'origin' 'master'
13:49:48.669660 run-command.c:334 trace: run_command: 'ssh' '-p' '7999' 'git@10.15.56.72' 'git-receive-pack '\''/di/deep-learning.git'\'''
13:49:48.826746 run-command.c:334 trace: run_command: '.git/hooks/pre-push' 'origin' 'ssh://git@10.15.56.72:7999/di/deep-learning.git'
13:49:48.829168 git.c:561 trace: exec: 'git-lfs' 'pre-push' 'origin' 'ssh://git@10.15.56.72:7999/di/deep-learning.git'
13:49:48.829212 run-command.c:334 trace: run_command: 'git-lfs' 'pre-push' 'origin' 'ssh://git@10.15.56.72:7999/di/deep-learning.git'
13:49:48.833697 trace git-lfs: exec: git 'version'
13:49:48.837837 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=cat' '-c' 'filter.lfs.clean=cat' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
13:49:48.842395 trace git-lfs: exec: git 'config' '-l'
13:49:48.844936 trace git-lfs: pre-push: refs/heads/master a55b1c29e8e5a5d98f37f70857c5dc14d4106a3e refs/heads/master 5642fa6ea3d1d9a66e277efc1171c020c5736bdc
13:49:48.987305 trace git-lfs: tq: running as batched queue, batch size of 100
13:49:48.987551 trace git-lfs: run_command: git rev-list --stdin --objects --not --remotes=origin --
13:49:48.988902 trace git-lfs: run_command: git cat-file --batch
13:49:48.991631 trace git-lfs: tq: sending batch of size 1
13:49:48.991878 trace git-lfs: run_command: ssh -p 7999 -- git@10.15.56.72 git-lfs-authenticate di/deep-learning.git upload
13:49:49.115327 trace git-lfs: api: batch 1 files
13:49:49.115589 trace git-lfs: HTTP: POST http://bitbucket.lars.com/scm/di/deep-learning.git/info/lfs/objects/batch
13:49:49.323935 trace git-lfs: HTTP: 403
13:49:49.324077 trace git-lfs: api error: Authorization error: http://bitbucket.lars.com/scm/di/deep-learning.git/info/lfs/objects/batch
Check that you have proper access to the repository
batch response: Authorization error: http://bitbucket.lars.com/scm/di/deep-learning.git/info/lfs/objects/batch
Check that you have proper access to the repository
error: failed to push some refs to 'ssh://git@10.15.56.72:7999/di/deep-learning.git' 

2 answers

1 vote
braindigitalis October 9, 2019

I spent an entire afternoon trying to fix this on my own instance of bitbucket 6.5.1.

Firstly, git-lfs uses HTTP. You must access your repository via HTTP for the LFS portion and this is what's failing.

It turns out that if you have your bitbucket behind an apache or other web server with reverse proxying, apache will not pass the authentication tokens through to bitbucket.

So in our setup, instead of trying to push LFS to https://your.domain.com/bitbucket/  you would need to commit to http://internal-servername:7990/bitbucket.

I hope this helps you, or anyone else who might stumble across this post, as it took too much of my time to figure out!

Enjoy!

0 votes
Kristy
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 17, 2018

Hi @Arturo,

This isn't an answer, but I can't comment on the question itself. Can you please provide some more information to help me diagnose the problem?

What version of Bitbucket Server are you using? Is it possible you are experiencing this issue which was fixed in 5.9?

Also, to try and narrow down the problem, does the same issue happen when you have an http remote? Is the user able to clone the repo via http?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events