Re: Error filling in template 'properties.sh.erb' (line 13: undefined method `tcp_port' for nil:NilClass)


Eric Malm <emalm@...>
 

Hi, Minjeong,

If the che-inject job comes from
https://github.com/cloudfoundry-community/eclipse-che-boshrelease, the
problem may be that
https://github.com/cloudfoundry-community/eclipse-che-boshrelease/blob/master/jobs/che-inject/spec
does not include the docker.tcp_port property in the properties section, so
it's not available when BOSH renders the template
https://github.com/cloudfoundry-community/eclipse-che-boshrelease/blob/master/jobs/che-inject/templates/data/properties.sh.erb.
In fact, there are no "docker" properties at all in that spec file, so the
docker property resolves to nil, and hence the template-renderer generates
the undefined-method error above when attempting to access the "tcp_port"
subproperty.

If that's not release you're using, please do link to the one you are.

I believe at some point recently BOSH started separating those properties
for colocated jobs more carefully: it used to be that each colocated job
would get the properties for all of the jobs, which is likely how that job
template ever managed to work at all. I can't seem to find a reference to
that change off-hand, though.

Best,
Eric

On Sat, Jan 21, 2017 at 7:13 AM, Minjeong Kim <kmj940101(a)gmail.com> wrote:

I am getting "Error filling in template 'properties.sh.erb' (line 13:
undefined method `tcp_port' for nil:NilClass)"
Could anyone please help me?

============================================================
=====================
[1] Error
============================================================
=====================

Director task 189
Deprecation: Ignoring cloud config. Manifest contains 'networks' section.

Started preparing deployment > Preparing deployment. Done (00:00:00)

Error 100: Unable to render instance groups for deployment. Errors are:
- Unable to render jobs for instance group 'che_docker_z1'. Errors are:
- Unable to render templates for job 'che-inject'. Errors are:
- Error filling in template 'properties.sh.erb' (line 13: undefined
method `tcp_port' for nil:NilClass)

Task 189 error

For a more detailed error report, run: bosh task 189 --debug

============================================================
=====================
[2] bosh gem versions
============================================================
=====================

*** LOCAL GEMS ***

bosh-template (1.3262.24.0)
bosh_cli (1.3262.24.0)
bosh_common (1.3262.24.0)

============================================================
=====================
[2] bosh status
============================================================
=====================

Config
/home/ubuntu/.bosh_config

Director
RSA 1024 bit CA certificates are loaded due to old openssl compatibility
Name Bosh Lite Director
URL https://ec2-54-85-194-150.compute-1.amazonaws.com:25555
Version 260.0.0 (00000000)
User admin
UUID f314cc48-5260-4d52-968d-bcec8f8eff0f
CPI warden_cpi
dns disabled
compiled_package_cache disabled
snapshots disabled

Deployment
Manifest /home/ubuntu/workspace/eclipse-che-boshrelease/
manifest-examples/eclipse-che-warden-manifest.yml

============================================================
=====================
[3] bosh stemcells
============================================================
=====================

+---------------------------------------------+-------------
--+----------+--------------------------------------+
| Name | OS | Version |
CID |
+---------------------------------------------+-------------
--+----------+--------------------------------------+
| bosh-warden-boshlite-ubuntu-trusty-go_agent | ubuntu-trusty | 3312.15*
| 7349dae3-adc9-45fe-7695-858b64e65353 |
+---------------------------------------------+-------------
--+----------+--------------------------------------+

============================================================
=====================
[4] bosh releases
============================================================
=====================

+-------------+----------+-------------+
| Name | Versions | Commit Hash |
+-------------+----------+-------------+
| docker | 28* | fe153a95+ |
| eclipse-che | 7* | f4c25504+ |
| nginx | 4* | 2ab8b189+ |
+-------------+----------+-------------+

============================================================
=====================
[5] yaml
============================================================
=====================
compilation:
cloud_properties:
name: random
network: eclipse_che1
reuse_compilation_vms: true
workers: 6
director_uuid: f314cc48-5260-4d52-968d-bcec8f8eff0f
jobs:
- instances: 1
name: che_z1
networks:
- default:
- dns
- gateway
name: eclipse_che1
static_ips:
- 10.244.51.2
persistent_disk: 0
properties:
che:
docker:
host:
ip: 10.244.51.3
port: 2376
env:
http_proxy: http://elpaaso-squid-ige.internal-qa.paas:3128
https_proxy: http://elpaaso-squid-ige.internal-qa.paas:3128
resource_pool: small_z1
templates:
- name: che
release: eclipse-che
- instances: 1
name: che_docker_z1
networks:
- default:
- dns
- gateway
name: eclipse_che1
static_ips:
- 10.244.51.3
persistent_disk: 0
properties:
che:
ip: 10.244.51.2
docker:
tcp_address: 0.0.0.0
tcp_port: 2376
env:
http_proxy: http://elpaaso-squid-ige.internal-qa.paas:3128
https_proxy: http://elpaaso-squid-ige.internal-qa.paas:3128
resource_pool: small_z1
templates:
- name: che-inject
release: eclipse-che
- name: docker
release: docker
name: eclipse-che-warden
networks:
- name: eclipse_che1
subnets:
- gateway: 10.244.51.1
name: eclipse_che1
range: 10.244.51.0/24
static:
- 10.244.51.2
- 10.244.51.3
type: manual
properties: {}
releases:
- name: eclipse-che
version: latest
- name: docker
version: latest
- name: nginx
version: latest
resource_pools:
- cloud_properties:
name: random
name: small_z1
network: eclipse_che1
stemcell:
name: bosh-warden-boshlite-ubuntu-trusty-go_agent
version: latest
update:
canaries: 1
canary_watch_time: 1000-30000
max_in_flight: 50
serial: false
update_watch_time: 1000-30000

Join {cf-bosh@lists.cloudfoundry.org to automatically receive all group messages.