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

Medialive Schedule JSON parsing error #212

Closed
bhaan opened this issue Aug 29, 2021 · 2 comments
Closed

Medialive Schedule JSON parsing error #212

bhaan opened this issue Aug 29, 2021 · 2 comments
Assignees
Labels
bug This issue is a bug.

Comments

@bhaan
Copy link

bhaan commented Aug 29, 2021

Bug Report

Version

├── aws-sdk-medialive v0.0.16-alpha (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                           
│   ├── aws-auth v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                                       
│   │   ├── aws-types v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                                  
│   │   ├── smithy-async v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                               
│   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                                
│   │   │   ├── smithy-eventstream v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                     
│   │   │   │   └── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                       
│   │   │   ├── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                       
│   ├── aws-endpoint v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                                   
│   │   ├── aws-types v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                              
│   │   └── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                            
│   ├── aws-http v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                                       
│   │   ├── aws-types v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                              
│   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                            
│   │   ├── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                           
│   ├── aws-hyper v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                                      
│   │   ├── aws-auth v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                               
│   │   ├── aws-endpoint v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                           
│   │   ├── aws-http v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                               
│   │   ├── aws-sig-auth v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                               
│   │   │   ├── aws-auth v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                           
│   │   │   ├── aws-sigv4 v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                              
│   │   │   │   └── smithy-eventstream v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                             
│   │   │   ├── aws-types v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                          
│   │   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                        
│   │   ├── smithy-client v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                              
│   │   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                        
│   │   │   ├── smithy-http-tower v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                      
│   │   │   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                    
│   │   │   ├── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                       
│   │   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                            
│   │   ├── smithy-http-tower v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                      
│   │   ├── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                           
│   ├── aws-sig-auth v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                               
│   ├── aws-types v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                                  
│   ├── smithy-http v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                                
│   ├── smithy-json v0.1.0 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9)                                                                                                                    
│   │   └── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)                                                                                                           
│   └── smithy-types v0.0.1 (https://github.com/awslabs/aws-sdk-rust?tag=v0.0.16-alpha#dab3b0a9) (*)  

Platform

Linux DELL-XPS-13-9380 5.11.0-27-generic #29~20.04.1-Ubuntu SMP Wed Aug 11 15:58:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

AWS Services

Medialive

Description

The describe_schedule and batch_update_schedule functions produce a JSON parsing error when the payload contains an immediateModeScheduleActionStartSettings object. The ImmediateModeScheduleActionStartSettings rust type is defined as an empty struct which appears to have an erroneous JSON deserializer that will accept a StartObject token, but will not advance the token iterator through to the EndObject token.
https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/medialive/src/model.rs#L34045
https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/medialive/src/json_deser.rs#L11782-L11786

Example code:

let client = aws_sdk_medialive::Client::from_env();
let result = client
    .describe_schedule()
    .channel_id(&channel_id)
    .send()
    .await;

I expected an Ok result

Instead I got the following DescribeScheduleError:

ServiceError { err: DescribeScheduleError { kind: Unhandled(Error { reason: Custom("expected start object or null"), ...

With the following relevant trace logs:

[2021-08-29T21:54:47Z TRACE smithy_http_tower::dispatch] request=Request { method: GET, uri: REDACTED, version: HTTP/1.1, headers: {"content-type": "application/json", "content-length": "0", "host": "medialive.us-east-1.amazonaws.com", "user-agent": "aws-sdk-rust/0.1.0 os/linux lang/rust/1.53.0", "x-amz-user-agent": "aws-sdk-rust/0.1.0 api/medialive/0.0.16-alpha os/linux lang/rust/1.53.0", "authorization": Sensitive, "x-amz-date": "20210829T215447Z"}, body: SdkBody { inner: Once(Some(b"")), retryable: true } }
[2021-08-29T21:54:48Z TRACE smithy_http::middleware] http_response=Response { status: 200, version: HTTP/2.0, headers: {"content-type": "application/json", "content-length": "1100", "date": "Sun, 29 Aug 2021 21:54:49 GMT", "x-amzn-requestid": "ed8c88f9-a4dd-4b7f-a037-9dae4e9ca24a", "access-control-allow-origin": "*", "x-amz-apigw-id": "E2VGdHqFIAMFwQA=", "x-amzn-trace-id": "Root=1-612c0229-0dedbc916f86c4cd7268f278;Sampled=0", "x-cache": "Miss from cloudfront", "via": "1.1 788f6ff13e09a712f5227945fa34a519.cloudfront.net (CloudFront)", "x-amz-cf-pop": "DEN50-C2", "x-amz-cf-id": "u5vhI2y0Oyi-RvLMeS9aDahPxh7n-K2CttH4t26DcZSxV8YkULci3A=="}, body: b"{\"scheduleActions\":[{\"actionName\":\"REDACTED\",\"scheduleActionStartSettings\":{\"immediateModeScheduleActionStartSettings\":{\"time\":\"2021-08-29T21:54:42.651\"}},\"scheduleActionSettings\":{\"inputSwitchSettings\":{\"inputAttachmentNameReference\":\"REDACTED\",\"urlPath\":[]}}},{\"actionName\":\"REDACTED\",\"scheduleActionStartSettings\":{\"fixedModeScheduleActionStartSettings\":{\"time\":\"2021-08-30T17:29:29Z\"}},\"scheduleActionSettings\":{\"inputSwitchSettings\":{\"inputAttachmentNameReference\":\"REDACTED\",\"urlPath\":[]}}},{\"actionName\":\"REDACTED\",\"scheduleActionStartSettings\":{\"followModeScheduleActionStartSettings\":{\"referenceActionName\":\"REDACTED\",\"followPoint\":\"END\"}},\"scheduleActionSettings\":{\"inputSwitchSettings\":{\"inputAttachmentNameReference\":\"REDACTED\",\"urlPath\":[]}}},{\"actionName\":\"REDACTED\",\"scheduleActionStartSettings\":{\"followModeScheduleActionStartSettings\":{\"referenceActionName\":\"REDACTED\",\"followPoint\":\"END\"}},\"scheduleActionSettings\":{\"inputSwitchSettings\":{\"inputAttachmentNameReference\":\"REDACTED\",\"urlPath\":[]}}}]}" }

Notice the part {\"immediateModeScheduleActionStartSettings\":{\"time\":\"2021-08-29T21:54:42.651\"}}, which is the object that breaks the deserializer.

@bhaan bhaan added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 29, 2021
@bhaan bhaan changed the title Medialive Schedule JSON paser error Medialive Schedule JSON parsing error Aug 29, 2021
@rcoh rcoh added this to We're Working On It in SDK for Rust Public Roadmap Aug 30, 2021
@rcoh rcoh removed the needs-triage This issue or PR still needs to be triaged. label Aug 30, 2021
@jdisanti jdisanti self-assigned this Sep 1, 2021
@jdisanti jdisanti moved this from We're Working On It to Coming Soon (slated for inclusion in next release) in SDK for Rust Public Roadmap Sep 1, 2021
@jdisanti
Copy link
Contributor

jdisanti commented Sep 2, 2021

This has been fixed in v0.0.17-alpha.

@jdisanti jdisanti closed this as completed Sep 2, 2021
SDK for Rust Public Roadmap automation moved this from Coming Soon (slated for inclusion in next release) to Just Shipped Sep 2, 2021
@github-actions
Copy link

github-actions bot commented Sep 2, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
No open projects
Development

No branches or pull requests

3 participants