Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Database upgrade failing with an error message

  • lintu
  • lintu's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
1 year 3 months ago - 1 year 3 months ago #239200 by lintu
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.4.15
Own server or LimeSurvey hosting: Own Server
Survey theme/template: 
Current database version: 364
Target database version: 495
==================

Hello Everyone,
I have created bug report # 18571 for this issue but also posting here incase someone knows a solution for this. I was attempting to update the database as part of the LimeSurvey upgrade and got the following error:An non-recoverable error happened during the update. Error details:
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'question' in 'field list'Anyone know if there is a fix for this?
Thanks in advacnce.

Debug notes:
CDbException
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'question' in 'field list'. The SQL statement executed was: INSERT INTO lime_question_l10ns (qid, question, help, language) select qid, question, help, language from lime_questions/var/app/current/vendor/yiisoft/yii/framework/db/CDbCommand.php(358)346 {
347 if($this->_connection->enableProfiling)
348 Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute');
349
350 $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
351 $message=$e->getMessage();
352 Yii::log(Yii::t('yii','CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.',
353 array('{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
354
355 if(YII_DEBUG)
356 $message.='. The SQL statement executed was: '.$this->getText().$par;
357
358 throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
359 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
360 }
361 }
362
363 /*
364 Executes the SQL statement and returns query result.
365 This method is for executing an SQL query that returns result set.
366 
@param array $params input parameters (name=>value) for the SQL execution. This is an alternative
367 to {@link bindParam} and {@link bindValue}. If you have multiple input parameters, passing
368 
them in this way can improve the performance. Note that if you pass parameters in this way,
369 you cannot bind parameters or values using {@link bindParam} or {@link bindValue}, and vice versa.
370 
Please also note that all values are treated as strings in this case, if you need them to be handled as
Stack Trace
#0
– /var/app/current/application/helpers/update/updates/Update_400.php(44): CDbCommand->execute()
39 ,
40 true
41 );
42 $this->db->createCommand(
43 "INSERT INTO {{question_l10ns}} (qid, question, help, language) select qid, question, help, language from {{questions}}"
44 )->execute();
45 / questions by rename/insert /
46 if ($this->db->schema->getTable('{{questions_update400}}')) {
47 $this->db->createCommand()->dropTable('{{questions_update400}}');
48 }
49 $this->db->createCommand()->renameTable('{{questions}}', '{{questions_update400}}');
#1
– /var/app/current/application/helpers/update/DatabaseUpdateBase.php(47): LimeSurvey\Helpers\Update\Update_400->up()
42 */
43 public function safeUp()
44 {
45 $transaction = $this->db->beginTransaction();
46 try {
47 $this->up();
48 $this->updateVersion();
49 $transaction->commit();
50 } catch (Throwable $e) {
51 $transaction->rollback();
52 throw $e;
#2
– /var/app/current/application/helpers/update/updatedb_helper.php(88): LimeSurvey\Helpers\Update\DatabaseUpdateBase->safeUp()
83 try {
84 // Get all relevant files from updates/ folder
85 $updates = getRelevantUpdates($iOldDBVersion, Yii::app()->db, $options);
86 foreach ($updates as $update) {
87 // NB: safeUp() wraps up() inside a transaction and also updates DBVersion.
88 $update->safeUp();
89 }
90 } catch (Exception $e) {
91 Yii::app()->setConfig('Updating', false);
92 // Activate schema caching
93 $oDB->schemaCachingDuration = 3600;
Last edit: 1 year 3 months ago by lintu.

Please Log in to join the conversation.

More
6 months 3 weeks ago #250617 by aukevann
Replied by aukevann on topic Database upgrade failing with an error message
Hi, did you find a solution?
I get the same error

Kind regards,
Auke

Please Log in to join the conversation.

  • lintu
  • lintu's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 months 3 weeks ago #250622 by lintu
I ended up manually updating the database tables by looking at the differences in the two versions and completed the LimeSurvey upgrade.
The following user(s) said Thank You: aukevann

Please Log in to join the conversation.

More
6 months 3 weeks ago #250623 by aukevann
Replied by aukevann on topic Database upgrade failing with an error message
Thanks, just found out there was an error in copying the database, now it works.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose