View Issue Details

IDProjectCategoryView StatusLast Update
15829Bug reports[All Projects] _ Unknownpublic2020-02-11 10:49
ReporterCarmIT Assigned To 
PriorityurgentSeverityblock 
Status newResolutionopen 
Product Version4.1.0 
Target VersionFixed in Version 
Summary15829: Upgrade from 3.21 to 4.1 - upgrade Database error (MSSQL)
Description

Hello Support Team,

after an update from v3.21 to 4.1, no connection to the SQL server could be established. The following error message is displayed:

An non-recoverable error happened during the update. Error details:
CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Explicit value must be specified for identity column in table 'question_themes' either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column.
File C:\inetpub\wwwroot\limesurvey\application\helpers\update\updatedb_helper.php, line 2960.

Steps To Reproduce

Click on "Start database upgrade" after which the error message was displayed

TagsNo tags attached.
Complete LimeSurvey version number (& build)4.1.0
I will donate to the project if issue is resolvedNo
Browserall
Database & DB-VersionMSSQL
Server OS (if known)MSSQL 2008 Server
Webserver software & version (if known)IISv10
PHP Version7.3

Relationships

related to 15841 new Incorrect dataset / identity insert property in SQL upgrade script on MSSQL DB engine for db object question_themes 

Activities

ollehar

ollehar

2020-02-06 14:00

administrator   ~55790

We need someone to test this on MSSQL.

msvojsik

msvojsik

2020-02-11 01:22

reporter   ~55848

I just found this bugreport, pls check my own duplicate bugreport for proposed solution:
https://bugs.limesurvey.org/view.php?id=15841

msvojsik

msvojsik

2020-02-11 01:26

reporter   ~55849

For reference, the suggested solution copypasted

either

  1. modify the updatedb_helper.php script to check the data in collection $baseQuestionThemeEntries & ensure this collection contains the primary key values as well (values for field 'id')

or

  1. DO NOT use the MSSQL identity insert directive (line 2958 of the updatedb_helper) and let the DB engine add the primary key values on it's own.

Explanation:
You can NOT use the identity insert & ommit the values for primary key field/s at the same time.

ollehar

ollehar

2020-02-11 10:49

administrator   ~55852

We need someone to test this on MSSQL.

There's a docker image with MSSQL on that can be used for testing on Linux machines: https://hub.docker.com/_/microsoft-mssql-server

Issue History

Date Modified Username Field Change
2020-02-06 12:07 CarmIT New Issue
2020-02-06 13:59 ollehar Summary Upgrade from 3.21 to 4.1 - upgrade Database error => Upgrade from 3.21 to 4.1 - upgrade Database error (MSSQL)
2020-02-06 14:00 ollehar Note Added: 55790
2020-02-06 14:15 ollehar Priority none => urgent
2020-02-11 01:22 msvojsik Note Added: 55848
2020-02-11 01:26 msvojsik Note Added: 55849
2020-02-11 10:49 ollehar Relationship added related to 15841
2020-02-11 10:49 ollehar Note Added: 55852