Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ubuntu 10, Ubuntu 12 and Debian 6 Support #249

Closed
zuazo opened this issue Apr 19, 2015 · 4 comments
Closed

Fix Ubuntu 10, Ubuntu 12 and Debian 6 Support #249

zuazo opened this issue Apr 19, 2015 · 4 comments

Comments

@zuazo
Copy link
Contributor

zuazo commented Apr 19, 2015

I found the same error on the following platforms:

  • Ubuntu 10
  • Ubuntu 12
  • Debian 6 (Squeeze)

I know there have been issues in the past to fix this problem: #222, #175, #108. But, testing with the latest cookbook version (3.4.18), the problem does not seem to be completely fixed. Changing the node['postgresql']['version'] attribute does not seem to fix the error either.

The cookbook works for newer Debian and Ubuntu versions, but not without setting the LC_ALL variable manually as mentioned in #108.

Error on Debian 6 and Ubuntu 10

Recipe: postgresql::server_debian
    - install version 8.4.21-0squeeze1 of package postgresql-8.4
Recipe: postgresql::server_conf

    * Parent directory /etc/postgresql/8.4/main does not exist.
    ================================================================================
    Error executing action `create` on resource 'template[/etc/postgresql/8.4/main/postgresql.conf]'
    ================================================================================

    Chef::Exceptions::EnclosingDirectoryDoesNotExist
    ------------------------------------------------
    Parent directory /etc/postgresql/8.4/main does not exist.

    Resource Declaration:
    ---------------------
    # In /tmp/kitchen/cookbooks/postgresql/recipes/server_conf.rb

     20: template "#{node['postgresql']['dir']}/postgresql.conf" do
     21:   source "postgresql.conf.erb"
     22:   owner "postgres"
     23:   group "postgres"
     24:   mode 0600
     25:   notifies change_notify, 'service[postgresql]', :delayed
     26: end
     27: 

    Compiled Resource:
    ------------------
    # Declared in /tmp/kitchen/cookbooks/postgresql/recipes/server_conf.rb:20:in `from_file'

    template("/etc/postgresql/8.4/main/postgresql.conf") do
      action "create"
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      path "/etc/postgresql/8.4/main/postgresql.conf"
      backup 5
      atomic_update true
      source "postgresql.conf.erb"
      declared_type :template
      cookbook_name :postgresql
      recipe_name "server_conf"
      owner "postgres"
      group "postgres"
      mode 384
    end


Running handlers:
[2015-04-19T19:08:22+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-04-19T19:08:22+00:00] ERROR: Exception handlers complete
[2015-04-19T19:08:22+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
Chef Client failed. 25 resources updated in 286.06004633 seconds
[2015-04-19T19:08:22+00:00] ERROR: template[/etc/postgresql/8.4/main/postgresql.conf] (postgresql::server_conf line 20) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /etc/postgresql/8.4/main does not exist.
[2015-04-19T19:08:22+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Error on Ubuntu 12

Recipe: postgresql::server_debian
  * apt_package[postgresql-9.1] action install
    - install version 9.1.15-0ubuntu0.12.04 of package postgresql-9.1
Recipe: postgresql::server_conf
  * template[/etc/postgresql/9.1/main/postgresql.conf] action create
    * Parent directory /etc/postgresql/9.1/main does not exist.
    ================================================================================
    Error executing action `create` on resource 'template[/etc/postgresql/9.1/main/postgresql.conf]'
    ================================================================================

    Chef::Exceptions::EnclosingDirectoryDoesNotExist
    ------------------------------------------------
    Parent directory /etc/postgresql/9.1/main does not exist.

    Resource Declaration:
    ---------------------
    # In /tmp/kitchen/cookbooks/postgresql/recipes/server_conf.rb

     20: template "#{node['postgresql']['dir']}/postgresql.conf" do
     21:   source "postgresql.conf.erb"
     22:   owner "postgres"
     23:   group "postgres"
     24:   mode 0600
     25:   notifies change_notify, 'service[postgresql]', :delayed
     26: end
     27: 


    ------------------
    # Declared in /tmp/kitchen/cookbooks/postgresql/recipes/server_conf.rb:20:in `from_file'

    template("/etc/postgresql/9.1/main/postgresql.conf") do
      action "create"
      retries 0
      retry_delay 2
  default_guard_interpreter :default
      path "/etc/postgresql/9.1/main/postgresql.conf"
      backup 5
      atomic_update true
      source "postgresql.conf.erb"
      declared_type :template
      cookbook_name :postgresql
      recipe_name "server_conf"
      owner "postgres"
      group "postgres"
      mode 384
    end


Running handlers:
[2015-04-19T19:47:04+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-04-19T19:47:04+00:00] ERROR: Exception handlers complete
[2015-04-19T19:47:04+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
Chef Client failed. 25 resources updated in 183.359028917 seconds
[2015-04-19T19:47:04+00:00] ERROR: template[/etc/postgresql/9.1/main/postgresql.conf] (postgresql::server_conf line 20) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /etc/postgresql/9.1/main does not exist.
[2015-04-19T19:47:04+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Related Issues

@zuazo
Copy link
Contributor Author

zuazo commented Oct 7, 2015

A workaround based on #270:

pgsql_last_package = node['postgresql']['server']['packages'].last

ruby_block 'Fix postgresql#249' do                                        
  block {}                                                                
  subscribes :run, "package[#{pgsql_last_package}]", :immediately         
  notifies :run, 'execute[Set locale and Create cluster]', :immediately   
  action :nothing                                                         
end                                                                       

include_recipe 'postgresql::server'                                         

@erkki
Copy link

erkki commented Dec 15, 2015

+1

@tas50
Copy link
Contributor

tas50 commented Oct 6, 2016

Support for Debain 6/Ubuntu 10.04 is going away in the next release as those are EoL. I've created a large PR to clean things up and it's converging with 12.04 so I'm going to close this out #365

@tas50 tas50 closed this as completed Oct 6, 2016
chris-rock pushed a commit to chris-rock/postgresql that referenced this issue Jan 4, 2017
Don't prepend Apache log path when requesting error logging to syslog
chris-rock pushed a commit to chris-rock/postgresql that referenced this issue Jan 4, 2017
@lock
Copy link

lock bot commented Jul 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants