database schema creation fails because create.sql.gz appears to now be named schema.sql.gz
stephgosling opened this issue · comments
Steph Gosling commented
Affected Puppet, Ruby, OS and module versions/distributions
- Puppet: 7.26.0
- Ruby: N/A
- Distribution: Ubuntu 22.04
- Module version: v9.2.0
How to reproduce (e.g Puppet code you use)
Trying a clean install on Ubuntu 22.04, single node setup with a very naive class:
class example::monitor::server {
class { 'postgresql::globals':
version => '14'
}
class { 'apache':
mpm_module => 'prefork',
}
class { apache::mod::php:
php_version => '8.1'
}
include postgresql::server
class { 'zabbix':
zabbix_url => 'monitor.example.com',
}
}
What are you seeing
DB initialisation fails:
Error: 'cd /usr/share/doc/zabbix-*-pgsql && if [ -f create.sql.gz ]; then gunzip -f create.sql.gz ; fi && psql -h 'localhost' -U 'zabbix_server' -d 'zabbix_server' -f create.sql && touch /etc/zabbix/.schema.done' returned 1 instead of one of [0]```
What behaviour did you expect instead
For it to work obvs.
Output log
Any additional information you'd like to impart
It's easily worked around by hand:
root@monitor:/usr/share/zabbix-server-pgsql# cp schema.sql.gz create.sql.gz
root@monitor:/usr/share/zabbix-server-pgsql# gunzip schema.sql.gz
root@monitor:/usr/share/zabbix-server-pgsql# ls
create.sql.gz data.sql.gz double.sql.gz images.sql.gz schema.sql timescaledb.sql.gz zabbix zabbix_server.conf
root@monitor:/usr/share/zabbix-server-pgsql# cp ^C
root@monitor:/usr/share/zabbix-server-pgsql# psql -h 'localhost' -U 'zabbix_server' -d 'zabbix_server' -f schema.sql
...
skip lots of CREATE TABLE etc. output
...
touch /etc/zabbix/.schema.done
and puppet then runs the other SQL scripts fine.
I've not hunted through the changelogs for zabbix-server-pgsql 1:5.0.17+dfsg-1 but clearly at somepoint create.sql got renamed.
Steph Gosling commented
Possibly can be closed as invalid/or the description is out of date. If one passes a current version (e.g. 6.0) then the schema stuff does seem to work. If one does not pass a version it defaults to 5.0 and the scripts are missing.