Intermittent failure using Git: unable to read askpass

已回答

Sometimes when I try to pull or push with a git repository, it fails with an error message. Other times it works fine. The first time I do this after launching IntelliJ, it always asks me for my password, and the pull or push always succeeds at this point. But after that initial success, it succeeds intermittently. Mostly it fails, but I try again and again until it succeeds. Here's the error message: 

Git Pull Failed
unable to read askpass response from 'C:\Users\munoz\.IntelliJIdea2016.3\system\tmp\intellij-git-askpass.bat'
failed to execute prompt script (exit code 1)
could not read Password for 'https://munoz@bitbucket.xx.xx.xxx.com': No error

If it can't find my password, I wish it would just ask me again. That would be more reliable than the current behavior.

Another poster, Tim van der Leeuw, fixed this problem by removing the spaces in the path to the temp directory, but I don't have any such spaces. Does anyone know how to fix an intermittent failure like this?

0

git-askpass is the tool that gets the password and transfers it to command-line git, if prompted. The error is returned by the git itself, becasue the intellij-git-askpass.bat fails to execute.

Please check if this comment helps: https://youtrack.jetbrains.com/issue/IDEA-150555#comment=27-1342542

0
Avatar
Permanently deleted user

git-askpass.bat in my case tried to execute removed java.exe by antivirus (false alarm).

I've copied java.exe by other name (java_old.exe etc) and fix name of java.exe to new name in git-askpass.bat.

0
Avatar
Permanently deleted user

Hey

I have the same issue.
While pushing my repositories to GitHub, below error occurred.

I have tried above solution but with no effect.

Below the event log that appeared.
*guote

Push failed
Failed with error: HttpRequestException encountered.
unable to read askpass response from 'C:\Users\Paweł\.IdeaIC2017.3\system\tmp\intellij-git-askpass.bat'
failed to execute prompt script (exit code 1)
could not read Username for 'https://github.com': No error

*unquote

 

0

@Kaliszewskipawel

Looking a the path to the script, the issue could be https://youtrack.jetbrains.com/issue/IDEA-154206

0
Avatar
Permanently deleted user

@Dmitriy Smirnov

Uunfortunately it didn't worked.

i had to re-install Intellij, git (just in case) and installed new Java SE 9.
Only this solved my problem.

Thanks anyway :)

--Pawel

0

@Pawel

The exception is thrown by git itself. So you don't have to re-install intellij (or whatever IDE you're using). Just re-install git and then "invalidate caches/restart" (File > invalidate caches/restart > invalidate caches/restart). This was how i solved the problem.

It may helps to set the maximum heap size of java to 512 MB.

  • Open the Control Panel
  • Go to System
  • Go to Advanced Systems Properties
  • Then Environment Variables
  • In System Variables, click Add
  • New Variable Name: _JAVA_OPTIONS
  • New Variable Value: -Xmx512M
  • Click OK

by setting -Xmx you're setting the maximum heap size. To set the minimum heap size you have to adjust it to -Xms. But this is just another unnecessary information.
Just reinstall git (simply download and install it again, DO NOT DELETE ANYTHING).

 

--Björn Pfoster

0
Avatar
Permanently deleted user

Try updating git (reinstalling new version on windows).

That worked for me

1
Avatar
Permanently deleted user

I have solved the problem , able to do Git Pull/Push successfully from Intellij:

No need to re-install Git/Intellij. Just go to IntelliJ-> File->Settings->Git-> uncheck "Path to Git Executable" ( This will automatically pop-up with C:/Users/<UserName>\AppData\....\Git.exe

Restart Intellij and try to do Git-> pull .

Note: Keeping credential-manager will help to avoid entering password again. 

 Let me know if you still face any issue

5

Apologies, would you help me navigate to:  "Just go to IntelliJ-> File->Settings->Git->"

I have: DataGrip 2021.2.4
Build #DB-212.5457.41, built on October 8, 2021


When I do a pull inside DataGrip i get "unable to read askpass response from .... etc" 

git pull works okay from Powershell.
thanks

Alex

0

Alex, it's worth checking how git is working in cmd.exe
You may have completely different configuration in cmd.exe for git, and IDE relies on a git that is running in cmd.exe
For DataGrip settings should be no different from IntelliJ, so press File -> Settings -> Git

1

Hi Ruslan, thanks for your response.

I did resolve this re-reading Manish Dubey, and as you suggested above:

 File -> Settings -> Version Control -> Git / Check "User credential Helper"

Worked a treat.

thanks Alex

7

i have solved the problem disabling and enabling the git plugin, and restarting intellj with an invalidate cache.

1

Did fix the issue to be able to provide passphrase to git

0

Thanks Taylorpah, your suggestion has helped to solved the issue!

0

I've created a user just to thank Taylorpah , this has helped to solve the issue

0

Having the same issue, none of the proposed solutions I've encountered have worked so far.

PhpStorm 2023.3.4 via remote ssh on linux

0

请先登录再写评论。