fork-dev / TrackerWin

Bug and issue tracker for Fork for Windows
461 stars 10 forks source link

[BUG] Git 2.42: Fork asks repository credentials on every operation #1998

Closed andToxa closed 8 months ago

andToxa commented 1 year ago

Using last version of git for windows 2.42.0 and on every try to fetch, pull or push operation Fork asks credentials. When you click cancel, an error message occurs: image

git: 'credential-manager-core' is not a git command. See 'git --help'.
error: unable to read askpass response from 'C:\Users\Toxa\AppData\Local\Fork\app-1.88.2\Fork.AskPass.exe'
bash: line 1: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://server.address': No such file or directory

fork.log:

◽️ 2023-09-01 11:23:16.533 Fork_Pipe21920_AskPass: received event '741'
⚠️ 2023-09-01 11:23:16.533 Unknown credentials description parameter: 'wwwauth[]=Bearer'
⚠️ 2023-09-01 11:23:16.533 Unknown credentials description parameter: 'wwwauth[]=Basic realm="https://server.address"'
⚠️ 2023-09-01 11:23:16.533 Unknown credentials description parameter: 'wwwauth[]=Negotiate'
⚠️ 2023-09-01 11:23:16.533 Unknown credentials description parameter: 'wwwauth[]=NTLM'
◽️ 2023-09-01 11:23:16.533 Fork_Pipe21920_AskPass: waiting for next event '749'
◽️ 2023-09-01 11:23:16.729 Fork_Pipe21920_AskPass: received event '749'
⚠️ 2023-09-01 11:23:16.729 Cannot parse askpass request 'Username for 'https://server.address': '
⚠️ 2023-09-01 11:23:16.734 Cannot parse askpass request 'Username for 'https://server.address': '
🔷 2023-09-01 11:24:21.980 WindowActivated
🔷 2023-09-01 11:24:21.980 Application Window Activated: skip (AskPassWindow)
◽️ 2023-09-01 11:24:21.994 Fork_Pipe21920_AskPass: waiting for next event '53'
⚠️ 2023-09-01 11:24:22.110 Git request failed '-c credential.helper="" -c credential.helper="C:/Users/Toxa/AppData/Local/Fork/app-1.88.2/Fork.AskPass.exe" -c credential.helper="manager-core" fetch --prune --all --tags --verbose --progress':
git: 'credential-manager-core' is not a git command. See 'git --help'.
error: unable to read askpass response from 'C:\Users\Toxa\AppData\Local\Fork\app-1.88.2\Fork.AskPass.exe'
bash: line 1: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://server.address': No such file or directory
andToxa commented 1 year ago

~seems to be fixed by deleting credentials in windows control panel and entering credentials again~

DanPristupov commented 1 year ago

git: 'credential-manager-core' is not a git command. See 'git --help'.

Check your global git config. It's configured to use manager-core which has been renamed to manager in the latest git.

andToxa commented 1 year ago

image my git config contains credential.helper=manager, not manager-core

DanPristupov commented 1 year ago

OK... That's good to know.

Then try to log out from accounts in the File -> Accounts dialog.

andToxa commented 1 year ago

I am not logged in in File -> Accounts dialog because using repository on Azure DevOps server.

DanPristupov commented 1 year ago

Yes, but do you have any other accounts? That is important because Fork will override credential.helper value if any account item exists.

andToxa commented 1 year ago

After logging out other account error is gone. But what if I want to have accounts in File -> Accounts dialog?

DanPristupov commented 1 year ago

But what if I want to have accounts in File -> Accounts dialog?

Then you can't use them together.

This is a breaking change in Git for Windows v2.42.0.

andToxa commented 1 year ago

need to wait fixed Fork version with embedded git v2.42.0?

DanPristupov commented 1 year ago

There are many options:

andToxa commented 1 year ago

thank you! will use git credential manager until Fork update

innuendonh commented 1 year ago

Hello, I had the same issue and I just solved by installing an alias:

git config --global alias.credential-manager-core 'credential-manager'
DanPristupov commented 1 year ago

@innuendonh that's smart :).

FYI, we will release the 1.89 update tomorrow.

innuendonh commented 1 year ago

@innuendonh that's smart :).

FYI, we will release the 1.89 update tomorrow.

Good to know, thank you!

DanPristupov commented 1 year ago

We just released Fork 1.89

pomarc commented 1 year ago

I had the same error, with 1.89.1.0 and had to switch from Fork Git Instance (2.42.0) to the global windows instance (2.41.0) to make it disappear

image
DanPristupov commented 1 year ago

@pomarc git credential manager core is deprecated in git 2.42. You must update your global git config.

Open terminal in Fork and run:

to check the existing value:

git config --show-origin credential.helper. It must be manager, not manager-core

to change the global value to manager:

git config --global credential.helper manager

jamesholwell commented 1 year ago

If other Azure DevOps users find this thread and for whatever reason the above doesn't help, I found that following all the advice, then restarting my machine, changing fork to use windows git (2.42.0.windows.2) and then restarting fork was sufficient to fix the issue for me.

DanPristupov commented 1 year ago

@jamesholwell if you have the following error:

fatal: Cannot determine the organization name for this 'dev.azure.com' remote URL. Ensure the credential.useHttpPath configuration value is set, or set the organization name as the user in the remote URL 'dev.azure.com'.

Then you should run in terminal: git config --global credential.useHttpPath true

jamesholwell commented 1 year ago

@DanPristupov yes, I did have that error (I thought it was not accepting/storing the credential, but clearly I wasn't actually reading the log). I ran that in terminal and now the Fork git instance works nicely. Thanks !

ced64k commented 1 year ago

I had the same error and I confirm that it works with Azure DevOps over HTTPS with credential.useHttpPath true