10

I have worked on a git LFS via bitbucket for a while with no problem. I was working on my own but recently a trainee has joined me and we do not manage to push files from his machines.

We have been able to clone the repo on his machine (including the large files), make a few local commits with no problem. Though when it comes to pushing we have an authentication problem that says

Authentication required: Authorization error: https://bitbucket... ... Check that you have proper access to the repository

The problem is shown in the image below:

enter image description here

Note that my trainee has write access rights to the repo (in bitbucket).

Any idea of what's going on?

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
arennuit
  • 855
  • 1
  • 7
  • 23

3 Answers3

8

This is a known issue: https://jira.atlassian.com/browse/BSERV-9623

Jade Skaggs suggests in one of the comments to execute

git config 'lfs.locksverify' false

for any affected repo.

This works for me. It may have unwanted side effects, though.

EDIT:

It should be noted that the warning about the authentication and authorization is just that: a warning.

You can choose to ignore it. The push does succeed.

JeliJami
  • 81
  • 1
  • 3
7

I got the same issue (still doesn't fix) and I don't have enough reputation to comment your post. There is a closed issue here with the same issue of us.

It's likely that we had a problem authenticating with Git LFS. I'd recommend executing git lfs env and maybe git config -l to see your current environment.

EDIT

It appears that HTTPS is not working with GIT LFS. Using SSH solved my problem.

HTTP : https://{user}@bitbucket.org/{repo}.git

SSH : git@bitbucket.org:{repo}.git

EDIT 2

I was using Git LFS Version 2.0.1 and decided to downgrade to the 1.5.2 version to copy SourceTree config (because cloning and pushing worked with SourceTree). And now, everything is working with HTTPS (I think they broke something with the newer version)!

SourceTree Config

Tim Sylvester
  • 22,897
  • 2
  • 80
  • 94
Wingjam
  • 742
  • 8
  • 17
  • 1
    According to the changelog of [Git LFS v2.0.0](https://github.com/blog/2328-git-lfs-2-0-0-released) also drops support for the legacy API in v0.5.0. If you're still using LFS servers on the old API, you'll have to stick to v1.5.6. – JPLemelin Mar 13 '17 at 18:34
  • You're welcome, can you set my answer as the accepted answer? – Wingjam Dec 13 '17 at 15:52
4

For me, none of this worked. the only solution that worked for me is to execute the following

git config lfs.contenttype 0

I was using following git and git-lfs version

git version 2.20.1.windows.1

git-lfs/2.6.1 (GitHub; windows amd64; go 1.11.1; git dc072c3e)

My git repo was hosted in a BitBucket server. As per this discussion some versions of Bitbucket Server (and other hosting platforms) expect to receive only application/octet-stream as the content type and fails if it is set to anything else.

Joseph Abraham
  • 347
  • 4
  • 10