Git Pull Failed: Invocation failed Unexpected end of file from server
Asked Answered
D

15

89

I'm trying to execute a git pull using Android Studio's built-in button, but it fails with this message:

Git Pull Failed
                Invocation failed Unexpected end of file from server
                java.lang.RuntimeException: Invocation failed Unexpected end of file from server
                at org.jetbrains.git4idea.http.GitAskPassXmlRpcClient.askUsername(GitAskPassXmlRpcClient.java:55)
                at org.jetbrains.git4idea.http.GitAskPassApp.main(GitAskPassApp.java:66)
                Caused by: java.net.SocketException: Unexpected end of file from server
                at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:851)
                at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
                at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:848)
                at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
                at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1593)
                at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
                at org.apache.xmlrpc.DefaultXmlRpcTransport.sendXmlRpc(DefaultXmlRpcTransport.java:87)
                at org.apache.xmlrpc.XmlRpcClientWorker.execu... (show balloon)

What are the reasons this could be failing?

Darendaresay answered 6/3, 2021 at 16:47 Comment(0)
C
19

The error originates from the Android Studio Preview version (Bumblebee, Chipmunk, etc.). You can either update your Android Studio to a newer version, or you can use the inbuilt terminal and type the command below:

$ git pull

You may be prompted to re-enter a password or token.

Classicize answered 24/5, 2021 at 14:30 Comment(1)
Update Android Studio does not help since this occurred for me on latest stable Android Studio Bumblebee. The correct answer is to enable credential helper setting.Spiritless
L
192

You can enable the option "Use credential helper" in Android Studio's Preferences menu.

The option is located at Preferences -> Version Control -> Git

Ludovika answered 16/12, 2021 at 8:23 Comment(2)
This Issue can be caused by various other problems, notably: Outdated/Corrupted /AppData/Local/Google/AndroidStudio2021.2/tmp/intellij-git-askpass-local.sh or by extension an outdate git-windows or Linux equivalent and relative new android studio bug relating to GitHub starting to enforece it's no password policy. Invalidating caches and removing the sh-file might help you to determine your exact problem as the error message may change to something more usefull. Also see here: #68782428Sandoval
Inconceivable that the companies have one trillion dollars and cannot make git clone work for paying customers. They must have corrupted their software on purpose, to sell more support....Proliferous
L
59

If someone is facing this issue in Android Studio Preview, do the following:

Preference -> Git -> Check Use credential helper (if not checked)

Luxe answered 19/2, 2022 at 6:53 Comment(6)
May be you are using Mac, for windows where is the credential helper?Fahlband
This is not workingFleece
When I do this I then get presented with a Github login dialog. But I have already installed a token and Github no longer supports username/password auth.Strontia
This is, in essence, the same answer as the one from Aengus from Dec 2021 ("enable use credential helper")Agitprop
This does not work.Pillion
You need to restart Android Studio to git clone again.Psalter
N
47

This resolved the problem for me:

File -> Settings -> Version Control -> Git -> Use credential helper (set it to checked) -> push the Apply button.

P.S. I use a token for access.

Necktie answered 11/5, 2022 at 8:29 Comment(1)
This worked for me after restarting Android StudioMaster
C
19

The error originates from the Android Studio Preview version (Bumblebee, Chipmunk, etc.). You can either update your Android Studio to a newer version, or you can use the inbuilt terminal and type the command below:

$ git pull

You may be prompted to re-enter a password or token.

Classicize answered 24/5, 2021 at 14:30 Comment(1)
Update Android Studio does not help since this occurred for me on latest stable Android Studio Bumblebee. The correct answer is to enable credential helper setting.Spiritless
F
10

This worked for me:

  1. Open Terminal in Android Studio. Hit this command:

    git config credential.helper store
    

    It will ask for a password, enter your password. This could also be an access token.

  2. Enable "Use Credential Helper" in Settings -> Version Control -> Git.

After these 2 steps, you will be able to Pull, Push, and Commit.

Fleece answered 23/2, 2022 at 5:40 Comment(2)
for me 2nd option was enough. Only then after Manage Remotes had succeed with pushLongford
This is the only one solution for me. Each time I have the issue (I can't understand but without notice I have this issue) perform this solution: git config credential.helper store and all returns working perfect. Thanks so very much for this.Hobard
E
7

What worked for me was going to Settings -> Version Control -> GitHub -> Remove your account

Then I logged in again with a new token.

Electronics answered 25/5, 2022 at 5:37 Comment(0)
C
7

File -> Settings -> Version Control -> Git -> Use credential helper (set it to checked). Then git pull after then git push

Consciencestricken answered 8/8, 2022 at 8:18 Comment(0)
M
2

File -> Invalidate Caches...

Check "Clear VCS Log caches and indexes" box

Click "Invalidate and Restart"

Monda answered 22/8, 2022 at 17:0 Comment(1)
I first ticked the "Use credential helper" checkbox under Settings. This helped to push once or twice. But the error came back. Your suggestion seems to have solved the issue. Thanks.Helmer
A
1

Using the credential helper did not work for me, and neither did deleting the .gitconfig file in my C:\User folder.

What worked for me was installing a new version of Android Studio, and opted out of importing previous version settings.

Arce answered 1/2, 2022 at 8:27 Comment(0)
U
1

Use these steps to git over HTTPS not SSH:

git config credential.helper store

You'll be requested the credentials username/token or pass. Check this in Preferences > GIT > Use Credential Helper

Just restart Android Studio.

Unconventionality answered 17/5, 2022 at 7:9 Comment(0)
C
0

Following steps:

Delete .gradle and .idea

Delete remote URL from git tab

go to git in android studio prefs and select use credential manager

Now add your remote URL in the git tab again and "FETCH"

Citronellal answered 17/3, 2022 at 12:2 Comment(1)
How does this differ from the existing answers that say to use the credential manager?Agitprop
M
0

Using the terminal, type this

git clone https://git-example-service/project-url.git

Then you will be prompted to enter your account password. Once you enter your password, the issue should be resolved.

Microvolt answered 30/3, 2022 at 13:12 Comment(0)
P
0

In Ubuntu, 'Credential Helper' AND 'File -> Invalidate Caches' not helped me, I just DELETED the FILE '/home/YOUR USERNAME/.cache/Google/AndroidStudio2021.2/tmp/intellij-git-askpass-local.sh'. now its working

Pasticcio answered 25/8, 2022 at 13:47 Comment(0)
S
0
git init
git remote add origin LINK_HTTPS_ON_GIT
git add .
git commit -m "NhoPV BackUp"
git fetch

Login

git push origin YOUR_BRANCH
Surmount answered 7/12, 2022 at 10:10 Comment(0)
D
0

I also had this problem with Bitbucket repository.

My solution is:

  1. "Use credential helper" in Preferences -> Version Control -> Git
  2. Go to Bitbucket: Account -> Personal Settings -> App passwords. Create app password.

Then use your generated app password instead of account password. Now plugin works well.

Demean answered 2/1, 2023 at 18:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.