Welcome, Guest
Username: Password: Remember me

TOPIC: 'Error: Failed to insert data' on copy new survey

'Error: Failed to insert data' on copy new survey 3 years 10 months ago #51092

I am trying to copy a survey and get the following errors. The answers not being copied all appear to be of type "List (radio)".

I have copied this survey successfully before. The changes I made to it since the last successful copy are:

1 - moved a few questions from one group to another
2 - deleted the empty groups after moving questions.
3 - deleted a few answers from an array type question.

Any solution for this?

Error: Failed to insert data
INSERT INTO lime_questions ( SID, GID, TYPE, TITLE, QUESTION, PREG, HELP, OTHER, MANDATORY, QUESTION_ORDER, LANGUAGE, PARENT_QID, SCALE_ID, SAME_DEFAULT ) VALUES ( 59352, null, 'T', 'SQ001', 'Facebook', '', '', 'N', '', 1, 'en', 1489, 0, 0 )
Column 'gid' cannot be null
The administrator has disabled public write access.

Re:'Error: Failed to insert data' on copy new survey 3 years 10 months ago #51095

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2640
  • Thank you received: 313
  • Karma: 115
Without being an expert, I think either your action 1 or 2 have caused the problem. Seems like there is a question that has an empty "gid", which I assume is the group id.

Let's see what the experts come up with.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Last Edit: 3 years 10 months ago by holch.
The administrator has disabled public write access.

Re:'Error: Failed to insert data' on copy new survey 3 years 10 months ago #51098

Running data integrity it would appear that these questions are the culprit:

The following questions should be deleted:
QID `687` because `No matching group (47)`
QID `688` because `No matching group (47)`
QID `689` because `No matching group (47)`
QID `690` because `No matching group (47)`
QID `691` because `No matching group (47)`
QID `692` because `No matching group (47)`
QID `694` because `No matching group (47)`
QID `695` because `No matching group (47)`
QID `696` because `No matching group (47)`
QID `697` because `No matching group (47)`
QID `698` because `No matching group (47)`
QID `702` because `No matching group (48)`
QID `703` because `No matching group (48)`
QID `704` because `No matching group (48)`


These are all good sub-questions that I did not delete. I did however move the main question for each of those sub-questions to a different group. It would appear the sub-question GID wasn't updated properly and left these sub-questions hanging.

Running these two queries has fixed the problem. I am assuming this is a bug in lime survey?
update lime_questions set gid=46 where gid=48;
update lime_questions set gid=46 where gid=47;
The administrator has disabled public write access.

Re:'Error: Failed to insert data' on copy new survey 3 years 10 months ago #51099

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2640
  • Thank you received: 313
  • Karma: 115
Well, if you only did what you described, then I'd say this is a bug.

Would you please file a bug report and post the link here so we can follow the development?

Please be as specific as possible and add screenshots / files where you think they could help.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.215 seconds
Donation Image