Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENT-10710: Fixed issue with using pg_upgrade on ubuntu-16 hub installer upgrade #1306

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ci/package-sha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ echo "NOVA_SHA: ${NOVA_SHA}" >&2
MASTERFILES_SHA=$(git -C "${NTECH_ROOT}/masterfiles" log --pretty='format:%h' -1 -- .)
echo "MASTERFILES_SHA: ${MASTERFILES_SHA}" >&2
# notice below the sha is more complex, a todo is to make "code only" shas for each repo ENT-10443
MISSION_PORTAL_SHA=$(find "${NTECH_ROOT}/mission-portal" -type f -and \( -path "./application/*" -or -path "./public/*" -or -path "./phpcfenginenova/*" -or -path "./ldap/*" -or -path "./composer.json" -or -path "./package.json" -or -path "./static/*" \) -print0 | xargs -0 sha1sum | awk '{print $1}' | sha1sum | cut -c -8)
MISSION_PORTAL_SHA=$(find "${NTECH_ROOT}/mission-portal" -type f -and \( -path "*/mission-portal/application/*" -or -path "*/mission-portal/public/*" -or -path "*/mission-portal/phpcfenginenova/*" -or -path "*/mission-portal/ldap/*" -or -path "*/mission-portal/composer.json" -or -path "*/mission-portal/package.json" -or -path "*/mission-portal/static/*" \) -print0 | xargs -0 sha1sum | awk '{print $1}' | sha1sum | cut -c -8)
echo "MISSION_PORTAL_SHA: ${MISSION_PORTAL_SHA}" >&2
BUILDSCRIPTS_SHA=$(find "${NTECH_ROOT}/buildscripts" -type f -and \( -path "./deps-packaging/*" -or -path "./build-scripts/*" -or -path "./packaging/*" \) -print0 | xargs -0 sha1sum | awk '{print $1}' | sha1sum | cut -c -8)
BUILDSCRIPTS_SHA=$(find "${NTECH_ROOT}/buildscripts" -type f -and \( -path "*/deps-packaging/*"-or -path "*/build-scripts/*" -or -path "*/packaging/*" \) -print0 | xargs -0 sha1sum | awk '{print $1}' | sha1sum | cut -c -8)
echo "BUILDSCRIPTS_SHA: ${BUILDSCRIPTS_SHA}" >&2

PACKAGE_SHA=$(echo "$CORE_SHA" "$ENTERPRISE_SHA" "$NOVA_SHA" "$MASTERFILES_SHA" "$MISSION_PORTAL_SHA" "$BUILDSCRIPTS_SHA" | sha256sum | cut -d' ' -f1 | cut -c -8)
Expand Down
14 changes: 9 additions & 5 deletions packaging/common/cfengine-hub/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,15 @@ do_migration() {
exit 0 # exits only from (...)
fi
cf_console echo "Migration using pg_upgrade failed."
# here pg_upgrade probably said something like
# Consult the last few lines of "/var/cfengine/state/pg/data/pg_upgrade_output.d/20230913T150025.959/log/pg_upgrade_server.log" for the probable cause of the failure.
cf_console echo "Showing last lines of any related log files:"
_daysearch=$(date +%Y%m%d)
find "$PREFIX"/state/pg/data/pg_upgrade_output.d -name *.log | grep "$_daysearch" | cf_console xargs tail
# skip ubuntu-16 since there is an expected failure there
# check for "/var/cfengine/state/pg/backup/bin/postgres" failed: cannot execute
if [ "$BUILT_ON_OS" != "ubuntu" ] && [ "$BUILT_ON_OS_VERSION" != "16" ]; then
# here pg_upgrade probably said something like
# Consult the last few lines of "/var/cfengine/state/pg/data/pg_upgrade_output.d/20230913T150025.959/log/pg_upgrade_server.log" for the probable cause of the failure.
cf_console echo "Showing last lines of any related log files:"
_daysearch=$(date +%Y%m%d)
find "$PREFIX"/state/pg/data/pg_upgrade_output.d -name *.log | grep "$_daysearch" | cf_console xargs tail
fi
cf_console echo
check_disk_space # will abort if low on disk space
init_postgres_dir "$new_pgconfig_file" "$pgconfig_type"
Expand Down
Loading