Bitbucket git LFS giving weird error message
Asked Answered
E

4

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?

Earthquake answered 10/3, 2017 at 10:15 Comment(0)
G
10

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.

Gravestone answered 20/10, 2017 at 13:18 Comment(0)
U
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 : [email protected]:{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

Utgardloki answered 10/3, 2017 at 19:35 Comment(2)
According to the changelog of Git LFS v2.0.0 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.Prussianism
You're welcome, can you set my answer as the accepted answer?Utgardloki
D
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.

Dimorphous answered 12/2, 2019 at 1:18 Comment(1)
This is what has worked for me too. on git version 2.26 in Linux (fedora 32) and git-lfs/2.12Glutathione
O
-1

Just wanted to chime in here and say that this can happen if you are trying to push commits from a nested folder in your project. If you cd back to your project root where your .git folder is, it should work.

(unless you have some other problem)

Orange answered 28/12, 2023 at 23:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.