Confluence: All attachments are available but they are corrupted:
Asked by ODED Transformational Technologies:

Dear Team,  

I have self-hosted Confluence which was crashed, so I have restored it on a new server which all the backup files. After the restoration, I could see all the space and other info but when I try to open an attachment it downloads but prompts that it's corrupted.   

The version :   
Atlassian Confluence 6.4.2  

Please advise


Answers:
author: Shannon S
body: Hello,

Could you let us know the following?

1. What is the full error message you're seeing, and can you please send a screenshot of it?
2. What browser(s) are you able to replicate this on, and what version are you using?
3. Which files did you migrate to the new server? Did you include the home directory?
4. Could you review [how to resolve missing attachments in Confluence](https://confluence.atlassian.com/confkb/how-to-resolve-missing-attachments-in-confluence-201761.html) and see if that helps you to get your attachments back?

Regards,

Shannon

comments: author: ODED Transformational Technologies
body: Dear [@Shannon S](/t5/user/viewprofilepage/user-id/510046)

Thank you for the reply,

1. I have attached the screenshot.

2. Atlassian Confluence 6.4.2

3. I restored the entire backup of the confluence and while restoring I have included attachment folders as well

4. I could see all the attachments(not missing), but they are not opening,

![1.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/39494i590BE76126926063/image-size/large?v=v2&px=999 "1.JPG")![2.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/39495iDDD178A9EE960AEA/image-size/large?v=v2&px=999 "2.JPG")

Please let me know if you need more info

Thanks in advance.


author: Shannon S
body: Are these only Office documents? What happens if you try to open an attachment that is an image or a PDF?

Which browsers are you able to replicate this with? Does the problem occur on multiple computers for other users?

Regards,

Shannon


author: ODED Transformational Technologies
body: Dear Shannon,

Thank you for the reply

This particular issue occurs with multiple users and on multiple computers and different browsers

Please let me know if you need more information.!!

Many Thanks

comments: author: Shannon S
body: Hi there,

I'm still interested to know the answers to my previous questions from before:

1. Which browsers and versions are you replicating this in. You can provide the names of the applications, such as Chrome, Firefox, IE, etc. and the current version you are using. I understand that it happens in different browsers but I want to understand which ones so I can properly test.
2. Let me know if it occurs for ALL attachments (that's including PDF, etc.) or does this only occur for Office documents (such as Excel, Word, Powerpoint, etc.)
3. When you refer to *multiple users* is that all users, or only certain users?
4. When you refer to *multiple computers* does that include Windows PCs, MacOS, Linux?

Thank you!

Shannon


author: ODED Transformational Technologies
body: Hello Shannon,  

Please find my responses below  

1. We use Firefox 63.0.3, Chrome 17.0.3578.80, Safari 12.0.2.  
2. Yes all the attachments when opened shows as corrupted. ( PDF, Excel, Word, Powerpoint)

3. All users have the same problem.  
4. Across all platforms.  


author: Shannon S
body: Thank you for confirming.

I'm assuming the PDF file gets a different error since you're not using Microsoft Word to open it? Is it possible for you to share that error with me? Unfortunately the information you provided isn't really giving me enough to work with.

It does appear that you have not done the migration exactly as we recommend, so my suggestion is to perform the migration again, following our recommendation exactly.

First, please create a new Confluence installation with a clean database. Can you confirm with me the version of the old and the new database?

Following that, go through this article step-by-step to perform the migration:

* [Migrating Confluence Between Servers](https://confluence.atlassian.com/doc/migrating-confluence-between-servers-184150.html)

> To transfer Confluence to another server you will copy the home and install folders straight into an identical external database and user management setup. If your new server is using a different operating system there may be some additional changes at step 4.
>
> 1. Run the Confluence installer on your new server
> 2. Shut down Confluence on both your old and new servers
> 3. If you're using Oracle or MySQL, copy [the drivers](https://confluence.atlassian.com/doc/database-jdbc-drivers-171742.html) from your old server to the new one
> 4. Delete the contents of the home directory on your new Confluence server, then copy in the contents of the home directory from your old Confluence server.
>
> 5. Make any additional changes required for your environment.  
>
>    [If you're changing the location of the home directory...](https://confluence.atlassian.com/doc/migrating-confluence-between-servers-184150.html#)  
>    [If you're moving your database...](https://confluence.atlassian.com/doc/migrating-confluence-between-servers-184150.html#)  
>    [If your new server has a different operating system...](https://confluence.atlassian.com/doc/migrating-confluence-between-servers-184150.html#)  
> 6. Copy the `<confluence-install>/conf/server.xml` file from your old server to the same location on your new server
>
> 7. If you use a data source, ensure the data source points to the new database. See [Configuring a datasource connection](https://confluence.atlassian.com/doc/configuring-a-datasource-connection-937166084.html).
> 8. Start Confluence, then head to **General configuration** \> **License Details** to add your license key
>
> We strongly recommend you perform a [rebuild of your content indices](https://confluence.atlassian.com/display/CONFKB/How+to+rebuild+the+content+indexes+from+scratch) after performing a migration, to ensure Confluence search works as expected.

If you run into any issues, please let me know!

Regards,

Shannon


author: ODED Transformational Technologies
body: Dear [@Shannon S](/t5/user/viewprofilepage/user-id/510046),

Thank you for the reply. I have replicated Confluence using the above method while moving to a different server.

Kindly let me know what details you need so that I can share in detail.

in case if you need any log files or support files, let me know

Thank you


author: ODED Transformational Technologies
body: Dear [@Shannon S](/t5/user/viewprofilepage/user-id/510046)

Kindly advise me the next step. If needed i can send the Support zip to get more details

Looking to hear from you

Many Thanks


author: Shannon S
body: Hello,

Unfortunately the support log won't help, because the problem doesn't lie within Confluence itself. The error is being triggered my MS Office, and cannot be troubleshooted within Confluence.

I had asked you previously what error you get when you try to open a PDF file, but I don't see that you responded on that. Could you confirm?

The problem here is that there's a high chance that the attachments became corrupt even before your new Confluence instance touched them.

Can you please test with the attachments macro or Word macro and see if you're able to preview the files directly within Confluence?  

Lastly, I would try this solution from Microsoft:

* [How to resolve the problem "Word experienced an error trying to open the file" when opening a Word 2007/2010 file (Easy Fix Article)](https://support.microsoft.com/en-us/help/2749199/how-to-resolve-the-problem-word-experienced-an-error-trying-to-open-th)

Let me know if you have any trouble.

Shannon


author: ODED Transformational Technologies
body: Dear [@Shannon S](/t5/user/viewprofilepage/user-id/510046)

1.++I had asked you previously what error you get when you try to open a PDF file, but I don't see that you responded on that. Could you confirm?++

Please find the attached screenshot, the error lies within Confluence,

![pdf error.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/41250i98E35832B98434A5/image-dimensions/508x286?v=v2 "pdf error.jpg")

same things happen when I try to open any MS office documents as well.

![word error.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/41251i2118FF662AA6FE2E/image-dimensions/509x286?v=v2 "word error.jpg")

2.The problem here is that there's a high chance that the attachments became corrupt even before your new Confluence instance touched them.

I have restored the working backup of Confluence (All attachments were working)

3.Can you please test with the attachments macro or Word macro and see if you're able to preview the files directly within Confluence?

no.

4.Lastly, I would try this solution from Microsoft:

* [How to resolve the problem "Word experienced an error trying to open the file" when opening a Word 2007/2010 file (Easy Fix Article)](https://support.microsoft.com/en-us/help/2749199/how-to-resolve-the-problem-word-experienced-an-error-trying-to-open-th)

Above fix is not working as we are using Office 365,

Please let me know if you need more info.

Many Thanks


author: Shannon S
body: Thank you for providing the details about the error message you receive within Confluence. This is more helpful and we can use this to troubleshoot.

For #3 - when I asked if you can test, you responded with "No" - can you confirm if you meant no, you cannot test, or yes, you tested, and no it does not work?

What we want to follow now is the error messages that occur in the Confluence logs when you get the error message in the UI:
> Ouch! looks like this document is broken. try downloading the file to view it.

You'll need to tail your [Confluence Server logs](https://confluence.atlassian.com/doc/working-with-confluence-logs-108364721.html) when you generate the above error. Note that the error in Office 365 can't help us as it doesn't write to the Confluence logs.

Please provide us what error messages occur in the Confluence logs when that error shows in the UI. That will tell us what is causing the attachment to fail.

In the case that this does not help, then we will want to raise a support ticket. For that you will want to have a copy of your Support Zip ready, and they will likely ask for a copy of your attachments backup.

Shannon


Tags: confluence-server

server