question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Invalid RFC-3339 date-time value when sending AssumeRoleWithWebIdentityCommand

See original GitHub issue

Describe the bug

Got error TypeError: Invalid RFC-3339 date-time value when sending command AssumeRoleWithWebIdentityCommand from STSClient . The network request itself is successful by checking the network debug tool in chrome. The error happens when the SDK trying to deserialize credentials expiration date from the http response.

Your environment

React web application that deployed to AWS S3 and using the endpoint created by AWS Cloudfront. The web identity endpoint we are using is https://midway-auth.amazon.com/SSO

SDK version number

@aws-sdk/client-sts@3.34.0

Is the issue in the browser/Node.js/ReactNative?

Browser

Details of the browser/Node.js/ReactNative version

npx: installed 1 in 1.532s

Browsers: Chrome: 94.0.4606.71

Steps to reproduce

    const client = new STSClient({ region: 'us-west-2' });
    const command = new AssumeRoleWithWebIdentityCommand({
        RoleArn: DASHBOARD_ROLE_ARN,
        RoleSessionName: `${SESSION_PREFIX}${Date.now()}`,
        WebIdentityToken: token
    });
    client.send(command)
        .then(data => onAssumeRoleSuccessful(data, callback))
        .catch(error => callback(error));

Observed behavior

Once we have the web identity token. we are executing the above code in order to get the credentials. Due to the above code snippet, the error will be caught and used as the argument in the callback function. In callback function, we print the error out. See screenshot below.

Expected behavior

We should not get this error at all. Just an FYI, if we downgrade to SDK v2 and this issue will just gone.

Screenshots

If applicable, add screenshots to help explain your problem. Screen Shot 2021-10-02 at 12 51 20 AM

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:23 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Grendaizo90commented, Nov 8, 2021

@slimandslam i tried 3.40 right now (for S3Client) but the issue still persists

0reactions
AllanZhengYPcommented, Mar 21, 2022

@slimandslam The same issue should be fixed in #2977 and related PR. This one might be a similar but slightly different issue with prod bundle of Regex. Reassigning this to @ajredniwja for reproduction and uglified code deep-dive.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Invalid RFC-7231 date-time value" when performing ...
Describe the bug I get an "Invalid RFC-7231 date-time value" error, when sending a GetObjectCommand through an S3Client, after having set a ...
Read more >
Invalid RFC3339 format for time data
I've a data which I'm trying to convert to unix timestamp but I think my rfc3339 data coming from server is not proper....
Read more >
foo must be an RFC 3339 date-time
Solution. Common errors include using a space to separate the data and time, or omitting the time zone information. Other potential errors include...
Read more >
Health Client - AWS SDK for JavaScript v3
A value that is expected to be an integer. returns. The value if it's an integer, undefined if it's null/undefined, otherwise an error...
Read more >
RFC 3339: Date and Time on the Internet: Timestamps
There are many ways in which date and time values might appear in Internet protocols: this document focuses on just one common usage,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found