Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't I read the attachments once I shifted them to a new folder through symlink

Sahish March 10, 2022

Hello People,

I have created a symlink for attachments folder then onwards I am not able to read the images, Excel docs which are presented in the existing issues. It showing that Oops you have found a dead link. Why is it happening? and Is there any other way to read the docs, if yes may I know how?

 

Thanks in advance,

Sahish

 

1 answer

0 votes
Rilwan Ahmed
Community Champion
March 10, 2022

Hi @Sahish ,

1. After the symlink, does the url look same as it is configured in attachments section of the admin system menu ? i.e <baseUrl>/secure/admin/ViewAttachmentSettings.jspa (Administration setings -> System -> attachmnets)

2.Adjust the owner, group, and required permissions to allow the user used to start Jira to access the location.

See full steps mentioned in https://confluence.atlassian.com/jirakb/change-the-attachments-directory-location-for-jira-server-237569020.html 

3. Manually reindex jira (Administration setings -> System -> Indexing)

Sahish March 10, 2022

Hi @Rilwan Ahmed ,

1. After the symlink, still I can see the Attachment path as "Default Directory [/data/jira/data/attachments]" in the system settings.

2. I followed the same steps which have shown in the above document, But still I cannot access.

3. I have done the reindexing when I encountered that issue.

Thanks

Rilwan Ahmed
Community Champion
March 10, 2022

Hi @Sahish 

Restart jira once. 

  • Shut down JIRA
  • Delete the following hidden plugin cache directories:
    JIRA_HOME/plugins/.bundled-plugins
    JIRA_HOME/plugins/.osgi-plugins
  • Restart JIRA (These directories will be recreated on JIRA reboot with new plugin cache)

    If the issue still exists, do the following steps.
  1. In the backend server, please check do you have data in /data/jira/data/attachments folder ?
    i.e. run the command(linux) and share the screenshot of first few lines
     ls-ltr /data/jira/data/attachments/

  2. Confirm if same user from step 1 is used to run jira (you can use ps -ef | grep -i jira and see first column to know the user)

  3. check if there are any other attachment folder in /data/jira/data/

  4. Check healthCheck to see if any errors reported there (Admin settings --> System --> Troubleshooting and support tools --> Instance Health)

  5. If still the link is dead, access the attachment link and let me know what is written in logs. 
Sahish March 10, 2022

Hi @Rilwan Ahmed ,

I have done the Stop and Restart activities but still the problem exists.

I have followed the mentioned steps:

1. I don't have any data. I can see Zero.Attachments.PNG

2. Yes, only one user is used to run jira

3.  Attachments-1.PNG

4. Instance Health Check result as follows:

Instance Health Check.PNG

5. The screenshots when ever I try to access the images/Excel files:

results.PNG

Rilwan Ahmed
Community Champion
March 11, 2022

Hi @Sahish 

As per point 1, there are no attachments in the path/data/jira/data/attachments. Hence you are not able to see the attachments. This could be because your symlink was not created proeprly. 

I would request you to recreate the symlink again or take help from Linux admins for this. 
Restart jira and if required reindex again after symlink is created. 

Sahish March 13, 2022

Hi @Rilwan Ahmed 

As per point 1, there are no attachments in the path/data/jira/data/attachments. Hence you are not able to see the attachments. - This means even after sym link it should display the data in the attachments folder. ??

But in the Point 1 Picture, below it is showing the sym link right? that means the data will be stored in link where I have created .

Is it like that or my understanding is wrong?

Waiting for clear picture and clarity.

Thanks,

Sahish

Rilwan Ahmed
Community Champion
March 14, 2022

Hi @Sahish ,

If there was symlink to attchments folder, then we you do  ls-ltr /data/jira/data/, Attachments folder will be listed  with "l" in the permissions column and it looks like attached image.

image.png

I would suggest please take help from Linux admins for this. 

Sahish March 14, 2022

Hi @Rilwan Ahmed 

Yeah sure. Thanks for your support.

Rilwan Ahmed
Community Champion
March 14, 2022

Please accept the answer if it resolved your issue

Sahish March 18, 2022

Hi @Rilwan Ahmed ,

But one doubt, I have unlinked the sym link and re created once again.

but still in the attachments I can not see sym link. In the attachment folder only I can see the sym link. May I knoiw why.? I have followed the Change the attachments directory location for Jira server | Jira | Atlassian Documentation

I have executed this command.

sudo ln -s /data/backups/AttachmentsFromHomeDir /data/jira/data/attachments

sym link.PNG

Rilwan Ahmed
Community Champion
March 20, 2022

@Sahish 
Link should be created to /data/jira/data/attachments  from /data/backup/AttachmentsFromHomeDir

image.png

Sahish March 21, 2022

@Rilwan Ahmed 

Yeah, I have followed the workaround Jira 5.2 and above which is mentioned in the above article.

I created the symlink as you mentioned in the above.

I had executed the following command as mentioned in the atlassian doc.

sudo ln -s /data/backups/AttachmentsFromHomeDir /data/jira/data/attachments.

Could you please tell me am I doing any thing wrong in the command?

Thanks,

Rilwan Ahmed
Community Champion
March 21, 2022

Hi @Sahish ,

Unfortunately I cannot help you more in this matter. As I informed earlier, I would request you to take help from Linux admins for this. i.e to create sym link from and to the required folders. 

Restart jira and if required reindex again after symlink is created

Suggest an answer

Log in or Sign up to answer