Chef - ArgumentError: too short control escape - ruby

I will glad to get an any help in the next issue:
when I run a numerous recipes (when I run an each in a separate way it doesn't fails), I sometimes get a next error:
"ArgumentError: too short control escape"
log:
[2016-03-15T15:41:55+01:00] INFO: Running queued delayed notifications before re-raising exception
[2016-03-15T15:41:55+01:00] ERROR: Running exception handlers
[2016-03-15T15:41:55+01:00] ERROR: Exception handlers complete
[2016-03-15T15:41:55+01:00] FATAL: Stacktrace dumped to c:/chef/chef-stacktrace.out
[2016-03-15T15:41:55+01:00] FATAL: ArgumentError: too short control escape
chef-stacktrace.out:
Generated at 2016-03-14 15:56:29 +0100
ArgumentError: too short control escape
C:/opscode/chef/embedded/apps/chef/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:66:in 'recipe_snippet'
C:/opscode/chef/embedded/apps/chef/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:43:in 'add_explanation'
It happens randomly and I can't to find an explanation,
Thanks

I'm guessing something is going wonky with the regexp compile. It supposed to use Regexp.escape(source) but something might be slipping through? Please include the full error output though.

After a deep investigations, we have found the root cause of the issue. The name of the Github repository was interpreted by Chef as an escape character (the name of repository was starting with capital letter "C") which caused the configuration to fail alternately.
It regards to Chef 12.0.3 version (I hope, they fixed it in a newer next version)
We changed the name of repository and it solved the problem.

Related

PACT error while loading pact_helper.rb (Malformed version number string )

When I run the pact test, I get the following error.
An error occurred while loading ./spec/mailers/mailing_spec.rb.
Failure/Error:
mock_service :core_service do
port "3003"
end
ArgumentError:
Malformed version number string
Any ideas around this issue?
Thanks in advance.
Can you please raise an issue in the pact-ruby and include all the relevant versions, and the steps to recreate the issue, preferably with an executable code example.

How to debug Errno::EIO error in Chef recipe using Chef::Provider::Git

I'm trying to use chef to check out a git repo to a windows client node.
This seems simple enough and I've got the following resource definition:
git "C:\\pathtocheckout" do
repo "https://gitserver/repo.git"
action [ :checkout, :sync]
end
But when this is reached by chef-client I get:
Errno::EIO: git[C:\pathtocheckout] (cookbook_name::test line 21) had an error: Errno::EIO: Input/output error - CreateProcessW
I've had a look at the stacktrace produced and it appears to be something to do with creating a process to run the git command - but this is the limit of my knowledge.
I've made sure git is installed on on Path, removed all other recipes from the run list, running as a different admin user and I've tried different repositories but all with the same error.
So I'm pretty stumped - anyone got a way I can dig into this error and see what is going on?

Chef - finding the missing attribute NilClass

Context - We have a massive amount of Chef attributes to perform our install, something like 3000+ have now been defined and change per environment.
Problem - Sometimes a Chef recipe will reference a non-existent attribute node[:mystuff][:typo]. This results in the following error:
Recipe Compile Error in /var/chef/cache/cookbooks/<yyy>/recipes/something.rb
undefined method '[]' for nil:NilClass
This is a worthless error because it doesn't let me know exactly what node/attribute is missing. Even running with chef-client -l debug doesn't help. knife cookbook test <x> doesn't help because syntactically it is correct. Is there a way to get it to print out the exact line number that is causing the error? The recipe may contain 10s or 100s of attributes so it is a huge time waster going through line by line to discover a typo.
I wrote Chef Sugar's deep_fetch method precisely for this reason.
The error you are getting is just the by-product of Ruby hashes. For more information on deep_fetch, you can also see my blog post on the subject: https://sethvargo.com/delicious-new-chef-sugars/

Jmeter 2.10 and 2.11 don't let me start a HTTP Script Recorder

I'm having trouble starting a proxy server for jmeter 2.10 and 2.11. I found a couple links here on SO and apache.org but my error message is slightly different that what's written on these links. Per the wiki from apache.org, I don't think I have trouble finding keytool because it returns the path when I do a
which keytool
/usr/bin/keytool
and I don't have trouble creating a file in the jmeter-210 and jmeter-211/bin dirs. This is the error message I get in my jmeter.log file:
ERROR - jmeter.protocol.http.proxy.ProxyControl: Could not initialise key store java.io.IOException: Command :'"keytool" "-genkeypair" "-alias" ":root_ca:" "-dname" "CN=_ DO NOT INSTALL unless this is your certificate (JMeter root CA), OU=Username: COMPANY\user.name, C=US" "-keyalg" "RSA" "-keystore" "proxyserver.jks" "-storepass" "randomstr1" "-keypass" "randomstr1" "-validity" "7" "-ext" "bc:c"' failed, code: 1
keytool error: java.io.IOException: Invalid escaped character in AVA: 's'
I don't know what this "invalid escaped char in AVA" is. My company and username don't have the string "AVA" and I didn't find it in any of the property files in jmeter-21x/bin.
Not sure if this is affecting it but I'm running jmeter from Darwin on a MBP, OSX 10.7.5.
JMeter 2.9 doesn't give me any proxy issues, although, I ran into other issues with it, which is why I tried using these 2 newer versions, which are giving me problems with the proxy server. I'll try going down to 2.8 to see what happens but I'd rather not if I can help it. That and I'm super curious what the issue is with 2.1x and my laptop. Thanks in advance for your help.
EDIT: The COMPANY/user.name part of the error message was changed this way to sanitize the error message, although, I will try at home on my linux box to see if the funny username representation is the cause.
As per sebb response on User Mailing List:
"I suspect it might be in the string "COMPANY\user.name" which is
derived from the Java system property "user.name".
You could try redefining it on the command line (or in
system.properties) to something simpler, for example:
-Duser.name=foobar
A bug has been opened to fix this issue with "\" character:
https://issues.apache.org/bugzilla/show_bug.cgi?id=56178

jbi-registry.xml: Premature end of file

Sometimes Glassfish - OpenESB-v2.3 gives following error:
jbi-registry.xml:1:1: Premature end of file.
What did happen here?
This occurs sometimes when the Server or Glassfish restarts or have not correct shutdown (sometime Windows Update forced restarts). Then the file jbi-registry.xml is empty and we get above error.
To correct it, just go to the following folder:
%GLASSFISH_ESB%/glassfish/domains/domain1/jbi/config
And check if the jbi-registry.xml is empty. If this is the case, replace it with the jbi-registry-backup.xml which is located in the same directory and should not be empty.

Resources