View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
18384Bug reports_ Unknownpublic2022-10-04 11:43
Reporterjr_limesurvery_statconsult_de Assigned Toollehar  
PriorityurgentSeverityblock 
Status closedResolutionfixed 
Product Version5.4.x 
Summary18384: updatedb from limesurvey5.3.32+220817 to limesurvey5.4.3+220926 fails / ERROR: table "lime_failed_email" does not exist
Description

Dear all,

manual upgrade fails when it comes to update the database from 490 to 491:

php limesurvey5.4.3220926/application/commands/console.php updatedb
Update pgsql:host=localhost;port=5432;user=XX;password=XX;dbname=ls5; with prefix :lime
from 490 to 491
CException: Please fix this error in your database and try again in /var/www/X/docs/limesurvey5.4.3_220926/application/commands/UpdateDbCommand.php:50
Stack trace:
#0 /var/www/X/docs/limesurvey5.4.3_220926/third_party/yiisoft/yii/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run(Array)
#1 /var/www/X/docs/limesurvey5.4.3_220926/third_party/yiisoft/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run(Array)
#2 /var/www/X/docs/limesurvey5.4.3_220926/third_party/yiisoft/yii/framework/base/CApplication.php(185): CConsoleApplication->processRequest()
#3 /var/www/X/docs/limesurvey5.4.3_220926/application/commands/console.php(77): CApplication->run()

and postgresql.log comes up with:

2022-09-29 09:24:49.078 CEST [27962] ls5@ls5 ERROR: table "lime_failed_email" does not exist
2022-09-29 09:24:49.078 CEST [27962] ls5@ls5 STATEMENT: DROP TABLE "lime_failed_email"
2022-09-29 09:24:49.079 CEST [27962] ls5@ls5 ERROR: current transaction is aborted, commands ignored until end of transaction block
2022-09-29 09:24:49.079 CEST [27962] ls5@ls5 STATEMENT: CREATE TABLE "lime_failed_emails" (
"id" serial NOT NULL PRIMARY KEY,
"surveyid" integer NOT NULL,
"responseid" integer NOT NULL,
"email_type" character varying (200) NOT NULL,
"recipient" character varying (320) NOT NULL,
"language" character varying (20) NOT NULL DEFAULT 'en',
"error_message" text,
"created" timestamp NOT NULL,
"status" character varying (20) NULL DEFAULT 'SEND FAILED',
"updated" timestamp NULL,
"resend_vars" text NOT NULL
)

Please advise - thankyou!

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)limesurvey 5.4.3 220926
I will donate to the project if issue is resolvedNo
Browser
Database type & versionPostgreSQL / 11.17-0+deb10u1
Server OS (if known)Debian Buster x64
Webserver software & version (if known)
PHP Version7.3.31-1~deb10u1

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2022-09-29 11:33

administrator   ~72012

You need to run the last statement manually: CREATE TABLE "lime_failed_emails" (
"id" serial NOT NULL PRIMARY KEY,
"surveyid" integer NOT NULL,
"responseid" integer NOT NULL,
"email_type" character varying (200) NOT NULL,
"recipient" character varying (320) NOT NULL,
"language" character varying (20) NOT NULL DEFAULT 'en',
"error_message" text,
"created" timestamp NOT NULL,
"status" character varying (20) NULL DEFAULT 'SEND FAILED',
"updated" timestamp NULL,
"resend_vars" text NOT NULL
)

When I wrote the current fix, I didn't know that Postgres aborts the transaction if there's an error.

ollehar

ollehar

2022-09-29 11:58

administrator   ~72014

Needed fix:

try { setTransactionBookmark(); $oDB->createCommand()->dropIndex('questions_idx4','{{questions}}'); } catch(Exception $e) { rollBackToTransactionBookmark();}

ollehar

ollehar

2022-09-29 15:08

administrator   ~72016

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=33921

ollehar

ollehar

2022-09-29 17:48

administrator   ~72022

@jr_limesurvery_statconsult_de Can you test the fixing commit, please? https://github.com/LimeSurvey/LimeSurvey/commit/32aa344f92cee033805f3f788aac2f48a8cfded0

LimeBot

LimeBot

2022-10-04 11:43

administrator   ~72061

Fixed in Release 5.4.4+221004

Related Changesets

LimeSurvey: master 32aa344f

2022-09-29 17:08

ollehar


Details Diff
Fixed issue 18384: Update fails on Postgres Affected Issues
18384
mod - application/helpers/update/updates/Update_491.php Diff File

Issue History

Date Modified Username Field Change
2022-09-29 09:30 jr_limesurvery_statconsult_de New Issue
2022-09-29 11:33 ollehar Note Added: 72012
2022-09-29 11:33 ollehar Bug heat 0 => 2
2022-09-29 11:58 ollehar Note Added: 72014
2022-09-29 14:49 ollehar Priority none => urgent
2022-09-29 15:08 ollehar Changeset attached => LimeSurvey master 32aa344f
2022-09-29 15:08 ollehar Note Added: 72016
2022-09-29 15:08 ollehar Assigned To => ollehar
2022-09-29 15:08 ollehar Resolution open => fixed
2022-09-29 17:48 ollehar Note Added: 72022
2022-09-29 17:48 ollehar Status new => feedback
2022-10-04 11:43 LimeBot Note Added: 72061
2022-10-04 11:43 LimeBot Status feedback => closed
2022-10-04 11:43 LimeBot Bug heat 2 => 4