Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error pushing to git remote with http #1138

Closed
jasabalete opened this issue Dec 9, 2015 · 41 comments
Closed

Error pushing to git remote with http #1138

jasabalete opened this issue Dec 9, 2015 · 41 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@jasabalete
Copy link

I have configured my git remote like this:

[remote "origin"]
    url = http://MY-HOST.../branch-locatlocator-select-ui.git

And when i do a push show me an error:

fatal: Authentication failed for 'http://MY-HOST.../branch-locatlocator-select-ui.git/'

Why Visual Studio Code add the final slash? :(

@joaomoreno joaomoreno added the bug Issue identified by VS Code Team member as probable bug label Dec 9, 2015
@joaomoreno
Copy link
Member

Oh that's terrible, sorry for that!

@joaomoreno
Copy link
Member

I assume a simple git push from the command line works, right?

@jasabalete
Copy link
Author

Yes, "git push" from the command line works

@joaomoreno
Copy link
Member

Git seems to do this, not VS Code. Here's a snippet from the command line:

$ git config remote.origin.url
https://github.com/joaomoreno/node-libarchive.git
$ git push
Username for 'https://github.com': joaomoreno
Password for 'https://joaomoreno@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/joaomoreno/node-libarchive.git/'

Is your host by any chance GitHub or BitBucket? Which command line exactly are you using?

Closing as dupe of #490. Will reopen if further information reveals this to be an independent issue.

@jasabalete
Copy link
Author

My repo is GitLab CE

$ git config remote.origin.url
http://ISLINGIP01.scisb.isban.corp/portales-branch-locator/branch-locator-select-ui.git

The URL with the final slash only apears in VSCode and if i put this URL in Chrome for example return ERR_TOO_MANY_REDIRECTS

Why VSCode connect with the remote and add a final slash?

@jasabalete
Copy link
Author

Note: the error is in VSCode when I do a push or a pull in the Git feature

@joaomoreno
Copy link
Member

Is there any way you can set up a repository in that same server and give me credentials to access it so I can try to repro?

@joaomoreno joaomoreno reopened this Dec 10, 2015
@egamma egamma modified the milestone: Backlog Dec 10, 2015
@jasabalete
Copy link
Author

the same error in gitlab.com repository.

 fatal: Authentication failed for 'https://gitlab.com/jasabalete/test-project.git/'

I invite you in a public repository for testing and "master" role :)

@jasabalete
Copy link
Author

I do this:
1 - Create a public repository
2 - git clone https://blah/blah.git
3 - Open the folder with VSCode
4 - Commit and push a file
5 - VSCode add final slash "/" and error
fatal: Authentication failed for 'https://blah/blah.git/'

git push origin master from command line works!

@joaomoreno joaomoreno modified the milestones: Dec 2015, Backlog Dec 11, 2015
@joaomoreno
Copy link
Member

Thanks for the repo access. There was definitely a problem with VS Code's credential helper. When running the push action, you should have seen this dialog:

image

The dialog is not showing up in 0.10.3 unfortunately. Fixed it and will be in for the December milestone.

With the fix, I was able to successfully push to the GitLab repo using the credentials I configured in the GitLab website.

@jasabalete
Copy link
Author

This dialog is showing to me. I put the credentials and show the error

@egamma egamma reopened this Dec 11, 2015
@joaomoreno
Copy link
Member

I am using the username that I found in the bottom left corner of the GitLab UI. You can't use your e-mail address.

image

And the password set in the following dialog:

image

Please make sure you are using the right credentials, reset your password, try again, etc.

@jasabalete
Copy link
Author

I know my credentials. I use this repository from several project with eclipse and command line too and works with ssh and https connections.

Thank for all :)

@joaomoreno
Copy link
Member

If you use the SSH remote url, it should all work, since no password prompt will occur.

If you use HTTPS, you should get the prompt. I do, I input the credentials I configured in GitLab and it works for me.

Maybe it's platform specific? Which platform are you on?

@joaomoreno joaomoreno removed this from the Dec 2015 milestone Dec 14, 2015
@egamma egamma added this to the Backlog milestone Dec 14, 2015
@spongessuck
Copy link

I have a development server on my domain that's running Bonobo Git Server set up to use Windows authentication. My credentials work everywhere except in VS Code. I get a similar authentication error with the trailing slash.

@jasabalete
Copy link
Author

The new versión of VSCode WORKS :)

Thanks and go on!

@spongessuck
Copy link

I'm using VSCode 0.10.6 (newest version) and I still have this problem.

@stefanvangastel
Copy link

@TejasCMehta; Fixed the problem for me!

@spongessuck
Copy link

@TejasCMehta
Also worked for me.

@joaomoreno joaomoreno modified the milestones: Feb 2016, Backlog Jan 29, 2016
@lv7777
Copy link

lv7777 commented Feb 5, 2016

I also arise same bug on windows8.

@user414
Copy link

user414 commented Feb 21, 2016

I wouldn't use store for this since as per git specs it store the password unencrypted on disk

https://git-scm.com/docs/git-credential-store

I would use

git config credential.helper cache

instead with optional timeout

https://git-scm.com/docs/git-credential-cache

This is still just a workaround until a proper fix but it works.

@joaomoreno joaomoreno modified the milestones: March 2016, Feb 2016 Feb 25, 2016
@joaomoreno
Copy link
Member

I support the cache credential helper as a workaround until we tackle this issue head on.

@BryanConradHart
Copy link

I'm running into this problem too.
Ubuntu 15.10 (inside virtualbox on win10 pro)
VS Code -v 0.10.10

I do not get presented with a credential dialog.
I am able to successfully push from command line.
doing git config push.default matching, pushing from commandline and then trying again from vsCode made no difference.

@joaomoreno joaomoreno modified the milestones: April 2016, March 2016 Mar 17, 2016
@jonathanfishbein1
Copy link

Similar set up to BryanConradHart getting the error

@joaomoreno joaomoreno modified the milestones: April 2016, Backlog Apr 5, 2016
@jfaquinojr
Copy link

same as @jonathanfishbein1. Linux Mint 17.3

@ansarizafar
Copy link

I am also facing the same problem

@joaomoreno
Copy link
Member

The authentication dialog was fixed by #1796, it should start coming up on the next release.

Meanwhile, I do suggest using a credential helper.

@joaomoreno joaomoreno assigned isidorn and unassigned joaomoreno Apr 29, 2016
@isidorn isidorn added the verified Verification succeeded label Apr 29, 2016
@michaelazer
Copy link

I'm running into the same error.
I can git push from the command line, but can't through VS Code.
I get the following error:

Please make sure you have the correct access rights
and the repository exists.

I downloaded and installed the credential helper then tried both:
git config credential.helper cache
as well as
git config credential.helper store
but still doesn't work.

ps. I'm using version 1.2.1

Thanks a lot for your support.

@jm-rives
Copy link

jm-rives commented Jun 1, 2017

I was having a similar problem with OSX. I turned OFF 2 - factor authentication and the problem resolved itself.

@Ron1137
Copy link

Ron1137 commented Aug 2, 2017

I tried pushing to git hub but I got an error message saying couldn't connect to server . What can I do?
I followed all the push instruction , disabled the wifi proxy settings and used LAN cable but still nothing

@larssb
Copy link

larssb commented Oct 26, 2017

To @jm-rives and others make sure to follow > Authorizing when using two-factor auth

I hope it helps.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests