Welcome, Guest
Username: Password: Remember me

TOPIC: .lss file import fails, can't know why

.lss file import fails, can't know why 11 months 11 hours ago #100297

  • BitterLime
  • BitterLime's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
My colleagues prepared a survey in Excel that I converted using Java and Apache POI to a .lss file. When I try to upload/import this .lss file, the XML parsing is OK, but then all I get is "Error: Failed to insert data [1]". I could not know why/what/how caused the problem.
On one hand, there seems to be no logging; or at least it was impossible to enable, 'debug'=>2, 'debugsql'=>1 in config.php seems to have no effect. I found no LimeSurvey specific log file and the generic log files (e.g. apache logs) have no related entries. I also tried to enable file and web logging in Yii, with all possible documented settings, also without success.
On the other hand, a single error message on the otherwise blank screen suggests that the file import function is not thoroughly developed; kinda ignored. I understand this is probably not a main/frequently used functionality, but I needed exactly this.
So, questions:
1) Is there any documentation on the .lss format? DTD, XMLSchema? Any info on content, especially on IDs of surveys/groups/questions?
2) How to enable logging? Ideas that _actually_ work?
Thanks.
The administrator has disabled public write access.

.lss file import fails, can't know why 10 months 4 weeks ago #100314

  • BitterLime
  • BitterLime's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Please, see the test .lss file attached. It is the same as the one i tried to import, except text elements (titles and answers) have been changed to dummy text. If is a well-formed XML (tested with XMLSpy and accepted by simplexml_load_file()) using proper UTF-8 encoding. The problem seems to be with internal survey/group/question IDs but could not figure out what exactly. In first case there is a simple message that "Failed to insert data [1]" on an otherwise empty page (instead of this there should be a proper LimeSurvey page with explanation of error) or a reference to an SQL error (that turned out to be a primary key violation while inserting into lime_surveys_languagesettings)
I needed to modify the php code to be able to extract this info as I could not make logging work.
Attachments:
The administrator has disabled public write access.

.lss file import fails, can't know why 10 months 4 weeks ago #100315

  • c_schmitz
  • c_schmitz's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 755
  • Thank you received: 104
  • Karma: 88
I get the following message after trying to import your file and having debug activated:
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3-en' for key 'PRIMARY'. The SQL statement executed was: INSERT INTO `lime_surveys_languagesettings` (`surveyls_dateformat`, `surveyls_numberformat`, `surveyls_survey_id`, `surveyls_language`, `surveyls_title`, `surveyls_description`, `surveyls_welcometext`, `surveyls_endtext`, `surveyls_url`, `surveyls_urldescription`, `surveyls_email_invite_subj`, `surveyls_email_invite`, `surveyls_email_remind_subj`, `surveyls_email_remind`, `surveyls_email_register_subj`, `surveyls_email_register`, `surveyls_email_confirm_subj`, `surveyls_email_confirm`, `surveyls_attributecaptions`, `email_admin_notification_subj`, `email_admin_notification`, `email_admin_responses_subj`, `email_admin_responses`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9, :yp10, :yp11, :yp12, :yp13, :yp14, :yp15, :yp16, :yp17, :yp18, :yp19, :yp20, :yp21, :yp22)


When I look into your file I can see that there are at least two language settings for English using also the same ID (which is the source of the problem). This does not look like a file being created only by LimeSurvey. Did you modify it manually?
Support us, too. Donate to the LimeSurvey project and help keep us going!
The administrator has disabled public write access.

.lss file import fails, can't know why 10 months 4 weeks ago #100333

  • BitterLime
  • BitterLime's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
The file was generated from Excel using Java and Apache POI.
I have 4 survey language settings entries in this file with surveyls_survey_id=0,1,2,3
The administrator has disabled public write access.

.lss file import fails, can't know why 10 months 4 weeks ago #100412

  • BitterLime
  • BitterLime's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
The problem was that only one survey is allowed in a .lss file and I generated 4 or 5 surveys into a single file. Since there is no DTD or XML Schema definition for .lss file, based on the file structure I thought that - using distinct IDs consistently - I can generate all survey structures into a single .lss file.
When I separated the surveys into individual files, I could import them one by one.
Except that first I numbered the surveys starting with 0 (zero) (Oppa-Java-Style) the import of the 0th survey failed. Starting the numbering with 1 solved the problem.
On the other hand, it seems to be impossible to configure LimeSurvey and/or Yii to generate any output. I tried everything and the opposite; nothing helped. I hope I will not have much issues during operation as it will be impossible to find out what went wrong.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.110 seconds
Donation Image