TypeError is thrown during clone when permission is denied to repository on BitBucket
See original GitHub issueA TypeError is thrown during clone under the following circumstances:
- The repository is hosted on Bitbucket.
- The credentials (user:password) must be valid for an existing account on the server.
- The account must not have access permission to the repository.
The problem seems to be in the capabilities negotiation.
Here’s the stack from the error:
Caused by: TypeError: Cannot read property 'split' of undefined
at parseRefsAdResponse (/mnt/c/Users/ecroc/git/external/antora/node_modules/isomorphic-git/dist/for-node/isomorphic-git/index.js:5123:20)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Function.discover (/mnt/c/Users/ecroc/git/external/antora/node_modules/isomorphic-git/dist/for-node/isomorphic-git/index.js:5241:26)
at async fetchPackfile (/mnt/c/Users/ecroc/git/external/antora/node_modules/isomorphic-git/dist/for-node/isomorphic-git/index.js:6041:22)
at async fetch (/mnt/c/Users/ecroc/git/external/antora/node_modules/isomorphic-git/dist/for-node/isomorphic-git/index.js:5902:22)
at async Object.clone (/mnt/c/Users/ecroc/git/external/antora/node_modules/isomorphic-git/dist/for-node/isomorphic-git/index.js:6413:42)
Issue Analytics
- State:
- Created 4 years ago
- Comments:21 (21 by maintainers)
Top Results From Across the Web
Git ssh clone fails with error Permission denied (publickey) in ...
Ssh git clone fails with the following error. Permission denied (publickey). fatal: Could not read from remote repository. In order to get a ......
Read more >Cloning git repository permission denied - bitbucket
Today i wanted to add a new computer to get access to one of the private repositories. So i did the following: ssh-keygen...
Read more >Changelog - Cypress Documentation
The .within() command now requires a single subject and throws an error if given more than one subject. This change adds consistency around...
Read more >git@bucket.org: Permission denied (publickey)" in Visual ...
Although I authenicated with my Bitbucket Repository, I always receive the error "Git: git@bucket.org: Permission denied (publickey)" when I ...
Read more >Can't create application from BitBucket repo anymore
Hello, Since 4 days, I can't connect a BitBucket repo from the Amplify Console anymore. ... 2019-09-25T13:54:14.233Z [INFO]: Permission denied (publickey).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My proposal does include the entire unparseable line. While not particularly useful in the particular case Ec Roc found, indicating why the response is unparseable could be useful if for instance a line arrives with two adjacent spaces instead of one. Including the entire response or the response up to and including the problem part would be great, but I don’t immediately see how to do that efficiently. If the error occurs on the 1500th ref the first few hundred characters wouldn’t include it. Having a special error seems like a great idea. How about including the bad line in the message along with the problem, and the entire response in error.data.response? If it’s something like a double space, it’s going to be much easier to see if you know what line it’s in.
@djencks I don’t think we’re disagreeing. If the line is malformed, isomorphic-git should throw an error saying so and preserve the line so that it can be inspected.
While the error Ec got was a permission error, it was not sent by the server in the correct way. A permission error should be a 403 error. Instead, the server returned a 200 status and stuffed the error message into the body. In that case, isomorphic-git should simply say “no way, that’s a bad response” and then pass that response along as the exhibit.