Calling CURL on Windows Server

asked 2015-02-11 07:32:42 -0500

Dramz0r gravatar image

Hi all,

I am having issues with CURL and other .cmd/.exe programs on the windows platform. It seems that Puppet is interpreting Information messages generated by CURL or any other .cmd/.exe as Terminating errors and generates this error code: 3221225781

Puppet code:

exec {'call curl':
command => "curl.exe -k --user username:password -H Accept:application/json \'{\"accepted\":true}\' -i -X PUT -S https://192.168.80.191/resourceURL
path => "C:/"
logoutput => true,
}

Error Message:

Error: curl.exe -k --user username:password -H Accept:application/json '{"accepted":true}' -i -X PUT -S https://192.168.80.191/resourceURL returned 3221225781 instead of [0]

of course i have tried to wrap these commands in Batch files, PowerShell to suppress the errors being reported to Puppet. But it seems more of a fundamental issue with puppet to me, as i seem to get the same error code for any kind of application that prints out information messages.

//Dave

edit retag flag offensive close merge delete

Comments

I hate to ask a dumb question, but have you verified that the command works properly in a terminal window? It would be especially useful to try it after setting the PATH to simply "C:/", as is shown in your Puppet code above. That may shed some light on the problem.

GregLarkin gravatar imageGregLarkin ( 2015-02-11 10:47:41 -0500 )edit

Hi Greg, Yeah i have made sure it works, having a look more into it, it seems that anything that is printed out within that application is printed to strerr pipe... And looks like puppet picks that up and throws it out. I cannot find a way to get puppet to ignore these. Have tried wrapping it :(

Dramz0r gravatar imageDramz0r ( 2015-02-12 01:19:04 -0500 )edit

Do you see anything in the Windows Event Viewer, or are the messages thrown away even before they get there?

GregLarkin gravatar imageGregLarkin ( 2015-02-12 11:22:56 -0500 )edit