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

deserializationPolicy.ts error when handling 400s #31772

Open
1 of 6 tasks
xtreme-sameer-vohra opened this issue Nov 14, 2024 · 6 comments
Open
1 of 6 tasks

deserializationPolicy.ts error when handling 400s #31772

xtreme-sameer-vohra opened this issue Nov 14, 2024 · 6 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Communication customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@xtreme-sameer-vohra
Copy link

  • Package Name: @azure-rest/core-client
  • Package Version: 1.4.0
  • Operating system: Mac Ventura
  • nodejs
    • version: v23.2.0
  • browser
    • name/version: n/a
  • typescript
    • version: ^5.0.4
  • Is the bug related to documentation in

Describe the bug
When running src/app.ts, after an incoming call is handled, upon receiving some call events, the application crashes

To Reproduce
Steps to reproduce the behavior:

  1. Setup callautomation live transcription demo
  2. Answer an incoming call and stay on the line for > 30 s

Error in console output

/azure-live-transcription/node_modules/@azure/core-client/src/deserializationPolicy.ts:255
  const error = new RestError(initialErrorMessage, {
                ^
RestError: IDX23010: Lifetime validation of the signed http request failed. Current time: '11/14/2024 7:50:08 PM' UTC, signed http request is valid until: '11/14/2024 6:43:34 PM' UTC.
    at handleErrorResponse (/Users/sameer/workspace/azure-live-transcription/node_modules/@azure/core-client/src/deserializationPolicy.ts:255:17)
    at deserializeResponseBody (/Users/sameer/workspace/azure-live-transcription/node_modules/@azure/core-client/src/deserializationPolicy.ts:159:43)
    at processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: undefined,
  statusCode: 400,
  details: {}
}

OR

azure-live-transcription/node_modules/@azure/core-client/src/deserializationPolicy.ts:255
  const error = new RestError(initialErrorMessage, {
                ^
RestError: Invalid request
    at handleErrorResponse (/Users/sameer/workspace/azure-live-transcription/node_modules/@azure/core-client/src/deserializationPolicy.ts:255:17)
    at deserializeResponseBody (/Users/sameer/workspace/azure-live-transcription/node_modules/@azure/core-client/src/deserializationPolicy.ts:159:43)
    at processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: '400',
  statusCode: 400,
  details: {
    error: { code: '400', message: 'Invalid request', details: [Array] }
  }
}

Expected behavior
Demo app to not crash

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@github-actions github-actions bot added Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Nov 14, 2024
Copy link

@github-actions github-actions bot added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 14, 2024
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@xtreme-sameer-vohra
Copy link
Author

Specifically narrowed the issue down to https://github.com/Azure-Samples/communication-services-javascript-quickstarts/blob/main/callautomation-live-transcription/src/app.ts#L89

And just as a cheap retry, tried to recreate a new client and retry the answerCall command.

try {
	answerCallResult = await acsClient.answerCall(incomingCallContext, callbackUri, answerCallOptions);
}
catch(error) {
	console.log(`ERROR IN ANSWERING CALL: ${error}`);
	await createAcsClient();
	answerCallResult = await acsClient.answerCall(incomingCallContext, callbackUri, answerCallOptions);
}

That resulted in another exception being thrown at the 2nd answerCall with the new acsClient

@timovv timovv removed the Azure.Core label Nov 18, 2024
@timovv
Copy link
Member

timovv commented Nov 18, 2024

Hi @xtreme-sameer-vohra, thank you for the report. This doesn't appear to be an issue with the core-client package -- the deserializationPolicy will throw a RestError whenever an unsuccessful (i.e. non-2xx) status code is received from the service. This includes the 400 status code that you are seeing.

I will tag this issue with the Communication label so that the ACS folks can help you with the underlying reason as to why the service might be responding with a 400 status here. Thanks for your patience!

@timovv timovv added Communication Service Attention Workflow: This issue is responsible by Azure service team. labels Nov 18, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @acsdevx-msft.

@timovv timovv assigned akania and unassigned joheredi Nov 18, 2024
@xtreme-sameer-vohra
Copy link
Author

Thanks @timovv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Communication customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

4 participants