The ConversationTranslator instance throws [02/21/2024, 4:19:34 PM] Unable to contact server. StatusCode: 1006, undefined Reason: Unexpected server response: 400 randomly, and then the memory usage increases immediately.
these are screenshots from Azure portal, which shows nothing was logged on Azure side:
This is how the instance of the class is being created:
const createConversationAsync = (
speechKey: string | undefined,
speechRegion: string | undefined,
): Promise<Conversation> => {
if (speechKey === undefined || speechRegion === undefined) {
throw new InternalServerErrorException(
"The Azure speech recognition API key and region were not provided",
);
}
const config = SpeechTranslationConfig.fromSubscription(
speechKey,
speechRegion,
);
return new Promise((resolve: Callback, reject: Callback) => {
const conversation = Conversation.createConversationAsync(
config,
() => {
conversation.startConversationAsync(
() => resolve(conversation),
reject,
);
},
reject,
);
});
};
The image below shows our application memory usage (Node.JS) during this time:
At 16:19:34 the memory usage started to go up and then once it reached 4GB (our pod memory limit) at 16:36:10 the pod restarted and the memory usage went down again.
The connection fails four times (without being logged) according to the retry routine in the implementation.
The last error is a “Unexcepted server response: 400” with the Cognitive Services SDK logging “Unable to contact server. StatusCode: 1006"
The Node.js immediately becomes unresponsive and starts increasing memory until the container crashes (= memory leak).
There is no special handling on our site that could have caused this observed behavior as we initialize the SDK through the ConversationTranslator normally.
Even though it’s a 400 error, there are no blocked calls, client errors, or total errors listed for our Azure subscription’s resource.
Version
1.34.0 (Latest)
What browser/platform are you seeing the problem on?
What happened?
The ConversationTranslator instance throws
[02/21/2024, 4:19:34 PM] Unable to contact server. StatusCode: 1006, undefined Reason: Unexpected server response: 400
randomly, and then the memory usage increases immediately.these are screenshots from Azure portal, which shows nothing was logged on Azure side:
This is how the instance of the class is being created:
The image below shows our application memory usage (Node.JS) during this time:
At 16:19:34 the memory usage started to go up and then once it reached 4GB (our pod memory limit) at 16:36:10 the pod restarted and the memory usage went down again.
We analyzed the involved code of the Cognitive Services JS SDK, and the behavior is as follows:
Version
1.34.0 (Latest)
What browser/platform are you seeing the problem on?
Node
Relevant log output
No response