Command 'deploy' failed when running "bosh-init deploy ./bosh.yml"


Remi Tassing
 

Hi, I'm a total newbie.
I've been following the instructions on http://bosh.io/docs/init-aws.html for deploying CF on AWS. I've used the same settings expect for the time-zone which "us-east-1b" and I've updated the bosh.yml accordingly.

The log for "bosh-init deploy ./bosh.yml" can be seen below (I just couldn't get a clue this time):

ubuntu(a)ip-10-0-0-194:~/my-bosh$ bosh-init deploy ./bosh.yml
Deployment manifest: '/home/ubuntu/my-bosh/bosh.yml'
Deployment state: '/home/ubuntu/my-bosh/bosh-state.json'

Started validating
Downloading release 'bosh'... Skipped [Found in local cache] (00:00:00)
Validating release 'bosh'... Finished (00:00:04)
Downloading release 'bosh-aws-cpi'... Skipped [Found in local cache] (00:00:00)
Validating release 'bosh-aws-cpi'... Finished (00:00:00)
Validating cpi release... Finished (00:00:00)
Validating deployment manifest... Finished (00:00:00)
Downloading stemcell... Skipped [Found in local cache] (00:00:00)
Validating stemcell... Finished (00:00:00)
Finished validating (00:00:05)

Started installing CPI
Compiling package 'ruby_aws_cpi/a5b66d011ce1b31642ff148ea2c9097af65ff78c'... Finished (00:02:01)
Compiling package 'bosh_aws_cpi/0a3d63be846294c825914d40800b738323359fab'... Finished (00:01:12)
Installing packages... Finished (00:00:03)
Rendering job templates... Finished (00:00:00)
Installing job 'cpi'... Finished (00:00:00)
Finished installing CPI (00:03:18)

Starting registry... Finished (00:00:00)
Uploading stemcell 'bosh-aws-xen-hvm-ubuntu-trusty-go_agent/3012'... Finished (00:00:05)

Started deploying
Creating VM for instance 'bosh/0' from stemcell 'ami-5728e73c light'... Finished (00:00:44)
Waiting for the agent on VM 'i-0f540aaf' to be ready... Finished (00:01:41)
Creating disk... Finished (00:00:20)
Attaching disk 'vol-2c8824d6' to VM 'i-0f540aaf'... Finished (00:00:25)
Rendering job templates... Failed (00:00:00)
Failed deploying (00:03:12)

Stopping registry... Finished (00:00:00)
Cleaning up rendered CPI jobs... Finished (00:00:00)

Command 'deploy' failed:
Deploying:
Building state for instance 'bosh/0':
Rendering job templates for instance 'bosh/0':
Rendering templates for job 'director/abad62506b6f8b419fdc8f42a9e9967045057b45':
Rendering template src: director.yml.erb.erb, dst: config/director.yml.erb:
Rendering template src: /home/ubuntu/.bosh_init/installations/c1c25dc7-ba60-4606-70d6-820fd4083e46/tmp/bosh-init-release355238454/extracted_jobs/director/templates/director.yml.erb.erb, dst: /home/ubuntu/.bosh_init/installations/c1c25dc7-ba60-4606-70d6-820fd4083e46/tmp/rendered-jobs027702391/config/director.yml.erb:
Running ruby to render templates:
Running command: 'ruby /home/ubuntu/.bosh_init/installations/c1c25dc7-ba60-4606-70d6-820fd4083e46/tmp/erb-renderer802392987/erb-render.rb /home/ubuntu/.bosh_init/installations/c1c25dc7-ba60-4606-70d6-820fd4083e46/tmp/erb-renderer802392987/erb-context.json /home/ubuntu/.bosh_init/installations/c1c25dc7-ba60-4606-70d6-820fd4083e46/tmp/bosh-init-release355238454/extracted_jobs/director/templates/director.yml.erb.erb /home/ubuntu/.bosh_init/installations/c1c25dc7-ba60-4606-70d6-820fd4083e46/tmp/rendered-jobs027702391/config/director.yml.erb', stdout: '', stderr: '/home/ubuntu/.bosh_init/installations/c1c25dc7-ba60-4606-70d6-820fd4083e46/tmp/erb-renderer802392987/erb-render.rb:180:in `rescue in render': Error filling in template '/home/ubuntu/.bosh_init/installations/c1c25dc7-ba60-4606-70d6-820fd4083e46/tmp/bosh-init-release355238454/extracted_jobs/director/templates/director.yml.erb.erb' for director/0 (line 136: #<JSON::GeneratorError: only generation of JSON objects or
arrays allowed>) (RuntimeError)
from /home/ubuntu/.bosh_init/installations/c1c25dc7-ba60-4606-70d6-820fd4083e46/tmp/erb-renderer802392987/erb-render.rb:166:in `render'
from /home/ubuntu/.bosh_init/installations/c1c25dc7-ba60-4606-70d6-820fd4083e46/tmp/erb-renderer802392987/erb-render.rb:191:in `<main>'
':
exit status 1


Remi Tassing
 

This is apparently the same issue as in "Warning: don't use bosh-init with Ruby 1.9.3. " (https://github.com/cloudfoundry/bosh-init/pull/46)


Remi Tassing
 

In fact, installing and using Ruby-2.2.3, instead, got me through