Describing analyis definition - error

Hi there,
I have been trying to create an automated restore analysis process but I am getting constant errors while while running describe-analysis-definition

Firstly I had errors type: COLUMN_NOT_FOUND

After some research I found out that this is related to the fact that some redundant filters based on columns from a previous dataset. ( I replaced the dataset ).

After manually removing the redundant filter definitions I wanted to update the analysis using update-analysis I got another errors related to the calculated fields. I was able to fix most of them but I failed on the error code CONTEXTUAL_INVALID_ARGUMENT_TYPE I wasn’t able to figure out the reason. The calculated field worked ok in the analysis but it was problematic for the update analysis call. I had to remove it!
Now, I am getting another errors.

For datasets:
“Type”: “COLUMN_TYPE_INCOMPATIBLE”,
“Message”: "Required type for column ‘MONTH’ is ‘[DECIMAL]’. Current type is ‘INTEGER’ "

For parameter controls:
“Message”: “Column to match in cascading control is of type ‘INTEGER’. Required type is 'NUMBER”

The analysis in GUI works perfectly fine. No issues.

How to automate and interact programmatically with Quicksight if there are these types on errors?
What can be done to resolve this issues?
Is there another way to create a copy of the analysis and all dependencies within the same account but different region?
Thanks.

1 Like

Hello @ArtSal, I think you will want to utilize analysis templates to migrate rather than the JSON definition. The definition of an analysis can be super error prone even when there are no issues with the analysis in the source account.

If you instead create a template from an analysis, and migrate the data source and datasets with the definitions, then I think you will have more success. One important thing to note though, you will need to make sure you include the PhysicalTable and LogicalTable for the dataset to ensure all of the fields have the correct datatype.

I’ll include some more documentation as well on the process. I think you will find more success with the templates than the analysis JSON. Let me know if you have any further questions!

Many thanks fro your reply @DylanM
I will go through this process and see if it works for me.

Meanwhile I have been trying to use
start_asset_bundle_export_job
and
start_asset_bundle_import_job.
I had to run start_asset_bundle_export_job with ValidationStrategy={'StrictModeForAllResources': False}
as otherwise the job fails.
Interestingly I was able to replicate my analysis with all dependencies. The datasources and datasets seems to be absolutely fine. However I can’t open the analysis. The error message is:

We can’t open that analysis
This usually happens when you don’t have access permission, it’s from another QuickSight account, or it was deleted.

I checked permissions and all looks ok. It is the same account but different region.
I ran describe_analysis and the status is
‘CREATION_SUCCESSFUL’
I noticed though there are no sheets included
‘Sheets’: []
How can I debug the issue? Shouldn’t the zip file contain analysis with sheets?

Hello @ArtSal, I would imagine the issue is how the policy is shared between the 2 different regions in the AWS account. You also will need to make sure the newly created analysis/dashboard is shared with your account in the destination region.

The asset_bundle_export_job api is definitely a better way to manage this than the analysis definition, but it can still be fairly error prone when managing the JSONs directly. It can also be extremely painful to debug, so that is why I always suggest trying to migrate with the analysis templates.

As for the sheets, have you viewed the JSON stored in the zip file to see if the analysis definition contains anything? Maybe it is exporting an empty array for some reason instead of the sheet information.

Hi @DylanM, many thanks for quick reply.

I checked the zip file and the analysis JSON hasn’t got the sheet array at all.

{
	"resourceType": "analysis",
	"analysisId": "38372262-5474-4e4b-a395-d6d6f606d1be",
	"name": "My Analysis",
	"definition": {
		"dataSetIdentifierDeclarations": [
			{
				"identifier": "ROYALTY_DET",
				"dataSetArn": "arn:aws:quicksight:eu-west-1:xxxxxxxxxx:dataset/bc3fcb28-ad12-4362-a642-3872da8fef8b"
			},
			{
				"identifier": "UNMATCHED",
				"dataSetArn": "arn:aws:quicksight:eu-west-1:xxxxxxxxxx:dataset/492a88a0-7a1b-4ad4-b0ce-302bf9d192cf"
			},
			{
				"identifier": "LOOKUP",
				"dataSetArn": "arn:aws:quicksight:eu-west-1:xxxxxxxxxx:dataset/6da6993a-b87a-4bde-be9c-eb7d5d49bdaf"
			},
			{
				"identifier": "TOP WORKS",
				"dataSetArn": "arn:aws:quicksight:eu-west-1:xxxxxxxxxx:dataset/61dfc73a-36d9-41f8-a8ee-44f1d5e71711"
			},
			{
				"identifier": "LOOKUP PROD",
				"dataSetArn": "arn:aws:quicksight:eu-west-1:xxxxxxxxxx:dataset/3d24c29a-1feb-442e-babd-b53e79e67f1e"
			},
			{
				"identifier": "ROYALTY_ALL",
				"dataSetArn": "arn:aws:quicksight:eu-west-1:xxxxxxxxxx:dataset/c31cb40d-37e6-40d4-b4cf-306840e77d70"
			},
			{
				"identifier": "TOP WORKS DIRECT",
				"dataSetArn": "arn:aws:quicksight:eu-west-1:xxxxxxxxxx:dataset/c98c0511-4360-4695-805e-e7b04fff2c9c"
			},
			{
				"identifier": "REVENUE_ALL",
				"dataSetArn": "arn:aws:quicksight:eu-west-1:xxxxxxxxxx:dataset/29ab84a1-9748-41d0-b5a3-d71549c413d3"
			},
			{
				"identifier": "START_SELECTION",
				"dataSetArn": "arn:aws:quicksight:eu-west-1:xxxxxxxxxx:dataset/56800d60-478e-43fd-903a-e3bf1db96095"
			}
		]
	},
	"validationStrategy": {
		"mode": "LENIENT"
	},
	"permissions": [
		{
			"principal": "arn:aws:quicksight:us-east-1:xxxxxxxxxx:user/default/user@xxxxx.com",
			"actions": [
				"quicksight:RestoreAnalysis",
				"quicksight:UpdateAnalysisPermissions",
				"quicksight:DeleteAnalysis",
				"quicksight:DescribeAnalysisPermissions",
				"quicksight:QueryAnalysis",
				"quicksight:DescribeAnalysis",
				"quicksight:UpdateAnalysis"
			]
		}
	]
}

With regard to permissions they are the same. Am I missing something here?

"AnalysisId": "38372262-5474-4e4b-a395-d6d6f606d1be",
"AnalysisArn": "arn:aws:quicksight:eu-central-1:xxxxxxxxxx:analysis/38372262-5474-4e4b-a395-d6d6f606d1be",
"Permissions": [
    {
        "Principal": "arn:aws:quicksight:us-east-1:xxxxxxxxxx:user/default/user@xxxxx.com",
        "Actions": [
            "quicksight:RestoreAnalysis",
            "quicksight:UpdateAnalysisPermissions",
            "quicksight:DeleteAnalysis",
            "quicksight:DescribeAnalysisPermissions",
            "quicksight:QueryAnalysis",
            "quicksight:DescribeAnalysis",
            "quicksight:UpdateAnalysis"
        ]
    }
]



"AnalysisId": "38372262-5474-4e4b-a395-d6d6f606d1be",
"AnalysisArn": "arn:aws:quicksight:eu-west-1:xxxxxxxxxx:analysis/38372262-5474-4e4b-a395-d6d6f606d1be",
"Permissions": [
    {
        "Principal": "arn:aws:quicksight:us-east-1:xxxxxxxxxx:user/default/user@xxxxx.com",
        "Actions": [
            "quicksight:RestoreAnalysis",
            "quicksight:UpdateAnalysisPermissions",
            "quicksight:DeleteAnalysis",
            "quicksight:DescribeAnalysisPermissions",
            "quicksight:QueryAnalysis",
            "quicksight:DescribeAnalysis",
            "quicksight:UpdateAnalysis"
        ]
    }
]

Other resources like data sources and data sets are accessible in the new region.

Thanks in advance!

1 Like

Hello @ArtSal, if that first set of JSON is everything returned from the asset-bundle, you are missing a lot more than just sheets. It looks like it just has the dataset information. I am assuming it is because you are missing the exact permissions for the AssetBundle APIs.

"quicksight:DescribeAssetBundleExportJob",
"quicksight:ListAssetBundleExportJobs",
"quicksight:StartAssetBundleExportJob"

Also, make sure you specify the asset-bundle resource:

"Resource": "arn:aws:quicksight:*:*:asset-bundle-export-job/*"

I believe those updates should resolve the issue, but make sure to inspect the analysis definition in the bundle to see if the sheets array contains the proper JSON for the analysis. Let me know if this helps!

Hi @DylanM
I am using an admin user

            "Effect": "Allow",
            "Action": "quicksight:*",
            "Resource": "*"

I added the dashboard to the bundle job and it replicated it ok. I am able to open it and interact with it. This is despite the error message:

'Arn': 'arn:aws:quicksight:eu-west-1:xxxxxxxxxxxx:asset-bundle-export-job/back-1'
, 'CreatedTime': datetime.datetime(2025, 1, 17, 16, 31, 25, tzinfo=tzlocal())
, 'AssetBundleExportJobId': 'back-1', 'AwsAccountId': 'xxxxxxxxxxxx'
, 'ResourceArns': ['arn:aws:quicksight:eu-west-1:xxxxxxxxxxxx:analysis/38372262-5474-4e4b-a395-d6d6f606d1be','arn:aws:quicksight:eu-west-1:xxxxxxxxxxxx:dashboard/c7ba1ed9-f229-436e-b842-4261fac1671b'], 'IncludeAllDependencies': True, 'ExportFormat': 'QUICKSIGHT_JSON'
, 'RequestId': '91f5252c-e5b7-4fc7-bfaf-c5ff93f3f173'
, 'IncludePermissions': True
, 'IncludeTags': True
, 'ValidationStrategy': {'StrictModeForAllResources': False}
, 'Warnings': [
{'Arn': 'arn:aws:quicksight:eu-west-1:xxxxxxxxxxxx:dashboard/c7ba1ed9-f229-436e-b842-4261fac1671b'
, 'Message': 'This resource has errors which do not block export and import, please call DescribeDashboardDefinition to validate'}
, {'Arn': 'arn:aws:quicksight:eu-west-1:xxxxxxxxxxxx:analysis/38372262-5474-4e4b-a395-d6d6f606d1be'
, 'Message': 'This resource has errors which do not block export and import, please call DescribeAnalysisDefinition to validate'}]}

I check the dashboard definition as per message and there are no errors?

--SOURCE
'Status': 200,
 'Dashboard': {'DashboardId': 'c7ba1ed9-f229-436e-b842-4261fac1671b',
  'Arn': 'arn:aws:quicksight:eu-west-1:xxxxxxxxxxxx:dashboard/c7ba1ed9-f229-436e-b842-4261fac1671b',
  'Name': 'xxxxxxxx',
  'Version': {'CreatedTime': datetime.datetime(2025, 1, 15, 17, 54, 51, 639000, tzinfo=tzlocal()),
   'Errors': [],
   'VersionNumber': 1,
   'Status': 'CREATION_SUCCESSFUL' ...
   
--TARGET
 'Status': 200,
 'Dashboard': {'DashboardId': 'c7ba1ed9-f229-436e-b842-4261fac1671b',
  'Arn': 'arn:aws:quicksight:eu-central-1:xxxxxxxxxxxx:dashboard/c7ba1ed9-f229-436e-b842-4261fac1671b',
  'Name': 'xxxxxxxx',
  'Version': {'CreatedTime': datetime.datetime(2025, 1, 17, 16, 34, 18, 912000, tzinfo=tzlocal()),
   'Errors': [],
   'VersionNumber': 2,
   'Status': 'CREATION_SUCCESSFUL',

With regard to the analysis I am getting the same issue. The analysis is copied but I can open it. Again, looking at the extract (analysis part) sheets are missing and a lot more.

I ran

DescribeAnalysisDefinition

And am getting tons of errors on source:

--SOURCE
'Status': 200,
 'Analysis': {'AnalysisId': '38372262-5474-4e4b-a395-d6d6f606d1be',
  'Arn': 'arn:aws:quicksight:eu-west-1:xxxxxxxxxxxx:analysis/38372262-5474-4e4b-a395-d6d6f606d1be',
  'Name': 'xxxxxxxx',
  'Status': 'UPDATE_FAILED',
  'Errors': [
	{'Type': 'COLUMN_TYPE_INCOMPATIBLE',
    'Message': "Required type for column 'YEAR' is '[DECIMAL]'. Current type is 'INTEGER'",
    'ViolatedEntities': [{'Path': 'data-set/56800d60-478e-43fd-903a-e3bf1db96095/column/YEAR'}]},
... 

   {'Type': 'COLUMN_TYPE_INCOMPATIBLE',
    'Message': "Column to match in cascading control is of type 'INTEGER'. Required type is 'NUMBER",
    'ViolatedEntities': [{'Path': 'sheet/86ea49ae-501d-4c02-9e8d-1743ba2d53b9/parameter-control/e3a33795-993c-42a4-abeb-f8f2c7c878e8'}]},

These are just examples the list is very long.

The target response is:

--TARGET
 'Status': 200,
 'Analysis': {'AnalysisId': '38372262-5474-4e4b-a395-d6d6f606d1be',
  'Arn': 'arn:aws:quicksight:eu-central-1:xxxxxxxxxxxx:analysis/38372262-5474-4e4b-a395-d6d6f606d1be',
  'Name': 'xxxxxxxx',
  'Status': 'UPDATE_SUCCESSFUL',
  'DataSetArns': [ 'ALL MY DATASETS ARE INCLUDED' ],
  'CreatedTime': datetime.datetime(2025, 1, 14, 12, 23, 58, 67000, tzinfo=tzlocal()),
  'LastUpdatedTime': datetime.datetime(2025, 1, 17, 16, 34, 5, 595000, tzinfo=tzlocal()),
  'Sheets': []},
 'RequestId': '241142dd-fdba-44f3-8413-aa917fd22c00'}

So this is basically taking me back to my first attempt using

describe-analysis-definition

where I had the same errors.

What to do now? I don’t understand how the analysis is able to work perfectly fine allows further changes and publishing but throws an error in back end?
I am looking forward to hearing your thoughts.
Best, A.