Skip to content

Authentication required to push to a contributor's fork #2190

Closed

Description

@jonasmalacofilho

I can't seem to push to a contributor's fork anymore:

ERROR: Authentication error: Authentication required: You must have push access to verify locks
error: failed to push some refs to '[email protected]:/lehonma/the-online-brt-planning-guide'
Context

Repository: https://github.com/ITDP/the-online-brt-planning-guide
Maintainer fork: https://github.com/lehonma/the-online-brt-planning-guide
PR/fork branch: ITDP/the-online-brt-planning-guide#158 (Chapter_17)

GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push
03:57:43.271542 git.c:371               trace: built-in: git 'push'
03:57:43.275577 run-command.c:369       trace: run_command: 'ssh' '[email protected]' 'git-receive-pack '\''/lehonma/the-online-brt-planning-guide'\'''
Host key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
+---[RSA 2048]----+
| =+o...+=o..     |
|o++... *o .      |
|*.o.  *o.        |
|oo.  ..o.= .     |
|.+o. .. S =      |
|*=+ .  o = .     |
|OE .  . o        |
| o     .         |
|                 |
+----[SHA256]-----+
03:57:44.841000 run-command.c:369       trace: run_command: '.git/hooks/pre-push' 'lehonma' '[email protected]:/lehonma/the-online-brt-planning-guide'
03:57:44.853271 git.c:595               trace: exec: 'git-lfs' 'pre-push' 'lehonma' '[email protected]:/lehonma/the-online-brt-planning-guide'
03:57:44.853361 run-command.c:369       trace: run_command: 'git-lfs' 'pre-push' 'lehonma' '[email protected]:/lehonma/the-online-brt-planning-guide'
trace git-lfs: run_command: 'git' config -l
trace git-lfs: run_command: 'git' version
trace git-lfs: tq: running as batched queue, batch size of 100
trace git-lfs: ssh: [email protected] git-lfs-authenticate /lehonma/the-online-brt-planning-guide upload
trace git-lfs: HTTP: POST https://lfs.github.com/lehonma/the-online-brt-planning-guide/locks/verify
> POST /lehonma/the-online-brt-planning-guide/locks/verify HTTP/1.1
> Host: lfs.github.com
> Accept: application/vnd.git-lfs+json; charset=utf-8
> Authorization: RemoteAuth ABv2MMTOyObxyCZruK4PxfmaBMogpT4Sks5ZBd9KwA==
> Content-Length: 2
> Content-Type: application/vnd.git-lfs+json; charset=utf-8
> User-Agent: git-lfs/2.1.0 (GitHub; linux amd64; go 1.8; git bd2c9987)
> 
{}trace git-lfs: HTTP: 403


< HTTP/1.1 403 Forbidden
< Content-Length: 155
< Content-Type: application/vnd.git-lfs+json
< Date: Sun, 30 Apr 2017 06:57:46 GMT
< X-Github-Request-Id: D3D2:6633:259B82A:30791B6:59058AEA
< 
trace git-lfs: HTTP: {"documentation_url":"https://github.com/contact","message":"You must have push access to verify locks","request_id":"D3D2:6633:259B82A:30791B6:59058AEA"}

{"documentation_url":"https://github.com/contact","message":"You must have push access to verify locks","request_id":"D3D2:6633:259B82A:30791B6:59058AEA"}
ERROR: Authentication error: Authentication required: You must have push access to verify locks
error: failed to push some refs to '[email protected]:/lehonma/the-online-brt-planning-guide'
git lfs env
git-lfs/2.1.0 (GitHub; linux amd64; go 1.8; git bd2c9987)
git version 2.12.2

Endpoint=https://github.com//ITDP/the-online-brt-planning-guide.git/info/lfs (auth=none)
  [email protected]:/ITDP/the-online-brt-planning-guide
Endpoint (craice)=https://github.com//craice/the-online-brt-planning-guide.git/info/lfs (auth=none)
  [email protected]:/craice/the-online-brt-planning-guide
Endpoint (aszasz)=https://github.com//aszasz/the-online-brt-planning-guide.git/info/lfs (auth=none)
  [email protected]:/aszasz/the-online-brt-planning-guide
Endpoint (thaiscmlima)=https://github.com/thaiscmlima/the-online-brt-planning-guide.git/info/lfs (auth=none)
Endpoint (jonasmalacofilho)=https://github.com/jonasmalacofilho/the-online-brt-planning-guide.git/info/lfs (auth=none)
  [email protected]:jonasmalacofilho/the-online-brt-planning-guide.git
Endpoint (brtpguy)=https://github.com//brtpguy/the-online-brt-planning-guide.git/info/lfs (auth=none)
  [email protected]:/brtpguy/the-online-brt-planning-guide
Endpoint (dcpaschall)=https://github.com//dcpaschall/the-online-brt-planning-guide.git/info/lfs (auth=none)
  [email protected]:/dcpaschall/the-online-brt-planning-guide
Endpoint (lehonma)=https://github.com//lehonma/the-online-brt-planning-guide.git/info/lfs (auth=none)
  [email protected]:/lehonma/the-online-brt-planning-guide
LocalWorkingDir=/home/j/Code/tobrtpg
LocalGitDir=/home/j/Code/tobrtpg/.git
LocalGitStorageDir=/home/j/Code/tobrtpg/.git
LocalMediaDir=/home/j/Code/tobrtpg/.git/lfs/objects
LocalReferenceDir=
TempDir=/home/j/Code/tobrtpg/.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
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic
UploadTransfers=basic
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"

Activity

  1. changed the title [-]Authentication required to push to a contributors fork[/-] [+]Authentication required to push to a contributor's fork[/+] on Apr 30, 2017
  2. ttaylorr commented on Apr 30, 2017

    @ttaylorr
    Contributor

    Hi @jonasmalacofilho, thanks for opening this. I think what's going on here is that since LFS is not supported on GitHub in forked repositories, we're responding with a 403 (unauthenticated, forbidden) when LFS runs the pre-push locks verification check.

    That 403 halts the subsequent push by returning a non-zero exit code from the pre-push hook, and therefore does not allow you to push.

    I'll be able to take a greater look into this tomorrow, but in the meantime, you should be able to run:

    git config -f .lfsconfig "lfs.https://github.com/lehonma/the-online-brt-planning-guide/.locksverify" "false"
    

    and try the push again.

  3. jonasmalacofilho commented on Apr 30, 2017

    @jonasmalacofilho
    Author

    Hi @ttaylorr , thanks for the help. I had thought of forcing a setting like that, but couldn't figure it out exactly on my own.

    However, after setting that up, the issue still remains.

  4. ttaylorr commented on May 1, 2017

    @ttaylorr
    Contributor

    See: #2191.

  5. technoweenie commented on May 1, 2017

    @technoweenie
    Contributor

    @jonasmalacofilho I think your git push command is too vague. If you run git push origin master, it'll only try to push to ITDP/the-online-brt-planning-guide. You don't seem to have push access to lehonma/the-online-brt-planning-guide.

  6. jonasmalacofilho commented on May 1, 2017

    @jonasmalacofilho
    Author

    @ttaylorr I'm not sure why you referred me to that issue (and closed this one). The parent repository has LFS objects already (and I have commit access to it as well); so does the fork.

  7. jonasmalacofilho commented on May 1, 2017

    @jonasmalacofilho
    Author

    @technoweenie I should have clarified that, thanks: in this instance, git push is equivalent to git push lehonma Chapter_17 because that has been set as upstream when the branch was initially checked out.

    EDIT: regarding access to thepository repo, the PR had "allow edits from maintainers" enabled.

  8. jonasmalacofilho commented on May 1, 2017

    @jonasmalacofilho
    Author

    Also, some other clarifications:

    • the parent repository has been using LFS for almost a year
    • me and others in my team have successfully pushed to contributors' forks (of this same repo) in the past; in fact, @aszasz did just that (in the same PR) a day before
    • this particular push to the fork had no new LFS objects (yeah, that has failed in the past, but this isn't the case)
  9. technoweenie commented on May 1, 2017

    @technoweenie
    Contributor

    the PR had "allow edits from maintainers" enabled

    Ah, that makes sense. LFS doesn't support per-branch permissions like this right now. It's a relatively newer GitHub feature, so it wasn't really included in the initial LFS API design. There was an older attempt to get this in (#1456), but it was never finished.

    Are you still having problems after turning lfs.locksverify off for that repository? What's the error?

    @ttaylorr: I think we should talk about trying to get #1456 into v2.2.0. With the refactors in v2.0, most of this work will likely have to be re-done. Also, need to think about how this affects the locking API too.

  10. jonasmalacofilho commented on May 1, 2017

    @jonasmalacofilho
    Author

    After running

    git config -f .lfsconfig "lfs.https://github.com/lehonma/the-online-brt-planning-guide/.locksverify" "false"
    

    , the issue looks to be the same...

    GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push lehonma Chapter_17
    14:32:04.499992 git.c:371               trace: built-in: git 'push' 'lehonma' 'Chapter_17'
    14:32:04.504750 run-command.c:369       trace: run_command: 'ssh' '[email protected]' 'git-receive-pack '\''/lehonma/the-online-brt-planning-guide'\'''
    Host key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
    +---[RSA 2048]----+
    | =+o...+=o..     |
    |o++... *o .      |
    |*.o.  *o.        |
    |oo.  ..o.= .     |
    |.+o. .. S =      |
    |*=+ .  o = .     |
    |OE .  . o        |
    | o     .         |
    |                 |
    +----[SHA256]-----+
    14:32:06.266442 run-command.c:369       trace: run_command: '.git/hooks/pre-push' 'lehonma' '[email protected]:/lehonma/the-online-brt-planning-guide'
    14:32:06.277103 git.c:595               trace: exec: 'git-lfs' 'pre-push' 'lehonma' '[email protected]:/lehonma/the-online-brt-planning-guide'
    14:32:06.277170 run-command.c:369       trace: run_command: 'git-lfs' 'pre-push' 'lehonma' '[email protected]:/lehonma/the-online-brt-planning-guide'
    trace git-lfs: run_command: 'git' config -l -f /home/j/Code/tobrtpg/.lfsconfig
    trace git-lfs: run_command: 'git' config -l
    trace git-lfs: run_command: 'git' version
    trace git-lfs: tq: running as batched queue, batch size of 100
    trace git-lfs: ssh: [email protected] git-lfs-authenticate /lehonma/the-online-brt-planning-guide upload
    trace git-lfs: HTTP: POST https://lfs.github.com/lehonma/the-online-brt-planning-guide/locks/verify
    > POST /lehonma/the-online-brt-planning-guide/locks/verify HTTP/1.1
    > Host: lfs.github.com
    > Accept: application/vnd.git-lfs+json; charset=utf-8
    > Authorization: RemoteAuth ABv2MFFMrvTmnYEB-QQpAmIktrjSTdkCks5ZB8V3wA==
    > Content-Length: 2
    > Content-Type: application/vnd.git-lfs+json; charset=utf-8
    > User-Agent: git-lfs/2.1.0 (GitHub; linux amd64; go 1.8; git bd2c9987)
    > 
    {}trace git-lfs: HTTP: 403
    
    
    < HTTP/1.1 403 Forbidden
    < Content-Length: 153
    < Content-Type: application/vnd.git-lfs+json
    < Date: Mon, 01 May 2017 17:32:08 GMT
    < X-Github-Request-Id: AEF0:6B82:279016:3321C9:59077117
    < 
    trace git-lfs: HTTP: {"documentation_url":"https://github.com/contact","message":"You must have push access to verify locks","request_id":"AEF0:6B82:279016:3321C9:59077117"}
    
    {"documentation_url":"https://github.com/contact","message":"You must have push access to verify locks","request_id":"AEF0:6B82:279016:3321C9:59077117"}
    ERROR: Authentication error: Authentication required: You must have push access to verify locks
    error: failed to push some refs to '[email protected]:/lehonma/the-online-brt-planning-guide'
    
  11. technoweenie commented on May 1, 2017

    @technoweenie
    Contributor

    Ah, I think Taylor gave you the wrong URL to fix the config. Try this:

    $ git config -f .lfsconfig "lfs.https://lfs.github.com/lehonma/the-online-brt-planning-guide.locksverify" "false"
  12. jonasmalacofilho commented on May 1, 2017

    @jonasmalacofilho
    Author

    @technoweenie oh, thanks... still:

    $ git config -f .lfsconfig --list
    lfs.https://lfs.github.com/lehonma/the-online-brt-planning-guide.locksverify=false
    
    $ GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push lehonma Chapter_17
    16:31:51.433862 git.c:371               trace: built-in: git 'push' 'lehonma' 'Chapter_17'
    16:31:51.438721 run-command.c:369       trace: run_command: 'ssh' '[email protected]' 'git-receive-pack '\''/lehonma/the-online-brt-planning-guide'\'''
    Host key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
    +---[RSA 2048]----+
    | =+o...+=o..     |
    |o++... *o .      |
    |*.o.  *o.        |
    |oo.  ..o.= .     |
    |.+o. .. S =      |
    |*=+ .  o = .     |
    |OE .  . o        |
    | o     .         |
    |                 |
    +----[SHA256]-----+
    16:31:53.023879 run-command.c:369       trace: run_command: '.git/hooks/pre-push' 'lehonma' '[email protected]:/lehonma/the-online-brt-planning-guide'
    16:31:53.036036 git.c:595               trace: exec: 'git-lfs' 'pre-push' 'lehonma' '[email protected]:/lehonma/the-online-brt-planning-guide'
    16:31:53.036128 run-command.c:369       trace: run_command: 'git-lfs' 'pre-push' 'lehonma' '[email protected]:/lehonma/the-online-brt-planning-guide'
    trace git-lfs: run_command: 'git' config -l -f /home/j/Code/tobrtpg/.lfsconfig
    trace git-lfs: run_command: 'git' config -l
    trace git-lfs: run_command: 'git' version
    trace git-lfs: tq: running as batched queue, batch size of 100
    trace git-lfs: ssh: [email protected] git-lfs-authenticate /lehonma/the-online-brt-planning-guide upload
    trace git-lfs: HTTP: POST https://lfs.github.com/lehonma/the-online-brt-planning-guide/locks/verify
    > POST /lehonma/the-online-brt-planning-guide/locks/verify HTTP/1.1
    > Host: lfs.github.com
    > Accept: application/vnd.git-lfs+json; charset=utf-8
    > Authorization: RemoteAuth ABv2MI-ryzt6YzyNJ-p_41aderJhthj2ks5ZB-GKwA==
    > Content-Length: 2
    > Content-Type: application/vnd.git-lfs+json; charset=utf-8
    > User-Agent: git-lfs/2.1.0 (GitHub; linux amd64; go 1.8; git bd2c9987)
    > 
    {}trace git-lfs: HTTP: 403
    
    
    < HTTP/1.1 403 Forbidden
    < Content-Length: 153
    < Content-Type: application/vnd.git-lfs+json
    < Date: Mon, 01 May 2017 19:31:55 GMT
    < X-Github-Request-Id: E440:6B82:3D46EB:4F0920:59078D2A
    < 
    trace git-lfs: HTTP: {"documentation_url":"https://github.com/contact","message":"You must have push access to verify locks","request_id":"E440:6B82:3D46EB:4F0920:59078D2A"}
    
    {"documentation_url":"https://github.com/contact","message":"You must have push access to verify locks","request_id":"E440:6B82:3D46EB:4F0920:59078D2A"}
    ERROR: Authentication error: Authentication required: You must have push access to verify locks
    error: failed to push some refs to '[email protected]:/lehonma/the-online-brt-planning-guide'
    
  13. technoweenie commented on May 1, 2017

    @technoweenie
    Contributor

    Bah, ok. Hit something a little surprising, this should work:

    $ git config -f .lfsconfig "lfs.https://github.com/lehonma/the-online-brt-planning-guide.git.locksverify" "false"
    

    This has to do with how LFS guesses the server url based on the Git remote. Taylor forgot the .git extension for the repository url, and I went way off into left field with my lfs.github.com suggestion.

    We should be able to make a simple tweak to let Taylor's suggestion work in the next patch release.

  14. jonasmalacofilho commented on May 2, 2017

    @jonasmalacofilho
    Author

    Actually, that didn't work either.

    But after a few tests I figured it out:

    git config lfs.https://github.com//lehonma/the-online-brt-planning-guide.git/info/lfs.locksverify false
    

    Basically, it required the same endpoint URL that's listed in git lfs env.

  15. technoweenie commented on May 2, 2017

    @technoweenie
    Contributor

    Oh interesting. The fact that works looks like a bug, actually. Your ssh remote is specified like this: [email protected]:/ITDP/the-online-brt-planning-guide, with an extra forward slash. That extra slash is retained when converted to a URL. I think we'll have to fix that in v2.1.1, since it's totally surprising behavior.

  16. jonasmalacofilho commented on May 3, 2017

    @jonasmalacofilho
    Author

    @technoweenie you're right!

    When I managed to push I thought the relevant part was the /info/lfs at the end of the URL... but after testing it some more it is indeed just that doubled forward slash.

  17. reuben commented on May 30, 2020

    @reuben

    Trying the solution posted here now, I get a message about the config being ignored when I try to push:

    WARNING: These unsafe lfsconfig keys were ignored:
    
      lfs.https://lfs.github.com/contributor/fork.locksverify
      lfs.https://github.com/contributoor/repo.git/info/lfs.locksverify
    ERROR: Authentication error: Authentication required: You must have push access to verify locks
    
  18. bk2204 commented on Jun 1, 2020

    @bk2204
    Member

    Those keys can't be stored in .lfsconfig; you'll need to store them in the regular Git config file instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions