View Issue Details

This issue affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
20664Bug reportsDatabase designpublic2026-09-04 06:17
Reporterlavamind Assigned Toc_schmitz  
PrioritynoneSeveritycrash 
Status closedResolutionfixed 
Summary20664: Unable to update 7.0.7 PostgreSQL database
Description

We're currently trying to upgrade our LimeSurvey 7.0.7 installation to 7.0.12 notably because of major issues with active surveys failing to record responses (20640).

The updatedb command is not working, it's failing with:

Update pgsql:host=localhost;port=5432;user=limesurvey;password=g07pqsKEVx1NWg4VaaH2uz8dqgZCta;dbname=limesurvey; with prefix :lime_ from 709 to 711
CException: Please fix this error in your database and try again in /srv/www/survey.torproject.org/7.0.12+260833/limesurvey/application/commands/UpdateDbCommand.php:51
Stack trace:
#0 /srv/www/survey.torproject.org/7.0.12+260833/limesurvey/vendor/yiisoft/yii/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run()
#1 /srv/www/survey.torproject.org/7.0.12+260833/limesurvey/vendor/yiisoft/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#2 /srv/www/survey.torproject.org/7.0.12+260833/limesurvey/vendor/yiisoft/yii/framework/base/CApplication.php(185): CConsoleApplication->processRequest()
#3 /srv/www/survey.torproject.org/7.0.12+260833/limesurvey/application/commands/console.php(77): CApplication->run()

It's unclear what's wrong, because the error message doesn't give much detail about what's going on, but it seems like the only database upgrade step that's supposed to be running is fixPostgresqlSequence to the issue is likely in there.

TagsNo tags attached.
Bug heat10
Complete LimeSurvey version number (& build)7.0.7+260729
I will donate to the project if issue is resolvedNo
Story point estimate0
Browser
Database type & versionPostgreSQL 17.11
Server OS (if known)
Webserver software & version (if known)
PHP Version8.4.24

Users monitoring this issue

There are no users monitoring this issue.

Activities

lavamind

lavamind

2026-08-31 21:09

reporter   ~85529

In case you're wondering, yes I'm aware I accidentally published our database credentials, and I've regenerated them just now.

c_schmitz

c_schmitz

2026-08-31 22:42

administrator   ~85530

Can you please try again with the attached file? It needs to replace the existing one in /application/helpers/update.

lavamind

lavamind

2026-09-01 04:38

reporter   ~85531

It didn't work. The error message on the console was the same. However using the web-based updater displayed this message:

A non-recoverable error occurred during the database update. Error details:

CDbCommand failed to execute the SQL statement: SQLSTATE[42804]: Datatype mismatch: 7 ERROR: COALESCE types text and integer cannot be matched LINE 1: ...e_conditions_cid_seq', COALESCE(MAX(plugin_type), 1) ) FROM ... ^

File Update_710.php, line 25.
fradeff

fradeff

2026-09-01 10:33

reporter   ~85532

very similar bug with mysql when trying to update 6.17.19 to 7.0.12:

php application/commands/console.php updatedb --verbose
Update mysql:host=localhost;port=3306;dbname=limefaclet; with prefix :lime_ from 708 to 711
CException: Please fix this error in your database and try again in /var/www/outils/limesurveyfac/lettres/application/commands/UpdateDbCommand.php:51
Stack trace:
#0 /var/www/outils/limesurveyfac/lettres/vendor/yiisoft/yii/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run()
#1 /var/www/outils/limesurveyfac/lettres/vendor/yiisoft/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#2 /var/www/outils/limesurveyfac/lettres/vendor/yiisoft/yii/framework/base/CApplication.php(185): CConsoleApplication->processRequest()
#3 /var/www/outils/limesurveyfac/lettres/application/commands/console.php(77): CApplication->run()

more details if required with web-based update

fradeff

fradeff

2026-09-01 11:05

reporter   ~85533

NB: it seems to be linked with our very big instances with a lot of surveys - I do not have this problem on my private limesurvey with few forms

DenisChenu

DenisChenu

2026-09-01 11:05

developer   ~85534

Can you please try again with the attached file? It needs to replace the existing one in /application/helpers/update.

This update add the CDB command error in console ? We don't have an issue for this ?

lavamind

lavamind

2026-09-01 12:51

reporter   ~85537

This update add the CDB command error in console ? We don't have an issue for this ?

This might be : https://bugs.limesurvey.org/view.php?id=19385

fradeff

fradeff

2026-09-01 13:32

reporter   ~85538

thanks Denis but both web-based upgrade and command line bug with the same kind of message;
it maybe linked with some NULL values in the existing result tables, when there are converted in the new MySQL v7 format

c_schmitz

c_schmitz

2026-09-01 14:25

administrator   ~85539

@lavamind
I did another change, please try the attached file, again.

updatedb_helper-2.php (156,839 bytes)
lavamind

lavamind

2026-09-01 18:40

reporter   ~85541

I did another change, please try the attached file, again.

Thanks, the update succeeded with the new helper function.

c_schmitz

c_schmitz

2026-09-01 20:45

administrator   ~85542

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

fradeff

fradeff

2026-09-02 08:31

reporter   ~85544

nice for @lavamind; for my very similar bug (but with MariaDB/MySQL) it didn't change anything (both on web-based upgrade and on command-line upgrade)

one more info: I've tried a fresh v7 install, then tested export (lsa) v6 + import v7 datas from various forms where the global upgrade of the instance wasn't woking, result: it worked without any problem, but we have so many forms that this solution is not possible

@limesurvey team:

  • do you want me to post this bug in a new issue?
  • any more informations required from me?
LimeBot

LimeBot

2026-09-03 11:54

administrator   ~85559

Fixed in Release 7.0.13+260903

fradeff

fradeff

2026-09-04 06:17

reporter   ~85563

thks: this time it worked 99% (only one survey on hundreds bugged during the migration v6 to v7)

Related Changesets

LimeSurvey: master 76237d25

2026-08-31 22:39

c_schmitz


Details Diff
Fixed issue 20664: Unable to update using Postgres Affected Issues
20664
mod - application/helpers/update/updatedb_helper.php Diff File

Issue History

Date Modified Username Field Change
2026-08-31 20:59 lavamind New Issue
2026-08-31 21:09 lavamind Note Added: 85529
2026-08-31 21:09 lavamind Bug heat 0 => 2
2026-08-31 22:42 c_schmitz Note Added: 85530
2026-08-31 22:42 c_schmitz File Added: updatedb_helper.php
2026-08-31 22:42 c_schmitz Bug heat 2 => 4
2026-08-31 22:42 c_schmitz Assigned To => c_schmitz
2026-08-31 22:42 c_schmitz Status new => feedback
2026-09-01 04:38 lavamind Note Added: 85531
2026-09-01 04:38 lavamind Status feedback => assigned
2026-09-01 10:33 fradeff Note Added: 85532
2026-09-01 10:33 fradeff Bug heat 4 => 6
2026-09-01 11:05 fradeff Note Added: 85533
2026-09-01 11:05 DenisChenu Note Added: 85534
2026-09-01 11:05 DenisChenu Bug heat 6 => 8
2026-09-01 12:51 lavamind Note Added: 85537
2026-09-01 13:32 fradeff Note Added: 85538
2026-09-01 14:25 c_schmitz Note Added: 85539
2026-09-01 14:25 c_schmitz File Added: updatedb_helper-2.php
2026-09-01 14:26 c_schmitz File Deleted: updatedb_helper.php
2026-09-01 14:31 c_schmitz Status assigned => feedback
2026-09-01 18:40 lavamind Note Added: 85541
2026-09-01 18:40 lavamind Status feedback => assigned
2026-09-01 20:45 c_schmitz Changeset attached => LimeSurvey master 76237d25
2026-09-01 20:45 c_schmitz Note Added: 85542
2026-09-01 20:45 c_schmitz Status assigned => resolved
2026-09-01 20:45 c_schmitz Resolution open => fixed
2026-09-02 08:31 fradeff Note Added: 85544
2026-09-03 11:54 LimeBot Note Added: 85559
2026-09-03 11:54 LimeBot Status resolved => closed
2026-09-03 11:54 LimeBot Bug heat 8 => 10
2026-09-04 06:17 fradeff Note Added: 85563