Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git update-git-for-windows fails with curl error #5083

Open
1 task done
anthonyvdotbe opened this issue Jul 30, 2024 · 17 comments
Open
1 task done

git update-git-for-windows fails with curl error #5083

anthonyvdotbe opened this issue Jul 30, 2024 · 17 comments

Comments

@anthonyvdotbe
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.45.2.windows.1
cpu: x86_64
built from commit: 91d03cb2e4fbf6ad961ace739b8a646868cb154d
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.22631.3958]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: Notepad
Custom Editor Path:
Default Branch Option: main
Path Option: Cmd
SSH Option: ExternalOpenSSH
Tortoise Option: false
CURL Option: WinSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Git Pull Behavior Option: FFOnly
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Enabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

n/a

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

PowerShell 7.4.4

git update-git-for-windows
  • What did you expect to occur after running these commands?

Git for Windows starts the update process

  • What actually happened instead?

Only the following output is printed:

Git for Windows 2.45.2.windows.1 (64-bit)
Update 2.46.0.windows.1 is available
curl: (43) A libcurl function was given a bad argument
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

n/a

@dscho
Copy link
Member

dscho commented Jul 30, 2024

This looks like the same bug as was reported in microsoft#655.

Unfortunately, I know of no work-around other than:

  • updating manually
  • or copy/editing C:\Program Files\Git\mingw64\bin\git-update-git-for-windows, deleting that --write-out '%{http_code}' argument and modifying if test "$code" -ge 400 to read if test "${code-0}" -ge 400 instead, and then running the modified script.

Seeing as this bug has slipped into an official Git for Windows release, it would probably be a good idea to validate this curl ... --write-out call specifically in the integration test in build-extra.

@anthonyvdotbe
Copy link
Author

Thanks for your swift response and work-arounds. For the record, you probably meant to write ${code:-0} instead of ${code-0}, as the latter results in:

C:\Program Files\Git\mingw64\bin\git-update-git-for-windows: line 127: test: : integer expression expected

@dscho
Copy link
Member

dscho commented Jul 30, 2024

you probably meant to write ${code:-0} instead of ${code-0}

Oh, sorry, yes, you are correct!

@AScott-WWF
Copy link

I had the same issue as @anthonyvdotbe, and @dscho's fix worked for me too

@xSkeletor
Copy link

Is there going to be a permanent fix for this issue on Windows released with a later version of Git?

@anthonyvdotbe
Copy link
Author

As I understand, Git 2.46.0 already contains a permanent fix.

@claell
Copy link

claell commented Aug 6, 2024

Just linking the two related issues in CURL for reference:

Interestingly, these issues can be found through Google, while this one is not (using "git update-git-for-windows" "curl: (43) A libcurl function was given a bad argument" as search terms).

I'll also add

  • git update-git-for-windows
  • curl: (43) A libcurl function was given a bad argument

Possibly, this will help finding this issue on Google in the future.

@abhishek26-dev
Copy link

Hi, we had an issue after the git has been upgraded from 2.39.1 to 2.45.2 with curl command.
curl: (58) schannel: Failed to import cert file cert.pem, last error is 0x80092002
we are invoking this curl command via git bash in windows environment (2016)
Is this issue related? Or have anyone experienced it.
We rolled back the version and it worked perfectly fine

@mpawlow
Copy link

mpawlow commented Aug 7, 2024

$ git update-git-for-windows
Git for Windows 2.46.0.windows.1 (64-bit)
Up to date

@dminhhoang26
Copy link

we can also update newer git version via winget winget upgrade Git.Git -s winget

@plppp2001
Copy link

I'm getting this error; after running command; " git update-git-for-windows
"

curl: (43) A libcurl function was given a bad argument

@dminhhoang26
Copy link

@plppp2001 i think it is an issue and we just manual update Git for now and the issue will be gone

@plppp2001
Copy link

@plppp2001 i think it is an issue and we just manual update Git for now and the issue will be gone

Thanks, I did that. Everyone should just download the latest from the website and just install/update like that, if they have this issue. Super.

@abhishek26-dev
Copy link

@mpawlow installing new version didn't worked for me. This is weird as previous version is working fine for curl command otherwise it throws the 58 schannel error.
I am unsure if recreating certificate would fix it but is there any other way to find the actual cause.
Cheers!

@dscho
Copy link
Member

dscho commented Aug 13, 2024

@abhishek26-dev let's unconfuse things a bit by separating out your issue, which is highly unlikely to be caused by the same root cause as the problem that this here ticket is about. By "separating out your issue" I mean: please open a new ticket with all the information you can gather, and let's discuss that issue in that new ticket, not here.

@abhishek26-dev
Copy link

Thanks @dscho
I was able to fix it. both windows curl and mingw(git) didn't worked with version 8.4.0 so I downloaded curl 8.9.0 and included absolute path to run my command. Cheers!

@mustafatoktas
Copy link

@mpawlow thank you. I solved it by installing the new version on top of the existing version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants