Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@aws-sdk/client-quicksight TypeError: entry.getTime is not a function #6176

Closed
3 tasks done
charlydi opened this issue Jun 6, 2024 · 3 comments
Closed
3 tasks done
Assignees
Labels
bug This issue is a bug. duplicate This issue is a duplicate.

Comments

@charlydi
Copy link

charlydi commented Jun 6, 2024

Checkboxes for prior research

Describe the bug

QuickSight client fails to create new Analysis resource with the error: TypeError: entry.getTime is not a function

SDK version number

@aws-sdk/client-quicksight@3.590.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

18.17.1

Reproduction Steps

// if the resouce already exists in aws, resource is marked for deletion
// (creation will happen in other process)
// if the resource does not exist on aws, resources is created (current scenario
// where error is happening)

// Initialization of client and placeholders mapping
const qs = getAWSQSClient(args.awsRegion!, args.awsProfile!);
const templatePlaceholders = {
  awsAccount: args.awsAccount!,
  awsRegion: args.awsRegion!,
  etlPrefix: args.etlPrefix!,
};


// template Object is parsed into a string and all placeholders are replaced to
// generate the analysis definition that will be deployed
const templateStr = removeTemplatePlaceholders(
  JSON.stringify(template),
  templatePlaceholders,
);
// AnalysisDef is a simple interface that has the required information to
// create a new analysis resource using qs client 
const analysisDef = JSON.parse(templateStr) as AnalysisDef;

// once the resource definition is ready, helper fn to create the resource is
// called
await createAnalysis(
  client,
  analysisDef,
  templatePlaceholders.awsAccount,
);


// inside createAnalysis function: definition = analysisDef
const analysisReq = await client.send(
new CreateAnalysisCommand({
  AnalysisId: definition.details.AnalysisId,
  AwsAccountId: awsAccount,
  Name: definition.details.Name,
  Definition: definition.definition,
  ThemeArn: definition.details.ThemeArn,
}),
);

Observed Behavior

Deploying Analyses...

  • [1/2] annotation_analysis
    Resource has been marked for deletion (force deployment)

  • [2/2] live_analytics
    Removing placeholders from template...
    - aws_account
    - aws_region
    - prefix

/Users/user/node_modules/@aws-sdk/client-quicksig
ht/dist-cjs/index.js:10754
    return entry.getTime() / 1e3;
                 ^

TypeError: entry.getTime is not a function
    at /Users/user/node_modules/@aws-sdk/client-q
uicksight/dist-cjs/index.js:10754:18
    at Array.map (<anonymous>)
    at se_DateTimeDefaultValueList (/Users/user/n
ode_modules/@aws-sdk/client-quicksight/dist-cjs/index.js:10753:41)
    at StaticValues (/Users/user/node_modules/@aw
s-sdk/client-quicksight/dist-cjs/index.js:10761:26)
    at applyInstruction (/Users/user/node_modules
/@smithy/smithy-client/dist-cjs/index.js:1089:27)
    at take (/Users/user/node_modules/@smithy/smi
thy-client/dist-cjs/index.js:1057:5)
    at se_DateTimeDefaultValues (/Users/user/node
_modules/@aws-sdk/client-quicksight/dist-cjs/index.js:10758:40)
    at DefaultValues (/Users/user/node_modules/@a
ws-sdk/client-quicksight/dist-cjs/index.js:10778:27)
    at applyInstruction (/Users/user/node_modules
/@smithy/smithy-client/dist-cjs/index.js:1089:27)
    at take (/Users/user/node_modules/@smithy/smi
thy-client/dist-cjs/index.js:1057:5)

Expected Behavior

New QS Analysis been created

Possible Solution

Probably related to #6151 despite being in a different module

Additional Information/Context

No response

@nyamurray
Copy link

A timestamp in the format "Timestamp":"2024-06-10T07:41:13.067Z" is now working.

@aBurmeseDev
Copy link
Member

aBurmeseDev commented Jun 10, 2024

Hi @charlydi - appreciate you for reaching out.

I see that there was already ongoing conversation in #6151 and from giving a quick glance at it, there might be conflict between the format service API uses and how it's actually documented. I'll need to sync up with other member for further investigation. Since this's the same topic, I'm going to close this in favor of the other issue so that we can track it in one place.

@nyamurray could you please elaborate more on your findings in the original issue? Thank you!

@aBurmeseDev aBurmeseDev removed the needs-triage This issue or PR still needs to be triaged. label Jun 10, 2024
@aBurmeseDev aBurmeseDev self-assigned this Jun 10, 2024
@aBurmeseDev aBurmeseDev added duplicate This issue is a duplicate. labels Jun 11, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. duplicate This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

3 participants