attachments returning a 404 error

Andrew Nisbet October 16, 2012

Good evening,

I am having an issue with attachments all of a sudden yeilding a 404 error when someone tries to download them. Looking at the attachment dirctory most of the issues in question to not a folder created, though the link is present when viewing the issue in the UI. This doesn't appear to be a universal issue, as some of the attachments are working correctly. I did run a retoriation of data earlier today, but these issues had been created prior to the back up being taken, and its my understandng that the automated back up process doesn't have an impact on the attachments. Any one have any ideas?

Thanks

3 answers

1 accepted

0 votes
Answer accepted
Bhushan Nagaraj
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.
October 16, 2012

So there you go Andrew. Your files do not exist in the attachments folder. So when you try to access them you are returned a 404 error.

Did you perform a migration recently? Did you change the location of your jira-home directory? Did you perform a re-install and choose a new location for the jira-home directory?

jira-home directories are not backed up when you backup JIRA using JIRA's xml backup utility. You need to backup your data directories externally.

Refer https://confluence.atlassian.com/display/JIRA/Backing+Up+Data#BackingUpData-2.Backingupthedatadirectory

Hope you do have a backup of your jira-home directory to a point at which you had all the attachments. If you did do a re-install and change the location of your jira-home directory, and you still haven't deleted the old location, you should still be able to copy all the files from the old attachements directory to the new location.

Bhushan Nagaraj
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.
October 16, 2012

Here is another scenario. You restored from a backup which was taken last week. And in the past 5 days users have deleted the attachments which you are now trying to access.

Andrew Nisbet October 16, 2012

Ok, We haven't changed anything in regards to the layout. I did run a restore recently. It seems odd to me that it would create the record for the link but not the actual file location in the home directory.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 16, 2012

I'm not sure why you expect "a restore" to include any attachments - all the documentation I can find is very clear that the xml export does not include the physical attachments.

Andrew Nisbet October 16, 2012

I never said that I had that expectation, I was merely including the fact that a restore for a back up had been run/ The backup was from a few hours earlier in the day, and none of the attachements had been removed by users. We are still beta testing the application, so its not a major loss, just something to pay attention to I guess.

0 votes
Andrew Nisbet October 16, 2012

Hi, Thanks for the response.

Yes, some of them do work, most don't.

looking in /var/atlassian/application-data/jira/data/attachments, I see folders for each of our projects, under that I have folders for the various tickets, most of the tickets with attachements do not have folders here, and I do not see any random file either(sorry , I should have read my earler statement before posting). I do see folders, and files for those issues whose attachements do work.

Thanks again.

0 votes
Bhushan Nagaraj
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.
October 16, 2012

Hi Andrew,

Can you check if the files that are returning a 404 error exist in your jira-home directory? Are you saying some of them actually work and some don't?

Back-up tasks do not backup your attachment folders in your jira-home directory.

Can you please clarify your statement you made

"Looking at the attachment dirctory most of the issues in question to not a folder created, though the link is present when viewing the issue in the UI. "

Suggest an answer

Log in or Sign up to answer