Failed to create analysis/dashboard with json that is generated from existing one

Hello, I’m trying to migrate existing resources(analysis and dashboard) between AWS accounts from stg to prod.

I used aws quicksight describe-analysis-definition command and combined it with cli-input skeleton. However, I saw two kinds of error messages. This analysis contains line charts and pivot tables. I doubt that the creation API’s validation logic is incorrect. Or am I missing something?

Line charts

An error occurred (InvalidParameterValueException) when calling the CreateAnalysis operation: If Missing dates are configured to be visible on the X-axis, then INTERPOLATE option can not be used for MissingDataTreatment in Y-axis,

Input JSON
"Type": "LINE",
  "XAxisDisplayOptions": {
      "TickLabelOptions": {
          "LabelOptions": {
              "Visibility": "VISIBLE",
              "FontConfiguration": {
                  "FontSize": {
                      "Relative": "MEDIUM"
                  }
              }
          },
          "RotationAngle": 0.0
      },
      "AxisLineVisibility": "HIDDEN",
      "DataOptions": {
          "DateAxisOptions": {
              "MissingDateVisibility": "VISIBLE"
          }
      },
      "ScrollbarOptions": {
          "Visibility": "HIDDEN"
      }
  },
  "XAxisLabelOptions": {
      "Visibility": "HIDDEN"
  },
  "PrimaryYAxisDisplayOptions": {
      "AxisOptions": {
          "TickLabelOptions": {
              "LabelOptions": {
                  "Visibility": "VISIBLE"
              }
          },
          "GridLineVisibility": "VISIBLE",
          "DataOptions": {
              "NumericAxisOptions": {
                  "Scale": {
                      "Linear": {
                          "StepSize": 20.0
                      }
                  }
              }
          }
      },
      "MissingDataConfigurations": [
          {
              "TreatmentOption": "INTERPOLATE"
          }
      ]
  },

Pivot table
error message

Parameter validation failed:
Missing required parameter in Definition.Sheets[1].Visuals[4].PivotTableVisual.ChartConfiguration.FieldOptions.DataPathOptions[0].DataPathList[0]: “FieldId”
Missing required parameter in Definition.Sheets[1].Visuals[4].PivotTableVisual.ChartConfiguration.FieldOptions.DataPathOptions[0].DataPathList[0]: “FieldValue”

input json snippet

Input JSON
 "DataPathOptions": [
      {
          "DataPathList": [
              {}
          ],
          "Width": "126px"
      },
      {
          "DataPathList": [
              {}
          ],
          "Width": "83px"
      }
  ]

Hello @johnnyShippio,

Is there a reason you are not using the bundle APIs? Those simplify quite a lot moving assets from one account to the other. You can find more information on the blog post below.

Hope this helps!

Thanks, I didn’t know that. I’ll take a look.

Should I use asset bundle APIs instead of describe definition APIs? Are describe API not actively maintained?

I’ve made kinds of stuff to move resources with some transformation using describe APIs. I followed this workshop.
I’m worring about until when we can keep using this since my products are already provided to customers.

Hello @johnnyShippio,

The new bundle APIs just makes the process easier, the describe APIs have other functions that can also be used as part of CI/CD, and worry not, none of these are planned to be decomissioned.

I apologize. The issue was happened because I used old version of AWS CLI(2.9). I could get expected response with latest CLI.

1 Like

I tried export/import job.

It worked for PivotTable visual. However, the issue below remains.

An error occurred (InvalidParameterValueException) when calling the CreateAnalysis operation: If Missing dates are configured to be visible on the X-axis, then INTERPOLATE option can not be used for MissingDataTreatment in Y-axis,

this is the fragment of json that I got from export job.

          {
            "lineChartVisual": {
              "visualId": "8e1d316b-5d35-4cce-a441-e5fabab5447d",
              "chartConfiguration": {
                "type": "LINE",
                "primaryYAxisDisplayOptions": {
                  "axisOptions": {
                    "tickLabelOptions": {
                      "labelOptions": {
                        "visibility": "VISIBLE"
                      }
                    },
                    "gridLineVisibility": "VISIBLE",
                    "dataOptions": {
                      "numericAxisOptions": {
                        "scale": {
                          "linear": {
                            "stepSize": 20.0
                          }
                        }
                      }
                    }
                  },
                  "missingDataConfigurations": [
                    {
                      "treatmentOption": "INTERPOLATE"
                    }
                  ]
                },
                "xaxisDisplayOptions": {
                  "tickLabelOptions": {
                    "labelOptions": {
                      "visibility": "VISIBLE",
                      "fontConfiguration": {
                        "fontSize": {
                          "relative": "MEDIUM"
                        }
                      }
                    },
                    "rotationAngle": 0.0
                  },
                  "axisLineVisibility": "HIDDEN",
                  "dataOptions": {
                    "dateAxisOptions": {
                      "missingDateVisibility": "VISIBLE"
                    }
                  },
                  "scrollbarOptions": {
                    "visibility": "HIDDEN"
                  }
                },
                "xaxisLabelOptions": {
                  "visibility": "HIDDEN"
                }
              },

I need to manually modify dateAxisOptions.“missingDateVisibility”: “VISIBLE” to HIDDEN.

Is it expected behavior?

@johnnyShippio Thanks for reporting this issue. We will try to reproduce on our side. We don’t expect the users having to modify the exported JSON in order to successfully import.

3 Likes

Thank you for your answer. If needed, I’ll cut a support ticket from AWS console to tell my resource IDs to QuickSight team.

I heard from AWS support team this was QuickSight’s bug. I’m waiting for the fix.

I’m using the DescribeAnalysis method in latest .NET SDK to export the analysis definition to a json file. I restore this json back to AnalysisDefintion object and then call CreateAnalysis using the definition. This is the part it fails with a bunch of validation errors. Too many to fix. I have validation strategy set to LENIENT.

Am I going about this incorrectly? I’ve also created a AssetBundleExport job and imported those QUICKSIGHT_JSON files back to AnalysisObjects and tried restore with CreateAnalysis and still get similar validation errors.

				CreateAnalysisRequest request = new CreateAnalysisRequest
				{
					AwsAccountId = awsAccountId,
					Name = "Test Analysis",
					AnalysisId = analysisId,
					Definition = analysis,
					ValidationStrategy = new ValidationStrategy
					{
						Mode = ValidationStrategyMode.LENIENT
					},
				};

Resulting validation errors appear, mostly in the Sheets sections.

10 validation errors detected: Value ‘0’ at ‘definition.sheets.2.member.visuals.3.member.tableVisual.chartConfiguration.tableOptions.headerStyle.height’ failed to satisfy constraint: Member must have value greater than or equal to 8; Value ‘0’ at ‘definition.sheets.2.member.visuals.4.member.tableVisual.chartConfiguration.tableOptions.headerStyle.height’ failed to satisfy constraint: Member must have value greater than or equal to 8; Value ‘0’ at ‘definition.sheets.2.member.visuals.5.member.tableVisual.chartConfiguration.tableOptions.headerStyle.height’ failed to satisfy constraint: Member must have value greater than or equal to 8; Value ‘0’ at ‘definition.sheets.2.member.visuals.6.member.tableVisual.chartConfiguration.tableOptions.headerStyle.height’ failed to satisfy constraint: Member must have value greater than or equal to 8; Value ‘0’ at ‘definition.sheets.2.member.visuals.7.member.tableVisual.chartConfiguration.tableOptions.headerStyle.height’ failed to satisfy constraint: Member must have value greater than or equal to 8; Value ‘0’ at ‘definition.sheets.2.member.visuals.10.member.pivotTableVisual.chartConfiguration.totalOptions.rowSubtotalOptions.totalCellStyle.height’ failed to satisfy constraint: Member must have value greater than or equal to 8; Value ‘0’ at ‘definition.sheets.2.member.visuals.10.member.pivotTableVisual.chartConfiguration.totalOptions.rowTotalOptions.valueCellStyle.height’ failed to satisfy constraint: Member must have value greater than or equal to 8; Value ‘0’ at ‘definition.sheets.2.member.visuals.10.member.pivotTableVisual.chartConfiguration.totalOptions.rowTotalOptions.totalCellStyle.height’ failed to satisfy constraint: Member must have value greater than or equal to 8; Value ‘0’ at ‘definition.sheets.2.member.visuals.10.member.pivotTableVisual.chartConfiguration.totalOptions.rowTotalOptions.metricHeaderCellStyle.height’ failed to satisfy constraint: Member must have value greater than or equal to 8; Value ‘0’ at ‘definition.sheets.2.member.visuals.10.member.pivotTableVisual.chartConfiguration.tableOptions.rowFieldNamesStyle.height’ failed to satisfy constraint: Member must have value greater than or equal to 8