consuldemocracy/installer

Error when installing Postgres extensions

PierreMesure opened this issue · 0 comments

I just tried to install Consul with Ansible on a Ubuntu 16.04 LTS machine and I got the following error message:

TASK [postgresql : Add PostgreSQL extensions] *********************************************************************************************************************************************************************
ok: [95.216.150.39] => (item=plpgsql) => changed=false 
  ansible_loop_var: item
  db: consul_production
  ext: plpgsql
  item: plpgsql
  queries: []
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OperationalError: could not open extension control file "/usr/share/postgresql/9.5/extension/unaccent.control": No such file or directory
failed: [95.216.150.39] (item=unaccent) => changed=false 
  ansible_loop_var: item
  item: unaccent
  msg: |-
    Database query failed: could not open extension control file "/usr/share/postgresql/9.5/extension/unaccent.control": No such file or directory
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: OperationalError: could not open extension control file "/usr/share/postgresql/9.5/extension/pg_trgm.control": No such file or directory
failed: [95.216.150.39] (item=pg_trgm) => changed=false 
  ansible_loop_var: item
  item: pg_trgm
  msg: |-
    Database query failed: could not open extension control file "/usr/share/postgresql/9.5/extension/pg_trgm.control": No such file or directory

I solved it by manually installing postgresql-contrib:

sudo apt install postgresql-contrib

I didn't have any problem before so this is maybe due to the cleaning of #76. In any case, I suggest we add postgresql-contrib to the list of dependencies to avoid this error.

Context

This crash happened on a VPS on Ubuntu 16.04 hosted on Hetzner.