sous-chefs / postgresql

Development repository for the postgresql cookbook
https://supermarket.chef.io/cookbooks/postgresql
Apache License 2.0
359 stars 563 forks source link

postgresql::server fails on Debian Wheezy #147

Closed infertux closed 8 years ago

infertux commented 10 years ago

Output from Chef:

================================================================================
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 /root/chef/cookbooks/postgresql/recipes/server.rb

 62: template "#{node['postgresql']['dir']}/postgresql.conf" do
 63:   source "postgresql.conf.erb"
 64:   owner "postgres"
 65:   group "postgres"
 66:   mode 0600
 67:   notifies change_notify, 'service[postgresql]', :immediately
 68: end
 69: 

Compiled Resource:
------------------
# Declared in /root/chef/cookbooks/postgresql/recipes/server.rb:62:in `from_file'

template("/etc/postgresql/9.1/main/postgresql.conf") do
  provider Chef::Provider::Template
  action "create"
  retries 0
  retry_delay 2
  guard_interpreter :default
  path "/etc/postgresql/9.1/main/postgresql.conf"
  backup 5
  atomic_update true
  source "postgresql.conf.erb"
  cookbook_name :postgresql
  recipe_name "server"
  owner "postgres"
  group "postgres"
  mode 384
end

Debug info from the server:

root@server:~# cat /etc/debian_version 
7.5
root@server:~# dpkg -s postgresql-9.1
Package: postgresql-9.1
Status: install ok installed
Priority: optional
Section: database
Installed-Size: 16450
Maintainer: Debian PostgreSQL Maintainers <pkg-postgresql-public@lists.alioth.debian.org>
Architecture: amd64
Version: 9.1.13-0wheezy1
Replaces: postgresql-contrib-9.1 (<< 9.1~beta1-3~), postgresql-plpython-9.1 (<< 9.1.13-0wheezy1)
Depends: libc6 (>= 2.11), libcomerr2 (>= 1.01), libgssapi-krb5-2 (>= 1.8+dfsg), libkrb5-3 (>= 1.6.dfsg.2), libldap-2.4-2 (>= 2.4.7), libpam0g (>= 0.99.7.1), libpq5 (>= 9.1~), libssl1.0.0 (>= 1.0.0), libxml2 (>= 2.7.4), postgresql-client-9.1, postgresql-common (>= 115~), tzdata, ssl-cert, locales
Suggests: oidentd | ident-server, locales-all
Breaks: postgresql-plpython-9.1 (<< 9.1.13-0wheezy1)
Conflicts: postgresql (<< 7.5)
[...]
root@server:~# dpkg -L postgresql-9.1
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/postgresql-9.1
/usr/share/doc/postgresql-9.1/changelog.Debian.gz
/usr/share/doc/postgresql-9.1/changelog.gz
/usr/share/doc/postgresql-9.1/copyright
/usr/share/postgresql
/usr/share/postgresql/9.1
/usr/share/postgresql/9.1/sql_features.txt
/usr/share/postgresql/9.1/postgres.shdescription
/usr/share/postgresql/9.1/postgres.description
/usr/share/postgresql/9.1/postgres.bki
/usr/share/postgresql/9.1/recovery.conf.sample
/usr/share/postgresql/9.1/postgresql.conf.sample
/usr/share/postgresql/9.1/pg_service.conf.sample
/usr/share/postgresql/9.1/pg_ident.conf.sample
/usr/share/postgresql/9.1/pg_hba.conf.sample
/usr/share/postgresql/9.1/system_views.sql
/usr/share/postgresql/9.1/snowball_create.sql
/usr/share/postgresql/9.1/information_schema.sql
/usr/share/postgresql/9.1/conversion_create.sql
/usr/share/postgresql/9.1/tsearch_data
/usr/share/postgresql/9.1/tsearch_data/synonym_sample.syn
/usr/share/postgresql/9.1/tsearch_data/thesaurus_sample.ths
/usr/share/postgresql/9.1/tsearch_data/hunspell_sample.affix
/usr/share/postgresql/9.1/tsearch_data/ispell_sample.affix
/usr/share/postgresql/9.1/tsearch_data/ispell_sample.dict
/usr/share/postgresql/9.1/tsearch_data/danish.stop
/usr/share/postgresql/9.1/tsearch_data/dutch.stop
/usr/share/postgresql/9.1/tsearch_data/english.stop
/usr/share/postgresql/9.1/tsearch_data/finnish.stop
/usr/share/postgresql/9.1/tsearch_data/french.stop
/usr/share/postgresql/9.1/tsearch_data/german.stop
/usr/share/postgresql/9.1/tsearch_data/hungarian.stop
/usr/share/postgresql/9.1/tsearch_data/italian.stop
/usr/share/postgresql/9.1/tsearch_data/norwegian.stop
/usr/share/postgresql/9.1/tsearch_data/portuguese.stop
/usr/share/postgresql/9.1/tsearch_data/russian.stop
/usr/share/postgresql/9.1/tsearch_data/spanish.stop
/usr/share/postgresql/9.1/tsearch_data/swedish.stop
/usr/share/postgresql/9.1/tsearch_data/turkish.stop
/usr/share/postgresql/9.1/tsearch_data/xsyn_sample.rules
/usr/share/postgresql/9.1/tsearch_data/unaccent.rules
/usr/share/postgresql/9.1/timezonesets
/usr/share/postgresql/9.1/timezonesets/Pacific.txt
/usr/share/postgresql/9.1/timezonesets/Indian.txt
/usr/share/postgresql/9.1/timezonesets/India
/usr/share/postgresql/9.1/timezonesets/Europe.txt
/usr/share/postgresql/9.1/timezonesets/Etc.txt
/usr/share/postgresql/9.1/timezonesets/Default
/usr/share/postgresql/9.1/timezonesets/Australia.txt
/usr/share/postgresql/9.1/timezonesets/Australia
/usr/share/postgresql/9.1/timezonesets/Atlantic.txt
/usr/share/postgresql/9.1/timezonesets/Asia.txt
/usr/share/postgresql/9.1/timezonesets/Antarctica.txt
/usr/share/postgresql/9.1/timezonesets/America.txt
/usr/share/postgresql/9.1/timezonesets/Africa.txt
/usr/share/postgresql/9.1/man
/usr/share/postgresql/9.1/man/man1
/usr/share/postgresql/9.1/man/man1/postmaster.1.gz
/usr/share/postgresql/9.1/man/man1/postgres.1.gz
/usr/share/postgresql/9.1/man/man1/pg_resetxlog.1.gz
/usr/share/postgresql/9.1/man/man1/pg_ctl.1.gz
/usr/share/postgresql/9.1/man/man1/pg_controldata.1.gz
/usr/share/postgresql/9.1/man/man1/initdb.1.gz
/usr/share/postgresql/9.1/extension
/usr/share/postgresql/9.1/extension/plpgsql.control
/usr/share/postgresql/9.1/extension/plpgsql--unpackaged--1.0.sql
/usr/share/postgresql/9.1/extension/plpgsql--1.0.sql
/usr/share/locale
/usr/share/locale/ta
/usr/share/locale/ta/LC_MESSAGES
/usr/share/locale/ta/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/zh_TW
/usr/share/locale/zh_TW/LC_MESSAGES
/usr/share/locale/zh_TW/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/zh_TW/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/zh_TW/LC_MESSAGES/postgres-9.1.mo
/usr/share/locale/zh_TW/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/zh_TW/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/zh_TW/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/zh_TW/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/zh_CN
/usr/share/locale/zh_CN/LC_MESSAGES
/usr/share/locale/zh_CN/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/zh_CN/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/zh_CN/LC_MESSAGES/postgres-9.1.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/zh_CN/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/zh_CN/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/tr
/usr/share/locale/tr/LC_MESSAGES
/usr/share/locale/tr/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/tr/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/tr/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/tr/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/tr/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/tr/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/sv
/usr/share/locale/sv/LC_MESSAGES
/usr/share/locale/sv/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/sv/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/ru
/usr/share/locale/ru/LC_MESSAGES
/usr/share/locale/ru/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/ru/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/ru/LC_MESSAGES/postgres-9.1.mo
/usr/share/locale/ru/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/ru/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/ru/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/ru/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/ro
/usr/share/locale/ro/LC_MESSAGES
/usr/share/locale/ro/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/ro/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/ro/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/ro/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/ro/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/pt_BR
/usr/share/locale/pt_BR/LC_MESSAGES
/usr/share/locale/pt_BR/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/pt_BR/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/pt_BR/LC_MESSAGES/postgres-9.1.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/pt_BR/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/pt_BR/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/pl
/usr/share/locale/pl/LC_MESSAGES
/usr/share/locale/pl/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/pl/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/pl/LC_MESSAGES/postgres-9.1.mo
/usr/share/locale/pl/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/pl/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/pl/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/pl/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/ko
/usr/share/locale/ko/LC_MESSAGES
/usr/share/locale/ko/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/ko/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/ko/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/ko/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/ja
/usr/share/locale/ja/LC_MESSAGES
/usr/share/locale/ja/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/ja/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/ja/LC_MESSAGES/postgres-9.1.mo
/usr/share/locale/ja/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/ja/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/ja/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/ja/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/it
/usr/share/locale/it/LC_MESSAGES
/usr/share/locale/it/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/it/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/it/LC_MESSAGES/postgres-9.1.mo
/usr/share/locale/it/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/it/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/it/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/it/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/fr
/usr/share/locale/fr/LC_MESSAGES
/usr/share/locale/fr/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/fr/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/fr/LC_MESSAGES/postgres-9.1.mo
/usr/share/locale/fr/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/fr/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/fr/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/fr/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/es
/usr/share/locale/es/LC_MESSAGES
/usr/share/locale/es/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/es/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/es/LC_MESSAGES/postgres-9.1.mo
/usr/share/locale/es/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/es/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/es/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/es/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/de
/usr/share/locale/de/LC_MESSAGES
/usr/share/locale/de/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/de/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/de/LC_MESSAGES/postgres-9.1.mo
/usr/share/locale/de/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/de/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/de/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/de/LC_MESSAGES/initdb-9.1.mo
/usr/share/locale/cs
/usr/share/locale/cs/LC_MESSAGES
/usr/share/locale/cs/LC_MESSAGES/plpython-9.1.mo
/usr/share/locale/cs/LC_MESSAGES/plpgsql-9.1.mo
/usr/share/locale/cs/LC_MESSAGES/pg_resetxlog-9.1.mo
/usr/share/locale/cs/LC_MESSAGES/pg_ctl-9.1.mo
/usr/share/locale/cs/LC_MESSAGES/pg_controldata-9.1.mo
/usr/share/locale/cs/LC_MESSAGES/initdb-9.1.mo
/usr/lib
/usr/lib/postgresql
/usr/lib/postgresql/9.1
/usr/lib/postgresql/9.1/lib
/usr/lib/postgresql/9.1/lib/ascii_and_mic.so
/usr/lib/postgresql/9.1/lib/cyrillic_and_mic.so
/usr/lib/postgresql/9.1/lib/euc_cn_and_mic.so
/usr/lib/postgresql/9.1/lib/euc_jp_and_sjis.so
/usr/lib/postgresql/9.1/lib/euc_kr_and_mic.so
/usr/lib/postgresql/9.1/lib/euc_tw_and_big5.so
/usr/lib/postgresql/9.1/lib/latin2_and_win1250.so
/usr/lib/postgresql/9.1/lib/latin_and_mic.so
/usr/lib/postgresql/9.1/lib/utf8_and_ascii.so
/usr/lib/postgresql/9.1/lib/utf8_and_big5.so
/usr/lib/postgresql/9.1/lib/utf8_and_cyrillic.so
/usr/lib/postgresql/9.1/lib/utf8_and_euc2004.so
/usr/lib/postgresql/9.1/lib/utf8_and_euc_cn.so
/usr/lib/postgresql/9.1/lib/utf8_and_euc_jp.so
/usr/lib/postgresql/9.1/lib/utf8_and_euc_kr.so
/usr/lib/postgresql/9.1/lib/utf8_and_euc_tw.so
/usr/lib/postgresql/9.1/lib/utf8_and_gb18030.so
/usr/lib/postgresql/9.1/lib/utf8_and_gbk.so
/usr/lib/postgresql/9.1/lib/utf8_and_iso8859.so
/usr/lib/postgresql/9.1/lib/utf8_and_iso8859_1.so
/usr/lib/postgresql/9.1/lib/utf8_and_johab.so
/usr/lib/postgresql/9.1/lib/utf8_and_sjis.so
/usr/lib/postgresql/9.1/lib/utf8_and_sjis2004.so
/usr/lib/postgresql/9.1/lib/utf8_and_uhc.so
/usr/lib/postgresql/9.1/lib/utf8_and_win.so
/usr/lib/postgresql/9.1/lib/euc2004_sjis2004.so
/usr/lib/postgresql/9.1/lib/libpqwalreceiver.so
/usr/lib/postgresql/9.1/lib/plpgsql.so
/usr/lib/postgresql/9.1/lib/dict_snowball.so
/usr/lib/postgresql/9.1/lib/pg_upgrade_support.so
/usr/lib/postgresql/9.1/lib/tsearch2.so
/usr/lib/postgresql/9.1/bin
/usr/lib/postgresql/9.1/bin/initdb
/usr/lib/postgresql/9.1/bin/pg_controldata
/usr/lib/postgresql/9.1/bin/pg_ctl
/usr/lib/postgresql/9.1/bin/pg_resetxlog
/usr/lib/postgresql/9.1/bin/pg_test_fsync
/usr/lib/postgresql/9.1/bin/pg_upgrade
/usr/lib/postgresql/9.1/bin/postgres
/usr/share/doc/postgresql-9.1/README.Debian.gz
/usr/lib/postgresql/9.1/bin/postmaster

As you can see, the APT package doesn't create the /etc/postgresql/ directory. Please let me know if you need more information.

sinfomicien commented 10 years ago

After few problems, i made it finally. You have 2 choices: Set correctly the LC_ALL env variables in your system base install... Or wait until my PR is merged (which can happen, or not).

andre1810 commented 9 years ago

Got the same issue using 9.1 under debian.

It works for me by setting version to 9.4 via node['postgresql']['version']

slyness commented 8 years ago

This is no longer an issue with current cookbook versions. Including default version 9.1 for this Debian release.

lock[bot] commented 6 years ago

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.