Satellite 5.6 upgrade: postgresql migration failed with LOB value truncated during schema dump

Solution Verified - Updated -

Environment

  • upgrading to Red Hat Satellite 5.6 from previous version

Issue

  • During upgrade from Red Hat Satellite 5.5 to Red Hat Satellite 5.6, database migration failed during schema dump:
DBD::Oracle::st fetchrow_arrayref failed: ERROR fetching field 3 of 8. LOB value truncated from 20645007 to 20000000. DBI attribute LongReadLen too small and/or LongTruncOk not set [for Statement "select * from rhnserveractionscriptresult"] at /usr/bin/spacewalk-dump-schema line 427.
  • Oracle Large Object (LOB) exceeded 20MB

Resolution

  • Open the file /usr/bin/spacewalk-dump-schema in a text editor (e.g., vi or emacs)
  • Change the value LongReadLen => 20_000_000, to a value that is higher than the value reported in error (20645007 in the given example). For example:
        LongReadLen => 21_000_000,
  • Clear the postgresql data:
# service postgresql stop
# rm -rf /var/lib/pgsql/data
# service postgresql initdb
# service postgresql start
  • Re-run the Satellite upgrade:
# ./install.pl --upgrade

Root Cause

  • a LOB (large object datatype) value in the Oracle database exceeded the 20MB default value specified in the spacewalk-dump-schema script

Diagnostic Steps

  • monitor the following logs during migration:
/var/lib/pgsql/pgstartup.log
/var/lib/pgsql/data/pg_log/*
  • monitor standard output from the Satellite upgrade script

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments