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

CreateProgram: OffsetMillis cannot be missing #685

Closed
mehulgohil-tal opened this issue Jan 18, 2024 · 6 comments
Closed

CreateProgram: OffsetMillis cannot be missing #685

mehulgohil-tal opened this issue Jan 18, 2024 · 6 comments
Assignees
Labels
bug Something isn't working closed-for-staleness This issue was closed because it didn't receive updates mediatailor response-requested This issue requires a response to continue service-api This issue pertains to the AWS API

Comments

@mehulgohil-tal
Copy link

Describe the bug

I am creating a Program in Mediatailor Channel. Using CreateProgram method. I am trying to add an Ad break at start of the program. Basically Offset 0.
But the SDK is returning error stating operation error MediaTailor: CreateProgram, https response error StatusCode: 400, RequestID: 4b6d0fc7-c074-418f-bf2d-75ab598cfd78, api error BadRequestException: OffsetMillis cannot be missing..

While offset 0 works fine when inserted from AWS Console

Expected Behavior

The Program Should be created in channel with AD Break inserted at offset 0

Current Behavior

Giving Error
operation error MediaTailor: CreateProgram, https response error StatusCode: 400, RequestID: 4b6d0fc7-c074-418f-bf2d-75ab598cfd78, api error BadRequestException: OffsetMillis cannot be missing.

Reproduction Steps

mediaTailorClient.CreateProgram(context.TODO(), &mediatailor.CreateProgramInput{
		ChannelName:        aws.String("TestChannel"),
		ProgramName:        aws.String("TestProgram1"),
		SourceLocationName: aws.String("TestSource"),
		VodSourceName:      aws.String("TestVOD"),
		ScheduleConfiguration: &types.ScheduleConfiguration{
			Transition: &types.Transition{
				Type:                     aws.String("RELATIVE"),
				RelativePosition:         "AFTER_PROGRAM",
				RelativeProgram:          aws.String("TestProgram"),
				ScheduledStartTimeMillis: aws.Int64(0),
			},
		},
		AdBreaks: []types.AdBreak{
			{
				MessageType:  "SPLICE_INSERT",
				OffsetMillis: 0,
				Slate: &types.SlateSource{
					SourceLocationName: aws.String("sSLATE"),
					VodSourceName:      aws.String("slate-3"),
				},
			},
		},
	})

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

v1.33.1

Compiler and Version used

go1.21.4

Operating System and version

Windows 11

@mehulgohil-tal mehulgohil-tal added bug Something isn't working needs-triage labels Jan 18, 2024
@RanVaknin RanVaknin self-assigned this Jan 18, 2024
@RanVaknin
Copy link

Hi @mehulgohil-tal ,

Thanks for reaching out.

This smells like other media-* services where INTs and LONGs are modeled without the required trait.
OffsetMillis which is the member in question, is referred to twice in the model:
once with the required trait
and once without the required trait

Since the SDK is code generated from the model, and that lack of trait means that the SDK does not explicitly serialize 0 values, this is an issue that needs to be solved upstream with the media tailor service itself.

I will discuss this with the team, verify and then create an internal ticket with the service team.

To unblock you, you will need to create a middleware that will manually write that 0 value to the request to circumvent the serialization logic. You can find an example here.

Let us know if you need any help with the workaround.
Thanks again,
Ran~

@mehulgohil-tal
Copy link
Author

Thanks @RanVaknin for the quick reply.
I have applied my custom middleware similar to what you have shown, and working as expected.

Is this issue going to be resolved going forward ? or I have to continue with this workaround ?

@lucix-aws
Copy link

This is a discrepancy between the service's API model and its actual behavior, much like the various cases of aws/aws-sdk-go-v2#2162.

We will need to upstream this issue with the appropriate service team to pursue a fix.

@lucix-aws lucix-aws added the service-api This issue pertains to the AWS API label Jan 23, 2024
@RanVaknin
Copy link

We have created a ticket with the MediaTailor service team P115786494.
Moving to cross SDK repo for tracking.

Ran~

@RanVaknin RanVaknin transferred this issue from aws/aws-sdk-go-v2 Jan 30, 2024
@RanVaknin
Copy link

This should be solved now.
Can you please update the SDK and see if this solves your issue?

Thanks,
Ran~

@RanVaknin RanVaknin added the response-requested This issue requires a response to continue label Apr 24, 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 closing-soon This issue will be closed soon closed-for-staleness This issue was closed because it didn't receive updates and removed closing-soon This issue will be closed soon labels Apr 29, 2024
@github-actions github-actions bot closed this as completed May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working closed-for-staleness This issue was closed because it didn't receive updates mediatailor 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