View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
06137 | Bug reports | Import/Export | public | 2012-05-27 11:15 | 2012-06-20 14:09 |
Reporter | Assigned To | ||||
Priority | normal | Severity | block | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.00RC2 | ||||
Fixed in Version | 2.00RC2 | ||||
Summary | 06137: Import Excel survey structure leads to database crash | ||||
Description | When importing a survey with Import Excel survey structure, I get this error: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '900-en' for key 'PRIMARY'. The SQL statement executed was: INSERT INTO | ||||
Steps To Reproduce |
| ||||
Additional Information | I pulled the latest Yii branch this morning, cleared the database and ran the installer. In other words, this is a completely clean installation. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 4 | ||||
Complete LimeSurvey version number (& build) | 9999 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Any | ||||
Database type & version | mysql 5.5.22 | ||||
Server OS (if known) | Linux | ||||
Webserver software & version (if known) | Apache 2.0 | ||||
PHP Version | Version 5.3.10-1ubuntu3.1 | ||||
Please attach the survey |
|
Please also check the "Show Logic File" (http://docs.limesurvey.org/Show+Logic+File) for your survey. If there are any question names (column 2) shown in red with a pink line around them, then you have errors in your survey that will prevent re-import without first fixing them. The easiest way to do so is to export the survey to Excel (that will work fine). Then, you need to change the problem question names so that you have unique, valid variable names for the import to work. Otherwise, you will get the duplicate key violations you describe. |
|
File uploaded. Sorry, I thought I did it the first time. You are exactly correct in your suggestion about red with pink borders. This is indeed the case, but I missed that when I looked at the file, since the text at the top says "No syntax errors detected in this survey." Three suggestions, then:
|
|
The file you uploaded imports fine. Although all of the question names have warnings, none of them is duplicated. That is the true root cause - if you re-use the same question code for multiple questions, you will get the import error. You should, but are not required, to also ensure that the question names are all valid. Yes, more graceful error messages would be helpful, rather than calling "safe_die". Moreover, if the file partially loads but doesn't succeed, the whole survey should be deleted so that you don't have dangling partial surveys. |
|
Yes, the file I uploaded is the valid lss file, not the excel survey structure file. To replicate: import the lss, export to survey structure, import survey structure. I am now working through the Excel file to try and get it to a point where I can import. I have already renamed all the questions to Q1, Q2, etc. Still no luck. I am in the #limesurvey-team IRC channel at the moment, if you want to continue the discussion there. |
|
Andrie - thanks for taking a stab at these. |
|
Committed partial fix. Added:
|
|
LimeSurvey: Yii 4e48eded 2012-05-30 07:30
Details Diff |
Fixed issue 06137: Import Excel survey structure leads to database crash <Dev> Added try/catch mechanism for Answers::model()->insertRecords() and Questions::model()->insertRecords() <Dev> Added descriptive error messages |
Affected Issues 06137 |
|
mod - application/controllers/admin/surveyadmin.php | Diff File | ||
mod - application/helpers/admin/import_helper.php | Diff File | ||
mod - application/models/Answers.php | Diff File | ||
mod - application/models/Questions.php | Diff File | ||
mod - application/views/admin/survey/importSurvey_view.php | Diff File | ||
LimeSurvey: Yii 4de3339f 2012-05-30 09:41
Committer: Details Diff |
Fixed issue 06137: Import Excel survey structure leads to database crash <Dev> Delete temporary survey when errors are found |
Affected Issues 06137 |
|
mod - application/helpers/admin/import_helper.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-05-27 11:15 |
|
New Issue | |
2012-05-27 11:15 |
|
Status | new => assigned |
2012-05-27 11:15 |
|
Assigned To | => TMSWhite |
2012-05-27 11:17 |
|
Additional Information Updated | |
2012-05-27 13:21 | TMSWhite | Note Added: 18917 | |
2012-05-27 15:20 | TMSWhite | Note Added: 18919 | |
2012-05-27 17:02 |
|
File Added: limesurvey_survey_96553 2011-06-02.lss | |
2012-05-27 17:12 |
|
Note Added: 18924 | |
2012-05-27 17:20 | TMSWhite | Note Added: 18925 | |
2012-05-27 17:30 |
|
Note Added: 18926 | |
2012-05-27 20:39 | TMSWhite | Assigned To | TMSWhite => user9189 |
2012-05-27 20:39 | TMSWhite | Note Added: 18928 | |
2012-05-30 14:31 |
|
Note Added: 18998 | |
2012-05-30 14:33 |
|
Status | assigned => resolved |
2012-05-30 14:33 |
|
Fixed in Version | => 2.00RC2 |
2012-05-30 14:33 |
|
Resolution | open => fixed |
2012-05-31 17:05 | TMSWhite | Changeset attached | => LimeSurvey Yii 4de3339f |
2012-05-31 17:05 | TMSWhite | Changeset attached | => LimeSurvey Yii 4e48eded |
2012-06-20 14:09 | c_schmitz | Status | resolved => closed |