Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

QuickSight describeTemplateDefinition generates empty string value #802

Closed
3 tasks done
seanlogan-wh opened this issue Nov 17, 2023 · 9 comments
Closed
3 tasks done
Assignees
Labels
bug Something isn't working closing-soon This issue will be closed soon p2 quicksight response-requested This issue requires a response to continue service-api This issue pertains to the AWS API

Comments

@seanlogan-wh
Copy link

seanlogan-wh commented Nov 17, 2023

Checkboxes for prior research

Describe the bug

My team started seeing a bug when we run the QuickSight client: describeTemplateDefinitionCommand. The issue occurs when the template contains a categoryFilter. Running the describeTemplateDefinition generates a json representation which we then use to promote the template to our higher environments. The definition is now generating an empty string for CategoryValue.

SDK version number

@aws-sdk/client-quicksight": "3.438.0"

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.8.0

Reproduction Steps

Create a template in QuickSight with a category filter and selectAllOptions set to FILTER_ALL_VALUES

        const describeTemplateDefinitionInput = {
          AwsAccountId: accountId,
          TemplateId: downloadTemplateId || '',
        };
        const describeTemplateDefinitionCommand =
          new DescribeTemplateDefinitionCommand(
            describeTemplateDefinitionInput,
          );
        const downloadTemplateDefinition = await quickSightClient.send(
          describeTemplateDefinitionCommand,
        );
        fs.writeFileSync(
          `./dashboard.json`,
          JSON.stringify(downloadTemplateDefinition.Definition, null, 2),
        );

Observed Behavior

Running the template definition now inserts an empty string for categoryValue in the case of the categoryFilter like so

          "CategoryFilter": {
            "Column": {
              "ColumnName": "dataId",
              "DataSetIdentifier": "dataSetId"
            },
            "Configuration": {
              "CustomFilterConfiguration": {
                "CategoryValue": "",
                "MatchOperator": "CONTAINS",
                "NullOption": "NON_NULLS_ONLY",
                "SelectAllOptions": "FILTER_ALL_VALUES"
              }
            },
            "FilterId": "d19dff68-bc6d-433f-a186-9bda73b3055c"

The error we receive now when trying to promote the template is:

"InvalidParameterValueException: Category Filter must define only one of: CategoryValue(s), ParameterName, SelectAllOptions, at Filter d19dff68-bc6d-433f-a186-9bda73b3055c."

Previously running the generateTemplateDefinition in this case would not create an empty string field for CategoryValue.

Expected Behavior

The category filter has a SelectAllOptions configured so an empty string value should not be returned in the template definition. The response should look like this:

          "CategoryFilter": {
            "Column": {
              "ColumnName": "dataId",
              "DataSetIdentifier": "dataSetId"
            },
            "Configuration": {
              "CustomFilterConfiguration": {
                "MatchOperator": "CONTAINS",
                "NullOption": "NON_NULLS_ONLY",
                "SelectAllOptions": "FILTER_ALL_VALUES"
              }
            },
            "FilterId": "d19dff68-bc6d-433f-a186-9bda73b3055c"

Possible Solution

No response

Additional Information/Context

We noticed this error happening within the past week. It did not happen before this and we can confirm 1 month ago it was not happening.

@seanlogan-wh seanlogan-wh added bug Something isn't working needs-triage labels Nov 17, 2023
@RanVaknin
Copy link

RanVaknin commented Nov 21, 2023

Hi @seanlogan-wh ,

Thanks for the report.

We noticed this error happening within the past week. It did not happen before this and we can confirm 1 month ago it was not happening.

Interesting. Did this start happening after updating to a newer version of the SDK? If not it might have been an issue in the API itself. This is an interesting issue because the error message clearly states that SelectAllOptions and CategoryValue are mutually exclusive.

You can log the raw response to see if the SDK is no deserializing the values correctly by adding a middleware:

quickSightClient.middlewareStack.add(next => async (args) => {
  const response = await next(args);
  console.log(response)
  return response; 
}, { step: 'finalizeRequest' });

If you still see a CategoryValue returned, it tells me this is a service side bug that should be investigated upstream with the Quicksight team itself. Sharing the response logs here will be helpful as well.

Thanks again,
Ran~

@RanVaknin RanVaknin self-assigned this Nov 21, 2023
@RanVaknin RanVaknin added response-requested This issue requires a response to continue and removed needs-triage labels Nov 21, 2023
@seanlogan-wh
Copy link
Author

HI Ran,

I tested with a older version of the SDK (@aws-sdk/client-quicksight": "3.414.0) that we used during the timeframe when we did not see the issue and confirmed the issue now exists on that sdk.

It appears to be coming from the server side. I will not post the entire response as its very large but the problem only appears to happen when SelectAllOptions is configured for the category filter inside of a CustomFilterConfiguration.

Adding the following line to the script

        // Debug
        quickSightClient.middlewareStack.add(next => async (args) => {
          const response = await next(args);
          console.dir(response, { depth: null });
          return response; 
        }, { step: 'finalizeRequest' });

Generates the following output in the console:

          CrossDataset: 'SINGLE_DATASET',
          FilterGroupId: '026efd08-6b1a-4e77-9da7-82f8113c9b6d',
          Filters: [
            {
              CategoryFilter: {
                Column: {
                  ColumnName: 'missingId',
                  DataSetIdentifier: 'dataSet'
                },
                Configuration: {
                  CustomFilterConfiguration: {
                    CategoryValue: '',
                    MatchOperator: 'CONTAINS',
                    NullOption: 'NON_NULLS_ONLY',
                    SelectAllOptions: 'FILTER_ALL_VALUES'
                  }
                },
                FilterId: '0eb4ce0d-97af-4294-ae2f-85beb8dfe888'
              }
            }
          ],

A different category filter does not have the same issue but it is not using a CustomFilterConfiguration but rather a FilterListConfiguration

          Filters: [
            {
              CategoryFilter: {
                Column: {
                  ColumnName: 'missingName',
                  DataSetIdentifier: 'dataSet'
                },
                Configuration: {
                  FilterListConfiguration: {
                    MatchOperator: 'CONTAINS',
                    NullOption: 'NON_NULLS_ONLY',
                    SelectAllOptions: 'FILTER_ALL_VALUES'
                  }
                },
                FilterId: 'cbb929c7-ba69-40af-b4f9-35d077d5498f'
              }
            }
          ],

Thanks

@github-actions github-actions bot removed the response-requested This issue requires a response to continue label Nov 22, 2023
@RanVaknin
Copy link

Hi @seanlogan-wh,

Thanks for sharing the logs. This certainly rules out any deserialization issue of the SDK and points to a potential bug in the Quicksight service itself.

Like the error suggests, SelectAllOptions and CategoryValue should be mutually exclusive, so I'm not sure if this template somehow got created with both values (perhaps service side validations didnt kick in at that time?)

In order for the Quicksight team to investigate this I'll need you to provide us with the request ID of the failing request. This should be a field in your downloadTemplateDefinition response.

Once we have that reqeustID the service team will be able to investigate further.

Thanks again,
Ran~

@RanVaknin RanVaknin added response-requested This issue requires a response to continue p2 labels Nov 29, 2023
@seanlogan-wh
Copy link
Author

Hi Ran,

Sorry I must have missed the email that said you responded. Here is the request id.

  RequestId: '50da99eb-9d44-4d01-bbfd-986663547cd8',
  ResourceStatus: 'CREATION_SUCCESSFUL',

This is in the us-gov-west-1 region.

Thank you!

@github-actions github-actions bot removed the response-requested This issue requires a response to continue label Dec 2, 2023
@aBurmeseDev aBurmeseDev added the service-api This issue pertains to the AWS API label Aug 7, 2024
@aBurmeseDev aBurmeseDev self-assigned this Aug 7, 2024
@RanVaknin RanVaknin transferred this issue from aws/aws-sdk-js-v3 Aug 7, 2024
@RanVaknin
Copy link

Re-routing to cross SDK repo

I reached out to the service team (#P146972103). Waiting for their response.

Thanks,
Ran~

@RanVaknin
Copy link

Hi @seanlogan-wh

This should be fixed. Can you please check and let us know?

Ran~

@RanVaknin RanVaknin added the response-requested This issue requires a response to continue label Aug 8, 2024
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will be closed soon label Aug 18, 2024
@seanlogan-wh
Copy link
Author

Hey Ran,
We are no longer seeing the issue anymore.
Thank you!

Copy link

This issue is now closed.

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working closing-soon This issue will be closed soon p2 quicksight response-requested This issue requires a response to continue service-api This issue pertains to the AWS API
Projects
None yet
Development

No branches or pull requests

3 participants