Issue
I have public/private key login to GitHub configured in Android Studio. After changing my internet provider this stopped working correctly. Meaning that my SSH login gets rejected after every time I use Android Studio. When trying to push changes to my repository the next day it says the following:
git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/main:main
Invocation failed Unexpected end of file from server
java.lang.RuntimeException: Invocation failed Unexpected end of file from server
at git4idea.GitAppUtil.sendXmlRequest(GitAppUtil.java:30)
at git4idea.http.GitAskPassApp.main(GitAskPassApp.java:58)
Caused by: java.net.SocketException: Unexpected end of file from server
at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:866)
at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)
at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:863)
at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1615)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
at org.apache.xmlrpc.DefaultXmlRpcTransport.sendXmlRpc(DefaultXmlRpcTransport.java:87)
at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178)
at git4idea.GitAppUtil.sendXmlRequest(GitAppUtil.java:27)
... 1 more
error: unable to read askpass response from '/home/marcell/.cache/Google/AndroidStudio2021.2/tmp/intellij-git-askpass-local.sh'
fatal: could not read Password for 'https://[email protected]': No such device or address
Then I have to generate a new SSH key and add it to GitHub for the authentication to work again. This is getting very annoying and I believe there is something I can do about it. It is just that I have no idea what could be causing this. I hope somebody can point me into the right direction.
EDIT: It seems that Android Studio is using a wrong URL to authenticate. It should use the personal access token from GitHub and the repository name should be at the end of the URL like this:
https://[email protected]/username/reponame
Solution
The solution was to enter the personal access token when I tried to push with Android Studio. It displayed a "Log in" windows for GitHub and I could choose the option to enter a Token. After having done this the problem disappeared. Maybe this was fixed with an update, since this dialog didn't show up in the past.
Answered By - Marcell
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.