zulip: Migration fails for installation using pgroonga
Migrating to an Ubuntu 18.04 server from an older Ubuntu 18.04 server with pgroonga fails with pgroonga error.
Steps:
- Make backup:
# As the zulip user
/home/zulip/deployments/current/manage.py backup
-
Copy file to new server.
-
Restore backup: https://zulip.readthedocs.io/en/latest/production/maintain-secure-upgrade.html#restoring-backups
-
See this error:
/home/zulip/deployments/current/scripts/setup/restore-backup zulip-backup-2019-05-17-07-05-08-7ocx478_.tar.gz
+ tar -C /tmp/zulip-restore-backup-i3a6cqrd '--transform=s|^zulip-backup/settings(/.*)?$|/etc/zulip\1|x' '--transform=s|^zulip-backup/zproject(/.*)?$|/home/zulip/deployments/2019-05-17-06-56-58/zproject/../zproject\1|x' '--transform=s|^zulip-backup/uploads(/.*)?$|/home/zulip/uploads\1|x' -xPz
+ chown -R postgres -- /tmp/zulip-restore-backup-i3a6cqrd
+ /home/zulip/deployments/2019-05-17-06-56-58/zproject/../scripts/setup/terminate-psql-sessions zulip zulip zulip_base
pg_terminate_backend
----------------------
t
t
t
t
(4 rows)
+ su -s /usr/bin/env - -- postgres dropdb --if-exists -- zulip
+ su -s /usr/bin/env - -- postgres createdb -O zulip -T template0 -- zulip
+ su -s /usr/bin/env - -- postgres pg_restore -d zulip -- /tmp/zulip-restore-backup-i3a6cqrd/zulip-backup/database
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3; 3079 28338 EXTENSION pgroonga
pg_restore: [archiver (db)] could not execute query: ERROR: could not open extension control file "/usr/share/postgresql/10/extension/pgroonga.control": No such file or directory
Command was: CREATE EXTENSION IF NOT EXISTS pgroonga WITH SCHEMA public;
pg_restore: [archiver (db)] Error from TOC entry 4525; 0 0 COMMENT EXTENSION pgroonga
pg_restore: [archiver (db)] could not execute query: ERROR: extension "pgroonga" does not exist
Command was: COMMENT ON EXTENSION pgroonga IS 'Super fast and all languages supported full text search index based on Groonga';
pg_restore: [archiver (db)] Error from TOC entry 3932; 1259 38414 INDEX zerver_message_search_pgroonga zulip
pg_restore: [archiver (db)] could not execute query: ERROR: access method "pgroonga" does not exist
Command was: CREATE INDEX zerver_message_search_pgroonga ON zulip.zerver_message USING pgroonga (search_pgroonga);
pg_restore: [archiver (db)] Error from TOC entry 4526; 0 0 ACL SCHEMA pgroonga postgres
pg_restore: [archiver (db)] could not execute query: ERROR: schema "pgroonga" does not exist
Command was: GRANT USAGE ON SCHEMA pgroonga TO zulip;
WARNING: errors ignored on restore: 4
Error running a subcommand of /home/zulip/deployments/current/scripts/setup/restore-backup: su -s /usr/bin/env - -- postgres pg_restore -d zulip -- /tmp/zulip-restore-backup-i3a6cqrd/zulip-backup/database
Actual error output for the subcommand is just above this.
Traceback (most recent call last):
File "/home/zulip/deployments/current/scripts/setup/restore-backup", line 122, in <module>
restore_backup(tarball_file)
File "/home/zulip/deployments/current/scripts/setup/restore-backup", line 97, in restore_backup
run(as_postgres + ["pg_restore", "-d", db_name, "--", db_dir])
File "/home/zulip/deployments/current/scripts/lib/zulip_tools.py", line 203, in run
subprocess.check_call(args, **kwargs)
File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['su', '-s', '/usr/bin/env', '-', '--', 'postgres', 'pg_restore', '-d', 'zulip', '--', '/tmp/zulip-restore-backup-i3a6cqrd/zulip-backup/database']' returned non-zero exit status 1.
I think I probably have to install pgroonga on the new server. But
a. where are these directions? should I just use https://zulip.readthedocs.io/en/latest/subsystems/full-text-search.html ?
b. shouldn’t this be part of the backup/restore directions since it can prevent restore?
c. Did @kou say this documentation specific to pgroonga during restore exists somewhere?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (10 by maintainers)
Commits related to this issue
- restore-backup: Run zulip-puppet-apply before pg_restore. This should ensure that we apply any special configuration for the database system (e.g. installing `pgroonga`) before we try to restore the ... — committed to timabbott/zulip by timabbott 5 years ago
- restore-backup: Run zulip-puppet-apply before pg_restore. This should ensure that we apply any special configuration for the database system (e.g. installing `pgroonga`) before we try to restore the ... — committed to timabbott/zulip by timabbott 5 years ago
- restore-backup: Run zulip-puppet-apply before pg_restore. This should ensure that we apply any special configuration for the database system (e.g. installing `pgroonga`) before we try to restore the ... — committed to timabbott/zulip by timabbott 5 years ago
- restore-backup: Run zulip-puppet-apply before pg_restore. This should ensure that we apply any special configuration for the database system (e.g. installing `pgroonga`) before we try to restore the ... — committed to timabbott/zulip by timabbott 5 years ago
@stone212 you can look at
ZULIP_VERSION
in/home/zulip/deployments/current/version.py
to check what version you’re running; that works on any Zulip release since the beginning of time.If you’re running master, that’s fine too; the fix was merged into both 2.0.4 and master at about the same time.
Do I get a prize for having Issue #12345?