View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
17085Bug reportsSurvey editingpublic2021-03-08 19:38
Reporterzufolo441 Assigned Toc_schmitz  
PriorityhighSeveritypartial_block 
Status closedResolutionfixed 
Product Version4.4.4 
Fixed in Version4.4.12 
Summary17085: unable to copy a survey from another
Description

when I try to copy a survey to a new one, I obtain the following error:

CDbCommand failed to execute the SQL statement: SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "lime_questions_pkey1"
DETAIL: Key (qid)=(1) already exists.

and subsequent error 500 from url index.php/surveyAdministration/copy

lime_questions_pkey1 is the primary key index, on column qid.
At the end, the survey exists (the insert into lime_surveys works) but it's obviously empty.

I suppose it doesn't change qid value to a new one, trying to reinsert it with the same.

Steps To Reproduce

create new survey -> copy.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)4.4.6
I will donate to the project if issue is resolvedNo
Browser
Database type & versionPostgreSQL 11.9
Server OS (if known)BSD 12.2
Webserver software & version (if known)
PHP Version7.1.33

Users monitoring this issue

There are no users monitoring this issue.

Activities

zufolo441

zufolo441

2021-02-11 17:17

reporter   ~62181

update: I had to manually alter lime_groups_gid_seq1 and lime_questions_qid_seq1 sequences in DB in order to make it work.

c_schmitz

c_schmitz

2021-02-15 15:17

administrator   ~62254

I am unable to reproduce this. How would altering the sequence resolve this issue? If so, how exactly did you alter the sequence/index?
Does this happen with every survey or just this one? If only just this one can you please provide the survey as .lss file? thank you.

zufolo441

zufolo441

2021-02-15 15:56

reporter   ~62256

the problem is PGSQL related: despite the presence of records in lime_questions, the value of sequence was still 1.

c_schmitz

c_schmitz

2021-02-16 09:56

administrator   ~62273

I tested on PGSQL and had no problems.

Was this instance updated from LS3 or did you start using it with LS4 only?

zufolo441

zufolo441

2021-02-16 10:45

reporter   ~62276

Upgraded from 3.25

c_schmitz

c_schmitz

2021-03-01 12:05

administrator   ~62570

Did you maybe in the course of this upgrade backup the database and restored it under a different name and then used the copy?

zufolo441

zufolo441

2021-03-01 16:54

reporter   ~62585

hi, no, it was the same... I solved by manually editing sequences.

c_schmitz

c_schmitz

2021-03-01 17:30

administrator   ~62589

I am able to reproduce this.

c_schmitz

c_schmitz

2021-03-01 18:13

administrator   ~62591

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=31243

zufolo441

zufolo441

2021-03-02 08:40

reporter   ~62597

thanks a lot!

Related Changesets

LimeSurvey: master 49cb539c

2021-03-01 18:12:59

c_schmitz

Details Diff
Fixed issue 17085: Unable to copy a survey when updated from 3.x using Postgres Affected Issues
17085
mod - application/config/version.php Diff File
mod - application/helpers/update/updatedb_helper.php Diff File

Issue History

Date Modified Username Field Change
2021-02-11 16:46 zufolo441 New Issue
2021-02-11 17:17 zufolo441 Note Added: 62181
2021-02-11 19:21 ollehar Severity minor => partial_block
2021-02-11 21:11 cdorin Priority none => high
2021-02-11 21:11 cdorin Status new => confirmed
2021-02-11 21:11 cdorin Sync to Zoho Project => |Yes|
2021-02-15 12:04 c_schmitz Sync to Zoho Project Yes =>
2021-02-15 12:04 c_schmitz Sync to Zoho Project => |Yes|
2021-02-15 12:09 c_schmitz Sync to Zoho Project Yes => |Yes|
2021-02-15 15:17 c_schmitz Assigned To => c_schmitz
2021-02-15 15:17 c_schmitz Status confirmed => feedback
2021-02-15 15:17 c_schmitz Note Added: 62254
2021-02-15 15:56 zufolo441 Note Added: 62256
2021-02-15 15:56 zufolo441 Status feedback => assigned
2021-02-16 09:56 c_schmitz Note Added: 62273
2021-02-16 09:56 c_schmitz Status assigned => feedback
2021-02-16 10:45 zufolo441 Note Added: 62276
2021-02-16 10:45 zufolo441 Status feedback => assigned
2021-03-01 12:05 c_schmitz Status assigned => feedback
2021-03-01 12:05 c_schmitz Note Added: 62570
2021-03-01 16:54 zufolo441 Note Added: 62585
2021-03-01 16:54 zufolo441 Status feedback => assigned
2021-03-01 17:30 c_schmitz Note Added: 62589
2021-03-01 18:13 c_schmitz Status assigned => resolved
2021-03-01 18:13 c_schmitz Resolution open => fixed
2021-03-01 18:13 c_schmitz Changeset attached => LimeSurvey master 49cb539c
2021-03-01 18:13 c_schmitz Note Added: 62591
2021-03-02 08:40 zufolo441 Note Added: 62597
2021-03-08 19:31 c_schmitz Fixed in Version => 4.4.12
2021-03-08 19:38 c_schmitz Status resolved => closed