Open esciara opened 10 years ago
Here are the weird things:
/etc/apache2/sites-available/(none).conf
But part what really crashes is:
Chef::Mixin::Template::TemplateError
------------------------------------
undefined method `empty?' for nil:NilClass
This happens on the line:
9: <% unless node['confluence']['apache2']['virtual_host_alias'].empty? -%>
which would mean that node['confluence']['apache2']['virtual_host_alias']
returns empty.
Reproduced the bug by running .kitchen.cloud.yml from my machine.
Looking at the code, node['confluence']['apache2']['virtual_host_alias']
is set in attributes/default.rb
of the bflad/chef-confluence@2802acb1c7c886a05090ef3f96df8b5e276246ff cookbook with
default['confluence']['apache2']['virtual_host_alias'] = node['fqdn']
default['confluence']['apache2']['virtual_host_name'] = node['hostname']
Looking on the Digital Ocean VM:
root@(none):~# hostname
(none)
root@(none):~# hostname --fqdn
hostname: Name or service not known
root@(none):~# cat /etc/hostname
confluence-ubuntu-1204-myusername-Ems-MacBook-Pro.local-7ywabhw6
root@(none):~# cat /etc/hosts
127.0.0.1 localhost confluence-ubuntu-1204-myusername-Ems-MacBook-Pro.local-7ywabhw6 confluence-ubuntu-1204-myusername-Ems-MacBook-Pro
The bug is corrected by forcing the hostname of the VM by adding the following in :
driver:
server_name: confluence-jira-crowd-server
The result on the VM is:
root@confluence-jira-crowd-server:~# hostname
confluence-jira-crowd-server
root@confluence-jira-crowd-server:~# hostname --fqdn
localhost
Looking at the code from test-kitchen/kitchen-digitalocean@b63c1bc92a7fc33590c7cb2b44057f7bcfbee6e6 in file lib/kitchen/driver/digitalocean.rb:
default_config :server_name do |driver|
driver.default_name
end
# Further down...
def default_name
# Generate what should be a unique server name
rand_str = Array.new(8) { rand(36).to_s(36) }.join
"#{instance.name}-#{Etc.getlogin}-#{Socket.gethostname}-#{rand_str}"
end
Opening an issue with test-kitchen/kitchen-digitalocean
.
Temporarly fixed this and waiting for test-kitchen/kitchen-digitalocean#12 to be resolved.
Keep it open as fix is only temporary.
Failed Travis job is https://travis-ci.org/esciara/chef-confluence-jira-crowd/builds/24057988 . Full stack: