Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ohai Should Be Able To Handle Binary UserData from ec2 Plugin #503

Closed
sean-horn opened this issue Mar 18, 2015 · 4 comments
Closed

Ohai Should Be Able To Handle Binary UserData from ec2 Plugin #503

sean-horn opened this issue Mar 18, 2015 · 4 comments
Labels
Type: Bug Does not work as expected.

Comments

@sean-horn
Copy link
Contributor

Zendesk 3391

As customers, I, Amazon, and Atlassian would like to send binary userdata to EC2 instances.
This is implicitly allowed by AWS and the cloud-init package and so Chef should allow it too.

When the current Ohai 8.1.1 tries to display any binary userdata at the end of its standalone run or during the node.save at the end of chef-client runs, it becomes sad, with

/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:50:in `raise_error_for_status': Invalid UTF-8 string: cannot encode to UTF-8 (FFI_Yajl::EncodeError) 
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl' 
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl' 
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `ffi_yajl' 
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `do_yajl_encode' 
from /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ffi-yajl-1.4.0/lib/ffi_yajl/encoder.rb:21:in `encode' 
from /opt/chef/embedded/apps/ohai/lib/ohai/system.rb:181:in `json_pretty_print' 
from /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:97:in `run_application' 
from /opt/chef/embedded/apps/ohai/lib/ohai/application.rb:70:in `run' 
from /opt/chef/embedded/apps/ohai/bin/ohai:42:in `<top (required)>' 
from /usr/bin/ohai:23:in `load' 
from /usr/bin/ohai:23:in `<main>'

This PR might help #504

@sean-horn sean-horn added the Bug label Mar 18, 2015
@apsoto
Copy link

apsoto commented Mar 18, 2015

Previously working chef run's on EC2 will suddenly start failing once binary data is passed to new instances, as we are experiencing.

In our case, the chef bootstrapped Elastic Build nodes for our CI/CD infrastructure on Bamboo OnDemand broke with a recent release of Bamboo OnDemand. Bamboo changed the way it launches EC2 instances by compressing the userdata attribute to fit more data.

@apsoto
Copy link

apsoto commented Mar 18, 2015

FYI - this issue was reported two years ago as well

https://tickets.opscode.com/browse/OHAI-516

@apsoto
Copy link

apsoto commented Apr 9, 2015

This bug causes Chef to fail on EC2 nodes that pass binary data via userdata. At the moment, any EC2 node I have to first launch, then ssh in, manually edit the ohai source on the box, and finally re-run chef-client.

What can we do to move this along? Is there a way to use a forked/patched ohai ?

@lamont-granquist
Copy link
Contributor

fixed by #548 and or chef/chef#3320

@thommay thommay added Type: Bug Does not work as expected. and removed Bug labels Jan 24, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

4 participants