You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dir property will have to be modified as it is constructed using the existing value. This is expected and comes down to how chef attributes work. I'm looking into a redesign that would avoid this. Also you should really consider upgrading from 15.10 to a new Ubuntu release as 15.10 no longer gets security updates. Using a newer Ubuntu release and Test Kitchen would probably make your troubleshooting much easier in the future.
Cookbook version
Cheffile:
site "http://community.opscode.com/api/v1"
cookbook 'apt'
cookbook 'build-essential'
cookbook 'nodejs'
cookbook 'ruby_build'
cookbook 'rbenv', git: 'https://github.com/ianbrown78/chef-rbenv'
cookbook 'vim'
cookbook 'postgresql', '
> 6.0.1'> 0.3.0'cookbook 'postgis', '
cookbook 'redisio', git: 'https://github.com/brianbianco/redisio'
Chef-client version
Sorry not sure how to find this, I'm using vagrant 1.9.1
Platform Details
Windows 10 using Hyper V installing a Ubuntu 15.10
Scenario:
Installing Postgres 9.5
Steps to Reproduce:
using this vagrant file:
Vagrant.configure("2") do |config|
Set the provider order.
config.vm.provider "hyperv"
config.vm.provider "virtualbox"
Use Ubuntu Wily
config.vm.box = "remyjette/wily64"
config.vm.boot_timeout = 2000
Set port forwards.
config.vm.network :forwarded_port, guest: 5000, host: 5000
config.vm.network :forwarded_port, guest: 5432, host: 5432
Set up the sync folder.
config.vm.synced_folder ".", "/vagrant", type: "smb"
Set the virtual setttings.
config.vm.provider :hyperv do |hv|
hv.memory = 2048
hv.cpus = 2
hv.ip_address_timeout = 2000
end
Use Chef Solo to provision our virtual machine
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["cookbooks"]
end
end
Expected Result:
Expected installation of postgres 9.5
Actual Result:
An error is thrown:
==> default: * Parent directory /etc/postgresql/9.4/main does not exist.
==> default:
==> default: ================================================================================
==> default:
==> default: Error executing action
create
on resource 'template[/etc/postgresql/9.4/main/postgresql.conf]'==> default:
==> default: ================================================================================
==> default:
==> default:
==> default: Chef::Exceptions::EnclosingDirectoryDoesNotExist
==> default:
==> default: ------------------------------------------------
==> default:
==> default: Parent directory /etc/postgresql/9.4/main does not exist.
==> default:
==> default:
==> default: Resource Declaration:
==> default:
==> default: ---------------------
==> default:
==> default: # In /var/chef/cache/cookbooks/postgresql/recipes/server_conf.rb
==> default:
==> default:
==> default: 40: template "#{node['postgresql']['dir']}/postgresql.conf" do
==> default:
==> default: 41: source 'postgresql.conf.erb'
==> default:
==> default: 42: owner 'postgres'
==> default:
==> default: 43: group 'postgres'
==> default:
==> default: 44: mode '0600'
==> default:
==> default: 45: notifies change_notify, 'service[postgresql]', :immediately
==> default:
==> default: 46: end
==> default:
==> default: 47:
==> default:
==> default:
==> default: Compiled Resource:
==> default:
==> default: ------------------
==> default:
==> default: # Declared in /var/chef/cache/cookbooks/postgresql/recipes/server_conf.rb:40:in `from_file'
==> default:
==> default:
==> default: template("/etc/postgresql/9.4/main/postgresql.conf") do
==> default:
==> default: action [:create]
==> default:
==> default: retries 0
==> default:
==> default: retry_delay 2
==> default:
==> default: default_guard_interpreter :default
==> default:
==> default: source "postgresql.conf.erb"
==> default:
==> default: declared_type :template
==> default:
==> default: cookbook_name "postgresql"
==> default:
==> default: recipe_name "server_conf"
==> default:
==> default: owner "postgres"
==> default:
==> default: group "postgres"
==> default:
==> default: mode "0600"
==> default:
==> default: path "/etc/postgresql/9.4/main/postgresql.conf"
==> default:
==> default: end
==> default:
==> default:
==> default: Platform:
==> default:
==> default: ---------
==> default: x86_64-linux
==> default:
==> default: [2017-01-15T02:20:08-05:00] INFO: Running queued delayed notifications before re-raising exception
==> default:
==> default: Running handlers:
==> default: [2017-01-15T02:20:08-05:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: [2017-01-15T02:20:08-05:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 13 resources updated in 03 minutes 52 seconds
==> default: [2017-01-15T02:20:08-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2017-01-15T02:20:08-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
==> default: [2017-01-15T02:20:08-05:00] ERROR: template[/etc/postgresql/9.4/main/postgresql.conf] (postgresql::server_conf line 40) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /etc/postgresql/9.4/main does not exist.
==> default: [2017-01-15T02:20:08-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
This appears the same as this bug, but it is reported fixed in 4.0.0
#261
When I log into the virtual the folder for 9.5 is there.
Thanks!
The text was updated successfully, but these errors were encountered: