cloudfoundry-community-attic / bosh-bootstrap

From zero to a running micro BOSH in one command line
MIT License
63 stars 46 forks source link

ERROR: illegal image file #324

Open rkoster opened 9 years ago

rkoster commented 9 years ago

ERROR: illegal image file When using bosh_cli_plugin_micro version 3143.

Output below:

Stemcell properties                                          OK

Stemcell info
-------------
Name:    bosh-aws-xen-ubuntu-trusty-go_agent
Version: 3143

  Started deploy micro bosh
  Started deploy micro bosh > Unpacking stemcell. Done (00:00:09)
  Started deploy micro bosh > Uploading stemcelllog writing failed. can't be called from trap context
create stemcell failed: Unable to copy stemcell root image: command 'sudo -n /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_aws_cpi-2.1.0/scripts/stemcell-copy.sh /tmp/d20151123-32475-1ngmlsr/sc-20151123-32475-1
c9pwj0/image /dev/xvdf 2>&1' failed with exit code 1
Script output:
ERROR: illegal image file: /tmp/d20151123-32475-1ngmlsr/sc-20151123-32475-1c9pwj0/image
:
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_aws_cpi-2.1.0/lib/cloud/aws/stemcell_creator.rb:71:in `rescue in copy_root_image'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_aws_cpi-2.1.0/lib/cloud/aws/stemcell_creator.rb:54:in `copy_root_image'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_aws_cpi-2.1.0/lib/cloud/aws/stemcell_creator.rb:19:in `create'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_aws_cpi-2.1.0/lib/cloud/aws/cloud.rb:493:in `block in create_stemcell'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_common-1.3143.0/lib/common/thread_formatter.rb:49:in `with_thread_name'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_aws_cpi-2.1.0/lib/cloud/aws/cloud.rb:473:in `create_stemcell'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_cpi-1.3143.0/lib/cloud/internal_cpi.rb:22:in `invoke_cpi_method'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_cpi-1.3143.0/lib/cloud/internal_cpi.rb:10:in `method_missing'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_cli_plugin_micro-1.3143.0/lib/bosh/deployer/instance_manager.rb:228:in `block (2 levels) in create_stemcell'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_cli_plugin_micro-1.3143.0/lib/bosh/deployer/instance_manager.rb:85:in `step'
/home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_cli_plugin_micro-1.3143.0/lib/bosh/deployer/instance_manager.rb:227:in `block in create_stemcell'
rkoster commented 9 years ago

Was able to work around the issue by manually applying the fix from: https://github.com/cloudfoundry-incubator/bosh-aws-cpi-release/commit/d99ce44eb7f47d9e2b4573a96cdc1b2881df3481 to /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_aws_cpi-2.1.0/scripts/stemcell-copy.sh

drnic commented 9 years ago

Is this a bosh-bootstrap bug or bosh_cli_plugin_micro bug? And is it caused by a regression in new stemcell?

On Mon, Nov 23, 2015 at 2:44 AM, Ruben Koster notifications@github.com wrote:

Was able to work around the issue by manually applying the fix from: https://github.com/cloudfoundry-incubator/bosh-aws-cpi-release/commit/d99ce44eb7f47d9e2b4573a96cdc1b2881df3481 to /home/ubuntu/.rvm/gems/ruby-2.1.5/gems/bosh_aws_cpi-2.1.0/scripts/stemcell-copy.sh

Reply to this email directly or view it on GitHub: https://github.com/cloudfoundry-community/bosh-bootstrap/issues/324#issuecomment-158902144

rkoster commented 9 years ago

It is a bosh_cli_plugin_micro bug. Also encountered it when using a different stemcell. Will check to see when it was introduced.

rkoster commented 9 years ago

@cppforlife could the above be an bosh_cli_plugin_micro issue?

cppforlife commented 9 years ago

not micro cli specific. im guessing this is os specific.

error comes from here: https://github.com/cloudfoundry-incubator/bosh-aws-cpi-release/blob/master/src/bosh_aws_cpi/scripts/stemcell-copy.sh. its probably related to grep regex inconsistencies on os-es.

Sent from my iPhone

On Nov 23, 2015, at 11:19 AM, Ruben Koster notifications@github.com wrote:

@cppforlife could the above be an bosh_cli_plugin_micro issue?

— Reply to this email directly or view it on GitHub.

rkoster commented 9 years ago

@cppforlife The last commit in that file fixes something related the the regex. In which version of the bosh_aws_cpi gem will this fix be included?

rkoster commented 9 years ago

Worked around it by using the upstream stemcell-copy script which is loaded from the PATH by the cpi by default.

rkoster commented 9 years ago

This workaround needs to be included in bosh_bootstrap unless a new versions of the bosh_aws_cpi gem will be published. @cppforlife @drnic