CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1095--0-0' for key 'PRIMARY'. The SQL statement executed was: INSERT INTO `lime_defaultvalues` (`qid`, `defaultvalue`, `scale_id`, `sqid`, `language`, `specialtype`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5)

/mnt/data/shnoulle/nginx/www/develop/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

#2
+
 /mnt/data/shnoulle/nginx/www/develop/application/helpers/admin/import_helper.php(1805): CActiveRecord->save()
1800             }
1801             
1802             // now translate any links
1803             $defaultValue = new DefaultValue();
1804             $defaultValue->setAttributes($insertdata, false);
1805             if (!$defaultValue->save()) {
1806                 safeDie(gT("Error").": Failed to insert data[9]<br />");
1807             }
1808             $results['defaultvalues']++;
1809             
1810         }
#3
+
 /mnt/data/shnoulle/nginx/www/develop/application/helpers/admin/import_helper.php(1060): XMLImportSurvey("/mnt/data/shnoulle/nginx/www/develop/tmp/j9gj8hxrq77x95yfczvyk5w...", "<?xml version="1.0" encoding="UTF-8"?> <document> <LimeSurveyDo...", null, null, ...)
1055     } else {
1056         $sExtension = "";
1057     }
1058     switch ($sExtension) {
1059         case 'lss':
1060             $aImportResults = XMLImportSurvey($sFullFilePath, null, $sNewSurveyName, $DestSurveyID, $bTranslateLinksFields);
1061             if (!empty($aImportResults['newsid'])) {
1062                 TemplateConfiguration::checkAndcreateSurveyConfig($aImportResults['newsid']);
1063             }
1064             return $aImportResults;
1065         case 'txt':
#4
+
 /mnt/data/shnoulle/nginx/www/develop/application/controllers/admin/surveyadmin.php(1146): importSurveyFile("/mnt/data/shnoulle/nginx/www/develop/tmp/j9gj8hxrq77x95yfczvyk5w...", true)
1141 
1142             // Now, we have the survey : start importing
1143             Yii::app()->loadHelper('admin/import');
1144 
1145             if ($action == 'importsurvey' && !$aData['bFailed']) {
1146                 $aImportResults = importSurveyFile($sFullFilepath, (Yii::app()->request->getPost('translinksfields') == '1'));
1147                 if (is_null($aImportResults)) {
1148                     $aImportResults = array(
1149                         'error'=>gT("Unknown error while reading the file, no survey created.")
1150                     );
1151                 }
2019-03-01 12:38:50 nginx/1.14.1 Yii Framework/1.1.20