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

When migrating from Cloud to Server, the Request Type icons are different and cause a lot of errors

    XMLWordPrintable

Details

    Description

      Issue Summary
      • When migrating from Cloud to Server, the Request Type icons are different and cause a lot of errors
      Steps to Reproduce
      1. Install Service Desk in Cloud
      2. Create one or more Service Desk projects.
      3. Create an XML Backup for Server
      4. Restore the XML Backup on JIRA Server.
      5. Go to the SD projects and see the Queues or the Request Types.
      Expected Behavior
      • The icons for the request types are shown correctly.
      Actual Behavior
      • There are several broken icons:
      • Each broken icon throws a logging error, flooding the log files pretty quickly with a File not found error:
        2018-01-26 14:00:41,130 http-nio-8080-exec-22 ERROR      [c.a.j.web.servlet.InternalServerErrorServlet] {errorId=a375e86d-abab-4188-aa71-b262a5ddd0d2, interpretedMsg=, cause=java.io.IOException: File not found, stacktrace=java.io.IOException: File not found
                at com.atlassian.jira.avatar.AvatarManagerImpl.getAvatarInputStream(AvatarManagerImpl.java:388) [classes/:?]
                at com.atlassian.jira.avatar.AvatarManagerImpl.lambda$processAvatarData$0(AvatarManagerImpl.java:367) [classes/:?]
      Cause
      • There are system Request Type icons in Cloud that don't exist in Server (select * from avatar where avatartype = 'SD_REQTYPE') Difference Request types Cloud vs server.xlsx. When an XML backup is generated, the references to the icons and the issues that use them are include in the data. There are about double the icons in Cloud than in Server. Even though the missing icons are considered 'avatars', the request type icons are not included in the 'avatars' directory, possibly because the files are actually inside the jira-servicedesk-xx.yy.zz.jar file (at least on Server side), in the directory img/request-type-icons (you can find them extracting the content of the jar file with a compression tool), so when generating the Export file from Cloud, the avatars/icons for the request types are not include din the 'avatars' directory.
      Workaround
      • Use this SQL query to determine if any request types are using the incorrect icons:
        SELECT p.pkey AS ProjectKey, p.pname AS ProjectName, vpf."NAME" AS RequestName, a.filename as RequestTypeIcon
        FROM "AO_54307E_VIEWPORTFORM" vpf
        JOIN "AO_54307E_VIEWPORT" vp ON vpf."VIEWPORT_ID" = vp."ID"JOIN project p ON vp."PROJECT_ID" = p.id
        JOIN avatar a ON vpf."ICON_ID" = a.id
        WHERE vpf."ICON_ID" IN (
                SELECT id
                FROM avatar
                WHERE avatartype = 'SD_REQTYPE'
                AND systemavatar = 1
                AND filename LIKE '%-v1.svg'
        );
        
      • If this query returns zero rows, that means the Icons from cloud are not in use. You can remove those queries with the following:
        DELETE FROM avatar
        WHERE avatartype = 'SD_REQTYPE'
        AND systemavatar = 1
        AND filename LIKE '%-v1.svg'
        
      • After running the query above, you will need to manually insert new icons to the Request Type for it to work again.

      As always, ensure Jira has been shut down and that you have a full database backup before making changes to the database.

      Attachments

        1. Request types Cloud vs server.xlsx
          22 kB
        2. screenshot-1.png
          screenshot-1.png
          81 kB
        3. screenshot-2.png
          screenshot-2.png
          152 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rchiquete Rene C. [Atlassian Cloud Support]
              Votes:
              37 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated:

                Backbone Issue Sync