Boto3 error during CreateAnalysis operation

Hi all,

I am trying to create an analysis out of another analysis by substituting the datasets used (same structure as datasets in org analysis). I use the operation below:

analysis_creation = quicksight_client.create_analysis(
AwsAccountId=account_id,
AnalysisId=analysis_id,
Name=analysis_name,
Definition=analysis_definition,
ThemeArn=theme_arn,
FolderArns=folder_id

)
return analysis_creation

When I call this operation I get:
botocore.exceptions.ClientError: An error occurred (InternalFailure) when calling the CreateAnalysis operation (reached max retries: 4): None

Any idea on what is going wrong here? In the parameter “Definition” in create_analysis API call I use the one shown in pic
Screenshot from 2024-04-05 13-04-09

Hi @Fotis_flex Thanks for reaching out. I have pinged one of our Solution Architects to ask them to take a look at this for you on Monday.

If you continue to see this error, I would recommend filing a case with AWS Support where we can dive into the details so that we can help you further. Here are the steps to open a support case. If your company has someone who manages your AWS account, you might not have direct access to AWS Support and will need to raise an internal ticket to your IT team or whomever manages your AWS account. They should be able to open an AWS Support case on your behalf. Hope this helps!

Hi @Fotis_flex

Have you created analysis using API before ? if not, please check if you have required permission to perform CreateAnalysis operation.

Also, try below steps and let us know if you able to create analysis.

  1. Create simple analysis from UI (two or more visuals), without any parameters or tools tips.
  2. Export definition
  3. Create Analysis using this definition (API operation)

I would like check if parameter part is causing any issue.

1 Like

Hi @Ashok No It’s the first time I attempt to create an analysis using API. How can I check if I have permission to perform CreateAnalysis operation?

I followed exactly the steps you mentioned but still I get the same error! Why? Is it related with my permissions? I am the admin

Hi @Fotis_flex

Your userID should have programmatic access with permission attached quicksight:operation-name.

more information available in the document below.

Once you have necessary permission, you should be able execute CLI or make API calls.

Hi @Ashok . I just checked my AWS permissions and I have “AdministratorAccess” so I should be able to perform all operations. I am using boto3 API for many other operations (create_datasets, describe and updated analysis etc…) However, I still get the above error I mentioned! Cannot explain it. Any other ideas perhaps?

Thx,
Fotis

Hi @Fotis_flex

Since you tried the steps and even creation of simple analysis using API is failing, I would recommend creating a support. steps to open support case is available in @Kristin post above.

1 Like

Hi @Ashok , I am afraid I don’t have aws support plan.
Do you think my initial request syntax and parameters are correct? I am worried about the Definition=analysis_definition because there I place the whole analysis description I get from the describe_analysis api and substituting the datasets arn’s. Should I perhaps switch to a template ? Can you maybe specify the request syntax of the create_analysis with boto3? And what should I put in every parameter? For e.g, I nowhere use the SourceEntity
Thx

Hi @Fotis_flex Can you try below steps.

If you are using CLI :
From the describe analysis definition Json, remove the lines show below.
Status, AnalysisID, Name, ResourceStatus, ThemeArn

and in the request ID in the end of definition
image

Use the updated Json file as input in CLI.

aws quicksight create-analysis --aws-account-id account-ID --analysis-id analysis-id --name analysis-name --cli-input-json file://Json file updated

If using API:

describe analysis and assign it to variable analysis_definition
and use below API call where we use only definition part of the analysis description.

analysis_creation = quicksight_client.create_analysis(
AwsAccountId=account_id,
AnalysisId=analysis_id,
Name=analysis_name,
Definition=analysis_definition[‘Definition’],
ThemeArn=theme_arn,
FolderArns=folder_id
)

Hmm, I do exactly like this and I get this error…!