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

TypeError: Invalid RFC-3339 date-time value when using client-medialive DescribeChannelCommand #6782

Open
3 of 4 tasks
brako opened this issue Jan 8, 2025 · 9 comments
Open
3 of 4 tasks
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@brako
Copy link

brako commented Jan 8, 2025

Checkboxes for prior research

Describe the bug

The DescribeChannelCommand throws an error Invalid RFC-3339 date-time value. The request itself is successful with an http code 200, but the response body fails to deserialize due to an invalid date format.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.17.0

Reproduction Steps

import {
    MediaLiveClient,
    DescribeChannelCommand
} from '@aws-sdk/client-medialive';

const mediaLiveClient = new MediaLiveClient({
    region: 'region' // <= replace here with a aws region
});
const input = {
    ChannelId: 'id' // <= replace here with a channel ID
};
// Throws an exception
await mediaLiveClient.send(new DescribeChannelCommand(input));

Observed Behavior

TypeError: Invalid RFC-3339 date-time value
  Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.
    at parseRfc3339DateTimeWithOffset (...\node_modules\@aws-sdk\client-medialive\node_modules\@smithy\smithy-client\dist-cjs\index.js:631:11)
    at ExpirationDate (...\node_modules\@aws-sdk\client-medialive\dist-cjs\index.js:8524:127)
    at applyInstruction (...\node_modules\@aws-sdk\client-medialive\node_modules\@smithy\smithy-client\dist-cjs\index.js:1105:27)        
    at take (...\node_modules\@aws-sdk\client-medialive\node_modules\@smithy\smithy-client\dist-cjs\index.js:1073:5)
    at de_ChannelEngineVersionResponse (...\node_modules\@aws-sdk\client-medialive\dist-cjs\index.js:8523:40)
    at ChannelEngineVersion (...\node_modules\@aws-sdk\client-medialive\dist-cjs\index.js:9973:37)
    at applyInstruction (...\node_modules\@aws-sdk\client-medialive\node_modules\@smithy\smithy-client\dist-cjs\index.js:1105:27)        
    at take (...\node_modules\@aws-sdk\client-medialive\node_modules\@smithy\smithy-client\dist-cjs\index.js:1073:5)
    at de_PipelineDetail (...\node_modules\@aws-sdk\client-medialive\dist-cjs\index.js:9968:40)
    at ...\node_modules\@aws-sdk\client-medialive\dist-cjs\index.js:8055:12 {
  '$metadata': { attempts: 1, totalRetryDelay: 0 }

Expected Behavior

Expected behavior is to receive the description of the channel.

Possible Solution

As a workaround we can use the ListChannelsCommand and filter the result manually with the channel id. The ListChannelsCommand is not affected by the issue.

Additional Information/Context

No response

@brako brako added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 8, 2025
@zshzbh zshzbh self-assigned this Jan 8, 2025
@zshzbh zshzbh added the p2 This is a standard priority issue label Jan 8, 2025
@ptgamr
Copy link

ptgamr commented Jan 14, 2025

+1

2 similar comments
@harrietwaters
Copy link

+1

@jbieberly-xumo
Copy link

+1

@lelikg
Copy link

lelikg commented Jan 23, 2025

+1 when can we expect this to be fixed?

@zshzbh
Copy link
Contributor

zshzbh commented Jan 24, 2025

It seems that issue is in the response of of DescribeChannelCommandOutput -

export interface ChannelEngineVersionResponse {
  /**
   * The UTC time when the version expires.
   * @public
   */
  ExpirationDate?: Date | undefined;

  /**
   * The build identifier for this version of the channel version.
   * @public
   */
  Version?: string | undefined;
}

The ExpirationDate is expecting a Date in JS. This means the AWS MediaLive service is returning a date value that the SDK is unable to parse as a valid RFC-3339 date.

I have brought this issue to the team and will keep you posted.

Thanks!

@zshzbh zshzbh removed the needs-triage This issue or PR still needs to be triaged. label Jan 24, 2025
@zshzbh
Copy link
Contributor

zshzbh commented Jan 24, 2025

Could you please provide the raw response and request id so we can dive deep into this issue?

 const command = new DescribeChannelCommand({
            ChannelId: channelId
        });

        const response = await client.send(command);
        
        // Log the raw response to see the actual date format
        console.log('Raw response:', JSON.stringify(response?.Channel?.ChannelEngineVersion, null, 2));

@brako
Copy link
Author

brako commented Jan 28, 2025

I attempted to print the response, but the send command throws an exception. The issue seems to occur only when the channel's state is set to RUNNING. I also tried using the command with AWS CLI to retrieve the response, but the Channel JSON object is not present in the output

@torrottum
Copy link

torrottum commented Jan 28, 2025

+1, only happens when the channel is running. Did a test with polling while starting and stopping the channel:

> node index.mjs
Poll for state
State:IDLE
Poll for state
State:STARTING
Poll for state
State:STARTING
Poll for state
State:STARTING
Poll for state
Error: Invalid RFC-3339 date-time value
  Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.
Poll for state
Error: Invalid RFC-3339 date-time value
  Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.
Poll for state
State:STOPPING
Poll for state
State:STOPPING
Poll for state
State:STOPPING
Poll for state
State:IDLE
Poll for state
State:IDLE

I'll see if I can get the response body.

@torrottum
Copy link

I think this is the relevant part of the response body?

  "pipelineDetails": [
    {
      "pipelineId": "0",
      "activeInputAttachmentName": "rtmp_input",
      "activeInputSwitchActionName": "Initial Channel Input",
      "activeMotionGraphicsUri": "",
      "activeMotionGraphicsActionName": "",
      "channelEngineVersion": {
        "version": "",
        "expirationDate": "1970-01-01T00:00Z"
      }
    }
  ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

7 participants