Issue: QuickSight Asset Bundle Import Fails - "Zip headers not found. Probably not a zip file"

I am attempting to export and import a QuickSight dashboard using the asset bundle API to migrate from us-east-1 to ca-central-1. However, the import consistently fails with the following error:

Error Message

{
“Status”: 200,
“JobStatus”: “FAILED_ROLLBACK_IN_PROGRESS”,
“Errors”: [
{
“Arn”: “arn:aws:quicksight:ca-central-1:323225952044:asset-bundle-import-job/qs-import-dashboard-test”,
“Type”: “com.amazonaws.services.quicksight.model.InvalidParameterException”,
“Message”: “Zip headers not found. Probably not a zip file”
}
],
“AssetBundleImportJobId”: “qs-import-dashboard-test”,
“AwsAccountId”: “323225952044”,
“AssetBundleImportSource”: {
“S3Uri”: “s3://qs-api-prod/qs-dashboard.zip”
},
“FailureAction”: “ROLLBACK”
}

Steps I Took

  1. Exported the Dashboard from QuickSight (us-east-1)

aws quicksight start-asset-bundle-export-job --aws-account-id 323225952044 --region us-east-1
–asset-bundle-export-job-id “qs-export-dashboard”
–resource-arns ‘[“arn:aws:quicksight:us-east-1:323225952044:dashboard/03ad693e-f737-433a-9dbf-5bc7a6c67c87”]’
–export-format CLOUDFORMATION_JSON
–include-all-dependencies

  1. Downloaded the Exported File

curl -o qs-dashboard.zip “PASTE-QUICKSIGHT-DOWNLOAD-URL-HERE”

  1. Checked if the File is a Valid ZIP

file qs-dashboard.zip

4.Output:*

qs-dashboard.zip: JSON data

→ This indicates that the file is not actually a ZIP but a JSON file.

  1. Uploaded the File to S3 (ca-central-1)

aws s3 cp qs-dashboard.zip s3://qs-api-prod/qs-dashboard.zip --region ca-central-1


6.**Started the Import Job in QuickSight (`ca-central-1`)**

aws quicksight start-asset-bundle-import-job --aws-account-id 323225952044 --region ca-central-1 \
    --asset-bundle-import-job-id "qs-import-dashboard" \
    --asset-bundle-import-source '{"S3Uri": "s3://qs-api-prod/qs-dashboard.zip"}'

Import Fails with the Above Error Message

**Probable Questions and Causes**
1.Does QuickSight expect a specific structure inside the ZIP file?
2.Is there an issue with the way the file is exported?
3.Should QuickSight be exporting a ZIP, or do I need to manually create one?
4.Are there any known issues with exporting/importing dashboards that rely on flat file (CSV) datasets?

hi @mudassarshareef1410

Welcome to QuickSight Community. thank you for your inquiry.

I just tested with the following curl commend. the zip file is working when importing the asset.

curl -o qs-dashboard.zip ‘<S3 presigned URL>’

also it is presigned URL allows to access with limited short period of time. so please make sure you are downloading within the period.

kind regards,
Wakana

Hello @Wakana

Thank you getting back to me.

I thought about it but I’m executing the command almost immediately.

Even then it’s failing.

@mudassarshareef1410 ,

I would recommend reading through this blogpost : Choosing between the two export options of the Amazon QuickSight asset deployment APIs [ note the export-format and how to deploy , you have cloudformation_json ]

Kind regards,
Koushik