简体   繁体   中英

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

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?

You can enable "Use credential helper" in Preferences - Version Control - Git

If someone is facing this issue in Android Studio BumbleBee, Do the following thing. Hopefully it will solve your problem

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

On Android Studio "ChipMunk" got this problem

  • File -> Settings -> Version Control -> Git -> Use credential helper (set check) -> push Apply button

Resolved the issue, PS : I use token for access

The error originates from the Android Studio canary. You can either update your Android Studio or you can use the inbuilt terminal below and type:

$ git pull

If anyone has this problem in Android Studio BumbleBee just open the android studio terminal and type

git pull

and enter the git password.

Now, you can push and pull in version control

Finally, 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.

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

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

For anyone using Chipmunk version, here are the steps I used to fix this issue:

  1. Upgrade git to latest version
  2. Check credential helper in setting -> Version control -> Git

Hope it helps.

I tried all the suggestion did not work me.

What worked was Settings -> Version Control -> Github -> Remove your accound and log in again with new token.

I am using chipmunk

For those using chipmunk android studio File -> Settings -> Version Control -> Git -> Use credential helper (set check) and apply

I'm using Android Studio Chipmunk and all I had to do is enabling "Use credential helper" in preference and use terminal to pull

git pull

then enter Github username and access token instead of password

I faced same issue, I tried "Use credential helper" not worked, and deleted.gitconfig file in C://User folder not worked, after so much struggle,

Fianlly Installed Android Studio Dolphin (2021.3.1) Canary 1, from this link Android Studio download archives

After install, when it asked to import prvious version setting. I selected Do not import.

Resolved the issue.

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.

I ran into the same issue today. I was logging in with social login and didn't have a password.

Get an App Password on Bitbucket,

  • Setting -> Personal Settings -> Add Password -> Create App Password
  • Copy Password

Then on Android Studio

  • $git pull on Android Studio's Terminal section (or another terminal like macOS terminal)
  • It will ask you for the password, enter the password you copied before
  • Check Use Credential Helper in Preferences -> Version Control -> Git

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"

use terminal enter

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

then Then you will be prompted Enter account password

Resolved the issue.

For those of you, who are using linux and android studio chipmunk 2021.2.1 Patch 1. I faced this problem and most of the solution is not working.

  1. File -> Settings -> Version Control -> Git -> check Use credential helper then push, not working.

  2. git pull add username and password then push, not working. add username and token then push, not working.

  3. git config credential.helper store then push, not working.

  4. remove account, sign in again then push not working.

  5. update the git the latest version. repeat the first step. It's work.

I tried File -> Settings ->Version Control -> Git -> Check Use credential helper , but it didn't helped for Android Studio Chipmunk - 2021.2.1 Patch 1.

But this answer helped - refer answer

if Using credential helper settings will not work for you then please try to update your android studio version. it will definitely work for you.

If you are experiencing this issue when trying to push, use this command terminal, the easiest is the terminal right in the android studio.

git push

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

File -> Invalidate Caches...

Check "Clear VCS Log caches and indexes" box

Click "Invalidate and Restart"

In case 'Credential Helper' failed, Try: File -> Invalidate Caches

File -> Invalidate caches -> Invalidate and restart

And restart your machine

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM