Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Unknown
-
Resolution: Unresolved
-
Affects Version/s: 0.10.8
-
Fix Version/s: None
-
Component/s: Chef Client
-
Labels:None
Description
While working with some template files in different encodings I ran into a failure when trying to produce a template in ISO-8859-1 that contained characters outside of the US-ASCII subset.
--failure
[Tue, 13 Mar 2012 11:51:10 -0500] INFO: Processing directory[/opt/encoded-templates] action create (encoding-templates::encoding-template-iso-8859-1-with-iso-chars line 7)
[Tue, 13 Mar 2012 11:51:10 -0500] INFO: Processing template[/opt/encoded-templates/iso8859-1EncodedTemplateWithISOChars.txt] action create (encoding-templates::encoding-template-iso-8859-1-with-iso-chars line 13)
[Tue, 13 Mar 2012 11:51:10 -0500] ERROR: template[/opt/encoded-templates/iso8859-1EncodedTemplateWithISOChars.txt] (encoding-templates::encoding-template-iso-8859-1-with-iso-chars line 13) has had an error
[Tue, 13 Mar 2012 11:51:10 -0500] ERROR: Running exception handlers
[Tue, 13 Mar 2012 11:51:10 -0500] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[Tue, 13 Mar 2012 11:51:10 -0500] ERROR: Exception handlers complete
[Tue, 13 Mar 2012 11:51:10 -0500] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[Tue, 13 Mar 2012 11:51:10 -0500] FATAL: NoMethodError: undefined method `-' for nil:NilClass
Chef stacktrace
–
Generated at 2012-03-13 11:51:10 -0500
NoMethodError: undefined method `-' for nil:NilClass
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/mixin/template.rb:74:in `source_listing'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/mixin/template.rb:90:in `to_s'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/runner.rb:83:in `rescue in block in converge'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/runner.rb:77:in `block in converge'
/usr/local/rvm/gems/ruby-1.9.3-p125/gems/chef-0.10.8/lib/chef/resource_collection.rb:94:in `block in execute_each_resource'
This is really more of an upstream problem with Erubis I believe, but was wondering if you had any suggestions for possible work arounds or fixes. (We did find that using ERB to create template files respected the magic character comment.)
We're running on Redhat 6.2 and in the short term just converted the templates and the code reading them to use UTF-8.
Attached is a cookbook with several templates to demonstrate the behavior.
Activity
- All
- Comments
- History
- Activity
- Transitions Summary