Importing attachments via CSV file fails with exception

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

  

Summary


Attempting to import attachments via CSV results in error "An exception occurred dealing with attachment." 

Cause

This is caused by the URLs in the CSV export from the source system pointing to secure resources. So when the target system runs a CSV import and tries to load the attachments via HTTP, it is redirected to the login page. The CSV importer follows the redirect and grabs the HTML content payload, and saves the attachment file with correct name, but with contents being HTML payload of the login page. Therefore, in order to make this work, we need to make that project accessible in a way that it doesn't require a login. 

Solution

We can do this by modifying the project permissions to give anonymous access to the source project so that a login isn't required. You can do this by: 

  1. Go to the source project, and click Project Settings > Permissions.
  2. Click Actions > Edit Permissions.
  3. Click Edit next to Browse Projects 
  4. Click the Group radio button, and then select Anyone on the web
  5. Click Grant

You should then be able to import as expected using the original method you were attempting.

(warning)You'll want to go back and remove that permission once the import is complete to avoid any security issues.


Last modified on May 8, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.