Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Very common RStudio/git problem+solution: "error: unable to read askpass response from 'rpostback-askpass'" #93

Closed
daattali opened this issue Sep 15, 2015 · 11 comments

Comments

@daattali
Copy link
Member

When trying to push from RStudio, many students get the following error

error: unable to read askpass response from 'rpostback-askpass'

While searching this on the web, you'll find that it happens to a lot of people and it's kind become a "known" bug in RStudio, but surprisingly it's very hard to find a simple solution. BUT here is a simple solution! The idea is to push using the command line for the first time, when you push from the command line it'll ask you for your credentials, and after that you should be able to push using the RStudio button and you won't have to use the commandline again.

  • in RStudio, click on the "Tools" menu and select "Shell"
  • Run the following command: git push -u origin master
  • it might ask you for your git username and password. Supply this information, make sure it is correct
  • hopefully the push is successful, then you can close the window
  • Now make some more edits to some file so that you have new content to push
  • click on the "push" button in RStudio and this time the push should work

I don't know why this solution doesn't appear in more places, but at least you guys can benefit from it. It's of course also possible that this won't work for you, but it does work in some cases.

@jennybc
Copy link
Member

jennybc commented Sep 17, 2015

We've had that advice on our materials since last year FWIW. I won't link right now because I'm about the move stuff around. But it's there!

@jennybc jennybc closed this as completed Sep 17, 2015
@daattali
Copy link
Member Author

Yes you're right, though I didn't realize that this specific error was fixed by doing that. I was going to say it'd be useful to have a troubleshooting page with error messages and solutions, but looks like you just beat me to it with your "git hell" page 👍

@jennybc
Copy link
Member

jennybc commented Sep 17, 2015

Other people can join us in our hell now 😬

@isabelmorenom
Copy link

Hello:
I did all the steps and the push command doesn't work.
Could you help me? I use windows 10.
Thank you so much.
Regards.

@jennybc
Copy link
Member

jennybc commented Dec 17, 2015

@isabelmorenom This isn't really a general help forum, it's for students in STAT 545. That said, if you gave me enough specifics to answer your question easily, I would. But that's not the case now -- the range of what might be wrong is just too broad.

@isabelmorenom
Copy link

Sorry for this. I have the same problem described before:

When I try to execute the push command from RStudio, the following error is produced:

error: unable to read askpass response from 'rpostback-askpass'

I executed the following steps:

in RStudio, click on the "Tools" menu and select "Shell"
Run the following command: git push -u origin master
it might ask you for your git username and password. Supply this information, make sure it is correct
hopefully the push is successful, thent you can close the window
Now make some more edits to some file so that you have new content to push
click on the "push" button in RStudio and this time the push should work.

I can push the files to Github with the shell window but not from RStudio.

Thank you.

@jennybc
Copy link
Member

jennybc commented Dec 17, 2015

In the shell, with working directory set to the directory that holds your git repo, which is also an RStudio Project, what do you get for these commands:

git remote -v
git branch -vv

Also, have you simply tried restarting RStudio?

Are you using https or ssh protocol? If https, in the shell, have you had a successful push w/o providing any credentials, i.e. they've been successfully cached?

@isabelmorenom
Copy link

Hello, Jenny:

I am new in this issue and I have a lot of doubts.

The steps I followed:
1.- Create a repository in Github (called repoIsabel) with Readme.md file.
2.- In Rstudio create a project with Control Versions and put the URL of Github.
3.- Modify a file Readme.md
4.- Commit the files added and the file modified (readme.md)
5.- Push the files in Github repository and here the following errors are produced:
error: cannot spawn rpostback-askpass: No such file or directory
fatal: could not read Username for 'https://github.com': Bad file descriptor

With the shell:
Microsoft Windows Versión 10.0.10586 2015 Microsoft Corporation. Todos los derechos reservados.

C:\Users\Isabel\gitrepos\repoIsabel>git remote -v
origin https://github.com/isabelmorenom/repoIsabel.git (fetch)
origin https://github.com/isabelmorenom/repoIsabel.git (push)

C:\Users\Isabel\gitrepos\repoIsabel>git branch -vv

  • master 70e3858 [origin/master: ahead 1] copia del projecto en Rstudio

C:\Users\Isabel\gitrepos\repoIsabel>git push
Username for 'https://github.com': isabelmorenom
Password for 'https://isabelmorenom@github.com':
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 587 bytes | 0 bytes/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To https://github.com/isabelmorenom/repoIsabel.git
d384d7e..70e3858 master -> master

When I push the files I need to put the username and the password. There aren't any errors. I use https protocol.

Thanks a lot for your time. I wouldn't like to disturb you anymore.
Regards.

@jrgirona
Copy link

Hi All,

I have got the same problem as Isabel, and I guess there should be a fix to perform the push from R-Studio, instead of this workaround (Tools-shell). The aim is to have the whole control from R-Studio and introduce the credentials only once. Please advise.

Thanks very much,

Ramón Girona

@jennybc
Copy link
Member

jennybc commented Dec 28, 2015

Have you both verified that your Git version is recent enough to have a credential helper?

http://stat545-ubc.github.io/git06_credential-caching.html#verify-that-your-git-is-new-enough-to-have-a-credential-helper

If so, have you turned the credential helper on in a way appropriate to your operating system?

http://stat545-ubc.github.io/git06_credential-caching.html#turn-on-the-credential-helper

And then made at least one edit + commit + push from the shell before returning to try again from RStudio?

314a added a commit to 314a/rr-rstudio-git that referenced this issue Nov 12, 2016
added the solution indicated for osx that get the following error message:
`error: unable to read askpass response from 'rpostback-askpass'`
Solution found on:
STAT545-UBC/Discussion#93
http://happygitwithr.com/troubleshooting.html#push-fail-at-the-rstudio-level
manirouhirad pushed a commit to manirouhirad/hello-world that referenced this issue Feb 17, 2017
@ratnanil
Copy link

I know this is not a general help forum, but just to share my piece when dealing with this issue: I had to switch from https to ssh url. This resolved the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants