Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-6539

"Snap! You can't view this page" error after migrating from Cloud to Server

      Issue description

      After migrating Jira from Cloud to Server, Service Desk project administrators might get the "Snap! You can't view this page" error when trying to access any Service Desk specific setting (Request Type, SLA, Automation...).

      Diagnosis Steps

      To verify if you are impacted by this bug, check if you can find the following error in the file atlassian-servicedesk.log:

      2019-07-24 16:53:55,569 JIRA-EventThread-10 ERROR removed XXXXXXX xxxxx XXX.XXX.XX.XXX /plugins/servlet/applications/versions-licenses/add-licenses/jira-servicedesk/evaluation [bootstrap.lifecycle.server.ServerPluginLifeCycle] org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:CustomFieldValue][parentkey,null][customfield,11104][issue,134138][textvalue,{"timeline":{"events":[{"date":1562687139307,"types":["START"]},{"date":1562710975499,"types":["STOP"]}]},"ongoingSLAData":null,"completeSLAData":[{"succeeded":true,"goalTime":28800000,"elapsedTime":22975499,"calendarName":"Sample 9-5 Calendar","startTime":1562687139307,"stopTime":1562710975499}],"metricId":12,"definitionChangeDate":null,"definitionChangeMsEpoch":0,"goalsChangeDate":null,"goalsChangeMsEpoch":null,"goalTimeUpdatedDate":null,"goalTimeUpdatedMsEpoch":null,"metricCreatedDate":null}][id,2292400][updated,1563987235564] (SQL Exception while executing the following:INSERT INTO public.customfieldvalue (ID, ISSUE, CUSTOMFIELD, UPDATED, PARENTKEY, STRINGVALUE, NUMBERVALUE, TEXTVALUE, DATEVALUE, VALUETYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "pk_customfieldvalue"
        Detail: Key (id)=(2292400) already exists.))
      com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:CustomFieldValue][parentkey,null][customfield,11104][issue,134138][textvalue,{"timeline":{"events":[{"date":1562687139307,"types":["START"]},{"date":1562710975499,"types":["STOP"]}]},"ongoingSLAData":null,"completeSLAData":[{"succeeded":true,"goalTime":28800000,"elapsedTime":22975499,"calendarName":"Sample 9-5 Calendar","startTime":1562687139307,"stopTime":1562710975499}],"metricId":12,"definitionChangeDate":null,"definitionChangeMsEpoch":0,"goalsChangeDate":null,"goalsChangeMsEpoch":null,"goalTimeUpdatedDate":null,"goalTimeUpdatedMsEpoch":null,"metricCreatedDate":null}][id,2292400][updated,1563987235564] (SQL Exception while executing the following:INSERT INTO public.customfieldvalue (ID, ISSUE, CUSTOMFIELD, UPDATED, PARENTKEY, STRINGVALUE, NUMBERVALUE, TEXTVALUE, DATEVALUE, VALUETYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint "pk_customfieldvalue"
      

      Root cause

      The root cause is unknown at this moment, as we have been unable to reproduce this issue on Atlassian side. For this reason, it is not guarantee that any customer migrating from Cloud to Server will run into this bug.

      Note that a similar bug was reported in the past in https://jira.atlassian.com/browse/JSDSERVER-6538 when customers were migrating from Cloud to Server. However, that bug was fixed in JSD 3.2.6, therefore this seems to be a new unrelated bug.

      Workaround

      The error in the logs is addressed in the KB article Cannot insert duplicate key in object when adding content to a JIRA application, therefore the resolution steps are the same, except for the affected table which is different.

      We have adjusted the steps below for this specific bug.

      First, let's confirm that the workaround applies to your situation by following the steps below:

      1. Connect to the Jira database
      2. Check the max ID value from the customfieldvalue by running the following query (query 1):
        select max(ID) from "customfieldvalue"
      3. Check the actual sequence from the sequence_value_item table for the Custom Field Value by running the following query (query 2):
        select * from "sequence_value_item" where seq_name = 'CustomFieldValue';
      4. Verify that the max ID from the customfieldvalue table is higher than the value from the sequence_value_item in your database (although in a normal situation, it should be lower). If that's the case, then the workaround below applies to you

      Workaround steps:

      1. Stop Jira
      2. Backup your Jira database, so that you can revert back the changes if anything goes wrong
      3. Connect to the Jira database
      4. Update the sequence_value_item table by running the following query (query 3) and replacing xxxxx with the value from the results of query 1 + 1 (for example, if the result from query 1 was 1000, update xxxxx using 1001):
        update "sequence_value_item" set seq_id = xxxxx where seq_name = 'CustomFieldValue';
      5. Start Jira
      6. Access a Service Desk project configuration page, and check if you are still facing the same issue

            [JSDSERVER-6539] "Snap! You can't view this page" error after migrating from Cloud to Server

            Closing this issue as there is a proven workaround, and it has not been observed with recent versions of JSM.

            Christopher Bowles added a comment - Closing this issue as there is a proven workaround, and it has not been observed with recent versions of JSM.

            I had the same issue with Cloud to DC migration (JSW 8.20.10 + JSM 4.20.10 running with Postgres 10). I'm glad that workaround fixed the problem. Thanks.

            Cengiz Akyildiz added a comment - I had the same issue with Cloud to DC migration (JSW 8.20.10 + JSM 4.20.10 running with Postgres 10). I'm glad that workaround fixed the problem. Thanks.

            I followed the workaround steps above and they have worked successfully.

            Vyacheslav Torkunov added a comment - I followed the workaround steps above and they have worked successfully.

            That's damn to meet with that during restoring server from cloud

            Gonchik Tsymzhitov added a comment - That's damn to meet with that during restoring server from cloud

            I have had a Jira Cloud backup imported to a temporary Jira DC instance and encountered this issue. The instance is running 8.16.1 Jira and 4.16.1 JSM.

            I followed the workaround steps above and they have worked successfully.

            Would appreciate if a proper fix can be applied for the future should this ever happen again.

            Thanks

            James Beagrie added a comment - I have had a Jira Cloud backup imported to a temporary Jira DC instance and encountered this issue. The instance is running 8.16.1 Jira and 4.16.1 JSM. I followed the workaround steps above and they have worked successfully. Would appreciate if a proper fix can be applied for the future should this ever happen again. Thanks

            Sylvain Leduc added a comment - - edited

            Hi !
            This issue happened to me after importing a XML backup from Jira Cloud to a Jira server 8.9.0 + PostgresSQL 9.6 (on premise instance).

            Everything worked ok "except" creating/updating issues : I could add/update comment or update status but not create a new ticket or update custom fields.

            I did the workaround and it fixed it 

            Thanks !

            Sylvain Leduc added a comment - - edited Hi ! This issue happened to me after importing a XML backup from Jira Cloud to a Jira server 8.9.0 + PostgresSQL 9.6 (on premise instance). Everything worked ok "except" creating/updating issues : I could add/update comment or update status but not create a new ticket or update custom fields. I did the workaround and it fixed it  Thanks !

            The issue happened when migrated from cloud to Jira 8.7.1 on Ubuntu and Postgres 11.

            Will try the workaround.

            Elad Ben-Noam added a comment - The issue happened when migrated from cloud to Jira 8.7.1 on Ubuntu and Postgres 11. Will try the workaround.

              Unassigned Unassigned
              jrey Julien Rey
              Affected customers:
              24 This affects my team
              Watchers:
              28 Start watching this issue

                Created:
                Updated:
                Resolved: