curl hangs while uploading on Windows - bash

I am using curl on mac and other windows machines to upload my artifacts to HockeyApp service. On one of my machines that runs windows , "curl" constantly "hangs/freezes" during upload.
Here is the command :
curl -F notify=0 -F status=2 -F ipa=#app/build/outputs/apk/app-production-release-2.4.2-SNAPSHOTv42.apk -F dsym=#app/build/outputs/mapping/production/release/mapping.txt -H X-HockeyAppToken:[MY_TOKEN_HERE]https://rink.hockeyapp.net/api/2/apps/[MY_APP_REFERENCE]/app_versions/upload
On windows there is no curl by default , so I use the one installed with this git distribution. I just add the path to curl to path environmental variable. This approach works well on 2 other windows machines. In fact when I open git-bash , the curl command also executes fine. But any attempt to run it from cmd.exe leads to "hanging/freezing".
Any idea on how can I troubleshoot/debug it ?
EDIT :
I have already tried other curl distributions for windows , same result...

I've been struggling with the same issue of curl as well when trying to deploy my app from VSTS to Hockeyapp. in the end I've chosen for not using curl but just using plain powershell on Windows. it's a bit more complicated but it works the same way.
I've uploaded this script to GitHub and can be found there:
https://github.com/Geertvdc/UWPHockeyAppDeployScripts/blob/master/UploadUWPToHockeyApp.ps1
so instead of curl I use Invoke-RestMethod from powershell to do the same call to Hockeyapp.

Try to upgrade your curl to the latest version
where curl
find out where current path of curl, using cywin cli
https://curl.haxx.se/windows/
Come here to find version you want update, download and give it a try.
Reason for this freezing is base on Windows config. I have laptop that need to ghost new installation of Windows 10. Before ghost, curl run well. After ghost, sometime it freezing.
I updated and it runs well now.
Also notice that when run
curl -s
curl will run in silent mode, that never hang out

Related

Downloading a file using a windows CMD line using wget/curl

I have a client [Windows 10 VM] and a server [say a linux based VM].
I have Apache running on the Linux Server.
I have a file on the linux server that I want to download on my windows client.
I want to do it in 2 ways from the windows CMD:
-Using curl
-using wget
I tried the foll commands on my windows CMD. But doesnt work. Is something wrong with my CLI?
curl http://x.x.x.x/home/abc/ -O test.zip
wget http://x.x.x.x/home/abc/ -O test.zip
From curl side, most probably curl.exe is missed on Windows Client machine or could not find it. One of the options is to download curl:
Download curl zip for Windows from this page: https://curl.se/download.html
Unzip and you will find the ..\bin\curl.exe
Also add ...\bin\ to your Path variable in System Settings.
To use wget in Windows, you can follow this link and it worked for me: https://medium.com/nerd-for-tech/using-wget-command-in-windows-10-environment-d766b8f526e9
Short tutorial:
Download the GnuWin setup
Install it
Open the wget directory
Add to Environmet Variables as well.

Laravel installation sail problem ((23) Failed writing body)

I try to install laravel with the original laravel document but nothing happened, I got many errors, for example I tried this command on CMD;
curl -s https://laravel.build/example-app | bash
but I got this error
(23) Failed writing body
When I tried with PowerShell I got this error;
cmdlet Invoke-WebRequest at command pipeline position 1
Supply values for the following parameters:
Uri:
curl : Cannot find drive. A drive with the name 'https' does not exist.
At line:1 char:1
curl -s https://laravel.build/example-app | bash
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : ObjectNotFound: (https:String) [Invoke-WebRequest], DriveNotFoundException
FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Specs;
Docker Engine v20.10.0
Edition Windows 10 Home Version 20H2 Installed on ‎14/‎08/‎2020 OS
build 19042.685 Experience Windows Feature Experience Pack
120.2212.551.0
I ran into this issue as well and found the (usually excellent) Laravel documentation to be a little vague.
First of all, I have some knowledge of Docker but wanted to get much better acquainted so the recent release of Laravel Sail seemed like an excellent starting point.
Install Docker Desktop https://docs.docker.com/docker-for-windows/install/
Install and enable WSL2 https://learn.microsoft.com/en-us/windows/wsl/install-win10#simplified-installation-for-windows-insiders
The Laravel docs mention this in above step but the part I missed was installing a Linux distribution at the same time (via the Microsoft Store). I assumed Sail took care of this part.
Goto the windows store a get your distro e.g. Ubuntu 20.04 (https://www.microsoft.com/en-gb/p/ubuntu-2004-lts/9n6svws3rx71?rtc=1)
Install Windows Terminal - https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab. Up until now, I was using Cmder or ConEmu rather than the Command Prompt. The important difference is you can start a new shell for windows or any of the Linux distributions you have installed. Again, I assumed you could use the curl -s https://laravel.build/example-app | bash command in my windows Cmder - not the case.
Start up a new Linux shell and if you ls you'll see your Windows filesystem. From there I cd'd to my projects directory, ran curl -s https://laravel.build/example-app | bash and that took care of the rest.
One caveat is that you may have to enable any downloaded Linux distributions in Docker:
Of course, the process makes sense when you solve it and Sail does offer some useful shortcuts in getting a Laravel project up and running quickly with Docker but complete newcomers could be forgiven for thinking it takes care of absolutely everything - which it doesn't.
Side note
The reason you were getting the error in PowerShell is because PS has an alias for curl but not the curl you expect. (cURL in power shell windows 8.1: "A drive with the name 'localhost' does not exist")
You can permanently remove this (https://github.com/lukesampson/scoop/issues/56#issuecomment-609098474) but you may not need to now you know how to use the command in your Linux shell.
The solution above provided by #chris-j works like a charm, but if you still get the error "Docker in not running" even if the it's green consider doing the following
Do sudo su and then curl -s https://laravel.build/example-app | bash

Parse.com cloud code downloading binary

I'm using Parse.com and cloud code for some server side javascript functions on my website. I usually deploy updates to cloud code through parse deploy in the mac terminal.
Today when I have tried to do this it has come up with:
Downloading binary from https://parse.com/downloads/cloud_code/cli/parse-osx/latest.
I initially left this for about an hour and then cancelled it as it didn't seem to be going anywhere. I've then tried running parse deploy twice more but it is again just sitting there and seemingly not doing anything.
This has been working fine for the past 3 months.
Any suggestions?
EDIT:
Navigating to the posted link has let me download the file (it's 6.8MB), so I possibly just need to know how to install that?
Older command line tools may not be able to update themselves to v2. You will need to reinstall them (on OS X or Linux):
curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash
You can download the latest version for your platform from https://parse.com/docs/downloads
We posted about this a couple of weeks ago in the Parse Developer forums:
https://groups.google.com/forum/#!topic/parse-developers/WoRnDft4qmE
Reinstalling the command line tool seems to have fixed this issue.
curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash

Why is 'curl' not recognized when running in Windows?

I am trying to run a Curl command wrapped inside Ruby code as below:
f=IO.popen("C:\Windows\System32\curl.exe -H 'Authorization: Bearer #{token}' -s -v -D - http://api.pageuppeople.com/v1/NAS/Config/LanguageDictionary/Overrides --debug 2>NUL").readlines
However, the output I get is:
'curl' is not recognized as an internal or external command, operable program or batch file
I am running on Windows 7.
I also have "C:\Windows\System32" set in the environment path.
Please help.
curl is not a component of Windows. Unless you have specifically installed it, it won't exist on the system.
I am not a Ruby expert, but I suspect that you should really be using the Net::HTTP Ruby library here, or something similar to it. Even on a system where curl is installed, launching it is not a sensible way of running an HTTP request.
Curl does not come with Windows, but it has been ported to Windows.
You can download it here:
http://sourceforge.net/projects/gnuwin32/file
I know nothing about Ruby, but I do know you shuld be using a native libary for your HTTP needs.
CURL is not a Windows component. Download curl.exe and keep it in your path.
Alternatively download curl.exe and invoke the command from the same folder.
Windows 10 now provides C:\Windows\System32\curl.exe but I still see that error message when I try to call it from a service (Jenkins user in my case).
I'll post an update when I find out something more (e.g. which user rights are necessary).
I've installed curl now with chocolatey. See https://chocolatey.org/packages/curl.

Curl command not loading contents in windows 7

I have installed Cygwin & curl(through cygwin installer) on my Windows7 32bit. Then opened cygwin terminal and typed curl --help. Everything works fine with curl showing its command arguments list.
But curl http://www.google.com or any other url takes more time and results
"curl: (52) Empty reply from server
". What is the problem?
Update:Iam behind a proxy server. Any pblm with that?
If your proxy server is the only way to get out at the web, then yes, that's the problem. Curl couldn't care less about what OS you're running under, so won't get for OS-specific proxy settings (ie: Internet Explorer options), so it'll try to do a direct connection. Try adding the --proxy option (curl --help will give the format).

Resources