View Issue Details

This issue affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
19385Bug reportsComfortUpdatepublic2026-11-01 19:16
Reportercavo789 Assigned Toc_schmitz  
PrioritynoneSeverityblock 
Status resolvedResolutionfixed 
Product Version6.4.x 
Summary19385: UpdateDB via console fail without showing the issue
Description

Hi all

See my post https://forums.limesurvey.org/forum/installation-a-update-issues/145651-php-application-commands-console-php-updatedb-fails

sudo php -d memory_limit=-1 application/commands/console.php updatedb
Update mysql:host=xxxxx;port=xxxxx;dbname=xxxxxxxxx; with prefix :xxxxxx from 359 to 612
CException: Please fix this error in your database and try again in /var/www/html/limesurvey_r_o/application/commands/UpdateDbCommand.php:50
Stack trace:
#0 /var/www/html/limesurvey_r_o/vendor/yiisoft/yii/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run()
#1 /var/www/html/limesurvey_r_o/vendor/yiisoft/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#2 /var/www/html/limesurvey_r_o/vendor/yiisoft/yii/framework/base/CApplication.php(185): CConsoleApplication->processRequest()
#3 /var/www/html/limesurvey_r_o/application/commands/console.php(77): CApplication->run()

In short: I've five running LS v3.x instances on our servers. I've succeed to upgrade from v3.x to v6.2.4 for four instances but not for the last one; the biggest one.

I've made a mysqldump, got a 340MB .sql file and copy that file to a new server (self-hosted) where I've LS v6.2.4.

I then run sudo php -d memory_limit=-1 application/commands/console.php updatedb like I did before but here, for the big DB, it didn't work and every time the updatedb script crash.

There is perhaps something with the db but I can't share it.

I've successfully dump it and import it in my new MySQL server (using mysql CLI statements).

The crash concern the sudo php -d memory_limit=-1 application/commands/console.php updatedb CLI but, of course, can't make the upgrade using the LimeSurvey web interface since I got timeouts.

Steps To Reproduce

Dump a working LS v3.x instance,
Got a 340 MB .sql file
Import it on my MySQL server; using mysql CLI commands
Go to my Apache server, jump in my LimeSurvey folder
Run sudo php -d memory_limit=-1 application/commands/console.php updatedb
And it crash.

(The same thing for my four first instances was OK, just my last instance, bigger in size, crash)

Additional Information

Steps to reproduce

Didn't know here

Expected result

When DB issue happen : have the DB error.

Actual result

When DB issue happen : No DB error

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)6.2.4+230825
I will donate to the project if issue is resolvedNo
BrowserEdge
Database type & versionMySQL8.0.32
Server OS (if known)Red Hat Enterprise Linux 8.9
Webserver software & version (if known)Apache
PHP Version8.1.27
Git branch / Pull Request URL

Users monitoring this issue

DenisChenu

Activities

cavo789

cavo789

2024-01-31 14:47

reporter   ~79365

For info, connecting to the database using mysql -A xxxx then show tables; tells me I've 13,324 tables in that DB.

DenisChenu

DenisChenu

2024-01-31 15:22

developer   ~79370

can't make the upgrade using the LimeSurvey web interface since I got timeouts.

This is another issue here : can you try again ?
What it's your time out ?

cavo789

cavo789

2024-02-01 10:58

reporter   ~79384

Thanks to Denis Chenu, the root cause has been identified. So, for me, the issue is solved but the "bug" is well there.

I've posted the solution I've used here : https://forums.limesurvey.org/forum/installation-a-update-issues/145651-php-application-commands-console-php-updatedb-fails#255297

The main problem is thus that update script like https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/update/updates/Update_419.php#L9 is creating a table that is already present in my database.

I had multiple issues during my updatedb execution and for each of them, I had to identify which tables were mentionned in the /updates/update/Update_999 script then go to my MySQL console and drop the table (all tables were empty).

I've no idea why these tables were already present. The database comes from a LimeSurvey v3; version 359.

As a fix, perhaps add a "If table didn't exists then create it" in the multiple updates; if not already done in LS since I'm using LS 6.2.4 right now.

Many thanks and bip up Denis.

cavo789

cavo789

2024-02-01 11:01

reporter   ~79385

Concerning your point here above Denis: it's just a web timeout. Running a so long script in a web page ends with a timeout. That's why I need to run updatedb using CLI.
(I just follow this page https://manual.limesurvey.org/Upgrading_from_a_previous_version#Upgrading_using_CLI)

DenisChenu

DenisChenu

2024-02-01 11:59

developer   ~79387

Concerning your point here above Denis: it's just a web timeout. Running a so long script in a web page ends with a timeout. That's why I need to run updatedb using CLI.

Yes, but we optimize a lot some part, the big part are 400 update, but with 1000 sureys it take less than 2 minutes on my computer.
Just want to know the timeout happen after 2 minutes (the n: yes hard to optimize) or after 10 minutes or more ?

PS : sometime : i do my update in 2 times : 3 to 5 and 5 to 6.

cavo789

cavo789

2024-02-01 12:27

reporter   ~79388

Using CLI upgrade, it already takes minutes before a crash. This is why I don't use web interface anymore. As said earlier, I've more than 13,000 tables in that db.

c_schmitz

c_schmitz

2026-11-01 19:16

administrator   ~87078

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

Related Changesets

LimeSurvey: master c9e613ec

2026-11-01 19:16

c_schmitz


Details Diff
Fixed issue 19385: The updatedb console command did not show why the update was refused and wrongly asked to restore a database backup
Dev db_upgrade_all() now returns the reason for an early refusal (DB version < 132, unsupported DB server, update lock, incomplete previous update) in a new by-ref parameter; UpdateDbCommand shows it instead of the generic "restore your backup" message
Affected Issues
19385
mod - application/commands/UpdateDbCommand.php Diff File
mod - application/helpers/update/updatedb_helper.php Diff File

Issue History

Date Modified Username Field Change
2024-01-31 14:43 cavo789 New Issue
2024-01-31 14:47 cavo789 Note Added: 79365
2024-01-31 14:47 cavo789 Bug heat 0 => 2
2024-01-31 15:20 DenisChenu Summary Php Application/Commands/Console.Php Updatedb Fails => UpdateDB via console fail without showing the issue
2024-01-31 15:20 DenisChenu Additional Information Updated
2024-01-31 15:22 DenisChenu Note Added: 79370
2024-01-31 15:22 DenisChenu Bug heat 2 => 4
2024-02-01 10:58 cavo789 Note Added: 79384
2024-02-01 11:01 cavo789 Note Added: 79385
2024-02-01 11:59 DenisChenu Note Added: 79387
2024-02-01 12:27 cavo789 Note Added: 79388
2026-09-01 15:24 DenisChenu Issue Monitored: DenisChenu
2026-09-01 15:24 DenisChenu Bug heat 4 => 6
2026-09-15 17:36 c_schmitz Assigned To => p_teichmann
2026-09-15 17:36 c_schmitz Status new => assigned
2026-11-01 19:16 c_schmitz Changeset attached => LimeSurvey master c9e613ec
2026-11-01 19:16 c_schmitz Note Added: 87078
2026-11-01 19:16 c_schmitz Assigned To p_teichmann => c_schmitz
2026-11-01 19:16 c_schmitz Status assigned => resolved
2026-11-01 19:16 c_schmitz Resolution open => fixed
2026-11-01 19:16 c_schmitz Bug heat 6 => 8