BUG #13042: pg_upgrade --check succeeded but run failed due to missing thesaurus file

From: cestel(at)covermymeds(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13042: pg_upgrade --check succeeded but run failed due to missing thesaurus file
Date: 2015-04-13 15:10:05
Message-ID: 20150413151005.2527.42400@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13042
Logged by: CJ Estel
Email address: cestel(at)covermymeds(dot)com
PostgreSQL version: 9.4.1
Operating system: RHEL7
Description:

Run check, succeeded.

Run pg_upgrade, fails with error about thesaurus file.

Copy file into place, re-init db, and run pg_upgrade again, succeeded.

Thought on desired action: the check should fail because the thesaurus file
doesn't exist in 9.4

Detailed output below from upgrade:

postgres(at)dc0ppgc2n1:PRODUCTION:~> /usr/pgsql-9.4/bin/pg_upgrade -b
/usr/pgsql-9.3/bin -B /usr/pgsql-9.4/bin -d /var/lib/pgsql/9.3/data -D
/var/lib/pgsql/9.4/data --check
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is a superuser ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for invalid "line" user columns ok
Checking for presence of required libraries ok
Checking database user is a superuser ok
Checking for prepared transactions ok

*Clusters are compatible*
postgres(at)dc0ppgc2n1:PRODUCTION:~> /usr/pgsql-9.4/bin/pg_upgrade -b
/usr/pgsql-9.3/bin -B /usr/pgsql-9.4/bin -d /var/lib/pgsql/9.3/data -D
/var/lib/pgsql/9.4/data
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is a superuser ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for invalid "line" user columns ok
Creating dump of global objects ok
Creating dump of database schemas
ok
Checking for presence of required libraries ok
Checking database user is a superuser ok
Checking for prepared transactions ok

If pg_upgrade fails after this point, you must re-initdb the
new cluster before continuing.

Performing Upgrade
------------------
Analyzing all rows in the new cluster ok
Freezing all rows on the new cluster ok
Deleting files from new pg_clog ok
Copying old pg_clog to new server ok
Setting next transaction ID and epoch for new cluster ok
Deleting files from new pg_multixact/offsets ok
Copying old pg_multixact/offsets to new server ok
Deleting files from new pg_multixact/members ok
Copying old pg_multixact/members to new server ok
Setting next multixact ID and offset for new cluster ok
Resetting WAL archives ok
Setting frozenxid and minmxid counters in new cluster ok
Restoring global objects in the new cluster ok
Adding support functions to new cluster ok
Restoring database schemas in the new cluster
form_search
*failure*

Consult the last few lines of "pg_upgrade_dump_17063.log" for
the probable cause of the failure.
Failure, exiting
postgres(at)dc0ppgc2n1:PRODUCTION:~> tail -n 20 pg_upgrade_dump_17063.log
command: "/usr/pgsql-9.4/bin/pg_restore" --host "/var/lib/pgsql" --port
50432 --username "postgres" --exit-on-error --verbose --dbname "form_search"
"pg_upgrade_dump_17063.custom" >> "pg_upgrade_dump_17063.log" 2>&1
pg_restore: connecting to database for restore
pg_restore: creating pg_largeobject pg_largeobject
pg_restore: creating pg_largeobject_metadata pg_largeobject_metadata
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA "public"
pg_restore: creating FUNCTION fn_determinate_form_search(character varying,
character varying, character varying, character, character varying, boolean,
character varying)
pg_restore: creating FUNCTION fn_determinate_form_search_api(character
varying, character varying, character varying, character, character varying,
integer, character varying)
pg_restore: creating FUNCTION fn_drugname("text")
pg_restore: creating FUNCTION fn_searchforms("text", "text", "text", "text",
boolean)
pg_restore: creating FUNCTION fn_searchforms_api("text", "text", "text",
"text", integer)
pg_restore: creating FUNCTION plainto_or_tsquery("text")
pg_restore: creating FUNCTION to_weighted_tsvector("text")
pg_restore: creating TEXT SEARCH DICTIONARY cmm_thesaurus
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 1745; 3600 60173 TEXT
SEARCH DICTIONARY cmm_thesaurus postgres
pg_restore: [archiver (db)] could not execute query: ERROR: could not open
thesaurus file "/usr/pgsql-9.4/share/tsearch_data/cmm_thesaurus.ths": No
such file or directory
Command was: CREATE TEXT SEARCH DICTIONARY "cmm_thesaurus" (
TEMPLATE = "pg_catalog"."thesaurus",
dictfile = 'cmm_thesaurus', dic...
postgres(at)dc0ppgc2n1:PRODUCTION:~> cp
/usr/pgsql-9.{3,4}/share/tsearch_data/cmm_thesaurus.ths
cp: cannot create regular file
‘/usr/pgsql-9.4/share/tsearch_data/cmm_thesaurus.ths’: Permission denied
postgres(at)dc0ppgc2n1:PRODUCTION:~> exit
exit
root(at)dc0ppgc2n1:PRODUCTION:cestel> ls -lsa
/usr/pgsql-9.4/share/tsearch_data/cmm_thesaurus.ths
ls: cannot access /usr/pgsql-9.4/share/tsearch_data/cmm_thesaurus.ths: No
such file or directory
root(at)dc0ppgc2n1:PRODUCTION:cestel> ls -lsa
/usr/pgsql-9.3/share/tsearch_data/cmm_thesaurus.ths
4 -rw-r--r-- 1 root root 1998 Mar 10 17:13
/usr/pgsql-9.3/share/tsearch_data/cmm_thesaurus.ths
root(at)dc0ppgc2n1:PRODUCTION:cestel> cp
/usr/pgsql-9.{3,4}/share/tsearch_data/cmm_thesaurus.ths
root(at)dc0ppgc2n1:PRODUCTION:cestel> rm -rf /var/lib/pgsql/9.4/data/*
root(at)dc0ppgc2n1:PRODUCTION:cestel> /usr/pgsql-9.4/bin/postgresql94-setup
initdb
Initializing database ... OK

root(at)dc0ppgc2n1:PRODUCTION:cestel> su postgres
postgres(at)dc0ppgc2n1:PRODUCTION:cestel> cd
postgres(at)dc0ppgc2n1:PRODUCTION:~> /usr/pgsql-9.4/bin/pg_upgrade -b
/usr/pgsql-9.3/bin -B /usr/pgsql-9.4/bin -d /var/lib/pgsql/9.3/data -D
/var/lib/pgsql/9.4/data
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is a superuser ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for invalid "line" user columns ok
Creating dump of global objects ok
Creating dump of database schemas
ok
Checking for presence of required libraries ok
Checking database user is a superuser ok
Checking for prepared transactions ok

If pg_upgrade fails after this point, you must re-initdb the
new cluster before continuing.

Performing Upgrade
------------------
Analyzing all rows in the new cluster ok
Freezing all rows on the new cluster ok
Deleting files from new pg_clog ok
Copying old pg_clog to new server ok
Setting next transaction ID and epoch for new cluster ok
Deleting files from new pg_multixact/offsets ok
Copying old pg_multixact/offsets to new server ok
Deleting files from new pg_multixact/members ok
Copying old pg_multixact/members to new server ok
Setting next multixact ID and offset for new cluster ok
Resetting WAL archives ok
Setting frozenxid and minmxid counters in new cluster ok
Restoring global objects in the new cluster ok
Adding support functions to new cluster ok
Restoring database schemas in the new cluster
ok
Creating newly-required TOAST tables ok
Removing support functions from new cluster ok
Copying user relation files
ok
Setting next OID for new cluster ok
Sync data directory to disk ok
Creating script to analyze new cluster ok
Creating script to delete old cluster ok

Upgrade Complete
----------------
Optimizer statistics are not transferred by pg_upgrade so,
once you start the new server, consider running:
analyze_new_cluster.sh

Running this script will delete the old cluster's data files:
delete_old_cluster.sh

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2015-04-13 21:08:01 Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)
Previous Message Alejandro Sánchez Medina 2015-04-13 13:41:40 Re: BUG #13034: Inconsistent attrelid field in pg_attribute table after adding columns to table.