From 047ddde8ba3b51c2f4c6094c2a6020618278d183 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 17 Oct 2022 17:34:32 +0200 Subject: [PATCH] fix: [nextcloud] try to patch onlyoffice when other error messages are caught It seems that ``SQLSTATE`` is not displayed on all version of nextcloud. Some version use other error messages. Signed-off-by: Valentin Lab --- nextcloud/actions/upgrade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nextcloud/actions/upgrade b/nextcloud/actions/upgrade index 84133e9..fce3011 100755 --- a/nextcloud/actions/upgrade +++ b/nextcloud/actions/upgrade @@ -219,8 +219,9 @@ for image_version in "${upgrade_path[@]}"; do ## XXXvlab: this comes from and should move to onlyoffice charm in ## some way. - if grep "Update app onlyoffice" "$MIGRATION_TMPDIR/migration.log" >/dev/null 2>&1 && - grep "SQLSTATE" "$MIGRATION_TMPDIR/migration.log" >/dev/null 2>&1; then + if grep "Update app onlyoffice" "$MIGRATION_TMPDIR/migration.log" >/dev/null 2>&1 && ( + grep "SQLSTATE" "$MIGRATION_TMPDIR/migration.log" >/dev/null 2>&1 || + grep "^Database error when running migration latest for app onlyoffice" "$MIGRATION_TMPDIR/migration.log" >/dev/null 2>&1 ); then if [ -e "$DATASTORE"/"$SERVICE_NAME/var/www/html/custom_apps/onlyoffice/lib/Migration/Version070400Date20220607111111.php" ]; then patch="$CHARM_PATH/../onlyoffice/src/patch/00-onlyoffice-nextcloud.patch"