Attachment rendering errors following migration of Jira server
Symptoms
After Migrating Servers or migrating from JIRA Cloud to JIRA Server, following the step 4. described on Migrating from JIRA Cloud to JIRA Server
The attachments Thumbnail does not render in the Issue View screen:
The following appear in the logs:
2015-01-15 19:58:10,910 http-bio-8080-exec-18 ERROR sysadmin 1198x51x1 xk7j1j 127.0.0.1 /browse/ISSUEKEY-1 [jira.web.component.ModuleWebComponentImpl] An exception occured while rendering the web panel: com.atlassian.jira.jira-view-issue-plugin:attachmentmodule (null)
java.lang.IllegalStateException: java.io.IOException: No such file or directory
at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager.getTempFile(DefaultThumbnailManager.java:125)
at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager.doGetThumbnail(DefaultThumbnailManager.java:328)
at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager.getThumbnail(DefaultThumbnailManager.java:266)
at com.atlassian.jira.issue.thumbnail.DefaultThumbnailManager.getThumbnail(DefaultThumbnailManager.java:256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2015-01-15 19:58:10,950 http-bio-8080-exec-18 WARN sysadmin 1198x51x1 xk7j1j 127.0.0.1 /browse/ANDROID-400 [jira.issue.attachment.FileSystemAttachmentDirectoryAccessor] Unable to make thumbnail directory /data/jirastudio/jira/home/data/attachments/ANDROID/ISSUEKEY-1/thumbs
Diagnosis
Browsing to Administration >> System >> System Info, the path for Cloud attachments is still in the application Paths:
Cause
Cause 1 : During the XML Import, the Attachments path was not restored to the default ones.
Cause 2 : Permissions of the directories are not configured correctly
Resolution
For Cause 1 :
- Try to restore the same Backup again, in a clean database, the application should restore the default paths, or advise that the path must be restored, then you can click to apply the new default path.
- In case the path is still the one used by Cloud instance, even after a second attempt to restore, you will have to change the path Directly in the entities.xml file:
- Unzip the backup.zip
- Open the entities.xml file.
- Search for these three entries of the Cloud path in the XML file:
jira.option.watching : true
jira.option.web.usegzip : false
jira.path.attachments : /data/jirastudio/jira/home/data/attachments
jira.path.attachments.use.default.directory : true
jira.path.index.use.default.directory : true
___ File Paths _____________________________
JIRA Home : /data/jirastudio/jira/home
JIRA Local Home : /data/jirastudio/jira/home
Location of atlassian-jira.log : unknown??
Index Path : /data/jirastudio/jira/home/caches/indexes
Attachment Path : /data/jirastudio/jira/home/data/attachments
<OSPropertyString id="10206" value="private"/>
<OSPropertyString id="10209" value="/data/jirastudio/jira/home/data/attachments"/>
<OSPropertyString id="10223" value="en_US"/>
- Update with the new absolute path of your attachments folder, eg:
jira.option.watching : true
jira.option.web.usegzip : false
jira.path.attachments : /opt/atlassian/jira/home/dataattachments
jira.path.attachments.use.default.directory : true
jira.path.index.use.default.directory : true
___ File Paths _____________________________
JIRA Home : /data/jirastudio/jira/home
JIRA Local Home : /data/jirastudio/jira/home
Location of atlassian-jira.log : unknown??
Index Path : /data/jirastudio/jira/home/caches/indexes
Attachment Path : /opt/atlassian/jira/home/dataattachments
<OSPropertyString id="10206" value="private"/>
<OSPropertyString id="10209" value="/opt/atlassian/jira/home/dataattachments"/>
<OSPropertyString id="10223" value="en_US"/>
- Zip the entities.xml and activeobjects.xml in a single .zip file, and perform the import again.
It is always important to make sure that the user running JIRA has all permissions recursively on JIRA HOME and JIRA Install directories.
For Cause 2:
Stop JIRA.
Fix the permissions for the below directories and all of their subdirectories:
$JIRA_HOME/ $JIRA_INSTALL/
Remove the contents of the following directory:
$JIRA_INSTALL/work
This will be rebuilt when JIRA is restarted.
- Start JIRA.