Forums

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

How to set different directory for attachments

Mirko
Contributor
December 28, 2019

Hello, I want to redirect attachments to a different directory to omit storage and securtity issues in the docker container I run Jira from.

I created a symbolic link as described here 

But if I create an attachtment in Jira I get an error, that writing was not possible. I set the access rights to the jira user with full read/write permissions via chown and chmod.

Any Idea what goes wrong here?

2 answers

0 votes
John Funk
Community Champion
December 30, 2019

Hi Mirko - We actually use a marketplace add-on called Cloud Files. Very reasonably priced and we store our documents in an AWS S3 bucket - also at a low cost. 

Mirko
Contributor
December 31, 2019

Hey John,

thanks for the hint, I'll look into that!

John Funk
Community Champion
December 31, 2019

Since you figured it out - can you click on the Accept answer button above to close this one out?  Thanks!

0 votes
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 28, 2019

Hi @Mirko 

Did you try copying a test file to that location using your Jira user?

Can you check in the Jira log file for a detailed error?

Ravi

Mirko
Contributor
December 29, 2019

Hi Ravi,

if I try to change from root to jira in the atlassian docker container with

sudo -i -u jira

I get:

bash: sudo: command not found

the directory properties look like this

lrwxrwxrwx 1 jira jira 22 Dec 29 12:13 attachments -> /JiraData/attachments/

 

If I try to store an attachment in Jira I get this error

Could not save attachment to storage: Unable to create target directory /var/atlassian/application-data/jira/data/attachments/MYT/10000/MYT-1


Mirko

Ismael Jimoh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 29, 2019

Most likely meaning you do not have sudo installed in the container. Here is a good explanation https://stackoverflow.com/questions/51734540/bash-sudo-command-not-found#51734578

As to using symbolic link for attachments, well that’s not something I can recommend and doubt Atlassian would as well , so This is unexplored and not recommended territory for me.

 

The one option I see here is exposing your home directory to standard operating system. Meaning you can access it from your terminal without docker exec command. I have seen this done on test instances and they may be what you are looking for but I am no expert with docker.

Hope the suggestion helps.

Mirko
Contributor
December 29, 2019

Hey Ismael,

maby I'm on the wrong track. I just want to backup my Project and attachments in case of a server failure. But I didn't find any practical solution yet. My instance is running on my home server and I have a NAS that would be availiable for backups but with which program? Jira does not seem to be very user friendly concerning backups.

Any advice?

Thx!

Mirko
Contributor
December 31, 2019

Ok, I figured out the issue.

When mapping a folder into docker it gets mounted like

drwxr-xr-x 1 root root

Here the jira user cannot enter subfolders even if those have the correct properties.

I open access to all users like so

drwxrwxrwx 1 root root

know Jira is able to export Backups and attachments into this link.

Basic issue but I wanted to post this, with only basic cmd knowledge I guess it could be an issue for somebody else

Suggest an answer

Log in or Sign up to answer