We keep getting this error at the end of our chef-client runs. It seems to be random, meaning it does not happen all the time on all the servers, just some of the time on some of the servers.
Error: INFO: Running queued delayed notifications before re-raising exception ERROR: Running exception handlers ERROR: Exception handlers complete FATAL: SystemCallError: The parameter is incorrect. - ReportEvent
We are running Chef on Server 2008 and 2012 client machines, and the recipe we are running is very simple, it just calls a .cmd file on the client, which calls a separate PowerShell script. Once the execution is complete we get this error.
Any ideas as to what is causing this error and how we can remedy it?
The good news is that this error does not seem to block the cookbooks/recipes from running.
We use powershell_script in our recipes and get the same behavior as mentioned above, sometimes get the error and sometimes not. We also do not get errors when powershell scripts are run on the client server independent of Chef.
What execution policy for powershell scripts is on the remote machine? Get-ExecutionPolicy from powershell. For testing I always set this to unrestricted - Which yes, isn’t the best method, but I don’t have the luxury of a public facing CA!
Our servers are usually set to RemoteSigned. I also ran our cookbooks on a server that threw that error today but didn’t get the error this time. Weird.
You could use the Start-Transcript -Path 'c:\logfile.log' -Append (With the append to aggregate multiple run’s logging) to collect what the powershell script is doing? Don’t forget to add a Stop-Transcript in there and remove the $ErrorActionPreference = "Stop" so that the script continues as expected…
This is an on the fly simple way of doing logging.