Azure-Samples / cognitive-services-speech-sdk

Sample code for the Microsoft Cognitive Services Speech SDK
MIT License
2.97k stars 1.86k forks source link

Unable to contact server. StatusCode: 1006, undefined Reason: Unexpected server response: 200 #2402

Open eilonmore opened 5 months ago

eilonmore commented 5 months ago

Hi

I am getting errors when the library initiates a connection via:

const conPromise = this.connectImpl();

The error I'm getting is: Unable to contact server. StatusCode: 1006, undefined Reason: Unexpected server response: 200.

Worth noting that the same requst, via simple curl, works fine:

curl --location 'https://swedencentral.api.cognitive.microsoft.com/speaker/verification/v2.0/text-independent/profiles' \
--header 'Ocp-Apim-Subscription-Key: XXXXXXXXXXX'

Code:

const speechConfig = sdk.SpeechConfig.fromSubscription(subscriptionKey, 'swedencentral');
const client = new sdk.VoiceProfileClient(speechConfig);

const profiles = await client.getAllProfilesAsync(
  sdk.VoiceProfileType.TextIndependentIdentification
);

Logs:

2024-06-02T08:37:25.633Z | ConnectingToServiceEvent | privName: ConnectingToServiceEvent | privEventId: DBFB5C0485E74307AE55F4FD98DCA776 | privEventTime: 2024-06-02T08:37:25.633Z | privEventType: 1 | privMetadata: {} | privRequestId: BE96FA2322A24D56AA5C96CB0B0B8A03 | privSessionId: 6064932B39494EF4A606982B8F8EA642 | privAuthFetchEventid: 36C74D06A2814375BED77FCD62B9492A
ConsoleLoggingListener.js:59
2024-06-02T08:37:25.644Z | ConnectionStartEvent | privName: ConnectionStartEvent | privEventId: E0439C1E977D46C596259E8846703888 | privEventTime: 2024-06-02T08:37:25.644Z | privEventType: 1 | privMetadata: {} | privConnectionId: 6064932B39494EF4A606982B8F8EA642 | privUri: wss://swedencentral.spr-frontend.speech.microsoft.com/speaker/ws/identification/text-independent/profile?format=simple&language=en-US&Ocp-Apim-Subscription-Key=XXXXXXXXXXXXXXXXXXXXX&X-ConnectionId=6064932B39494EF4A606982B8F8EA642&Apim-Subscription-Id=XXXXXXXXXXXXXXXXXXXXX | privHeaders: <NULL>
ConsoleLoggingListener.js:59
2024-06-02T08:37:26.056Z | ConnectionErrorEvent | privName: ConnectionErrorEvent | privEventId: 99FE99A7041A418B9F86BCDECACB8D4F | privEventTime: 2024-06-02T08:37:26.056Z | privEventType: 0 | privMetadata: {} | privConnectionId: 6064932B39494EF4A606982B8F8EA642 | privMessage: Unexpected server response: 200 | privType: error
ConsoleLoggingListener.js:55
2024-06-02T08:37:26.058Z | ConnectionStartEvent | privName: ConnectionStartEvent | privEventId: 747270A5771F4990B7412B7586BEDBB9 | privEventTime: 2024-06-02T08:37:26.058Z | privEventType: 1 | privMetadata: {} | privConnectionId: 6064932B39494EF4A606982B8F8EA642 | privUri: wss://swedencentral.spr-frontend.speech.microsoft.com/speaker/ws/identification/text-independent/profile?format=simple&language=en-US&Ocp-Apim-Subscription-Key=XXXXXXXXXXXXXXXXXXXXX&X-ConnectionId=6064932B39494EF4A606982B8F8EA642&Apim-Subscription-Id=XXXXXXXXXXXXXXXXXXXXX | privHeaders: <NULL>
ConsoleLoggingListener.js:59
2024-06-02T08:37:26.362Z | ConnectionErrorEvent | privName: ConnectionErrorEvent | privEventId: 0E982B092A4848779CB670019196D77B | privEventTime: 2024-06-02T08:37:26.362Z | privEventType: 0 | privMetadata: {} | privConnectionId: 6064932B39494EF4A606982B8F8EA642 | privMessage: Unexpected server response: 200 | privType: error
ConsoleLoggingListener.js:55
2024-06-02T08:37:26.367Z | ConnectionStartEvent | privName: ConnectionStartEvent | privEventId: 0FF60C67DBC043119C7F7DC56CA1CE17 | privEventTime: 2024-06-02T08:37:26.367Z | privEventType: 1 | privMetadata: {} | privConnectionId: 6064932B39494EF4A606982B8F8EA642 | privUri: wss://swedencentral.spr-frontend.speech.microsoft.com/speaker/ws/identification/text-independent/profile?format=simple&language=en-US&Ocp-Apim-Subscription-Key=XXXXXXXXXXXXXXXXXXXXX&X-ConnectionId=6064932B39494EF4A606982B8F8EA642&Apim-Subscription-Id=XXXXXXXXXXXXXXXXXXXXX | privHeaders: <NULL>
ConsoleLoggingListener.js:59
2024-06-02T08:37:26.652Z | ConnectionErrorEvent | privName: ConnectionErrorEvent | privEventId: 5D57DE3FFFA44913A6DDB35D305B51D4 | privEventTime: 2024-06-02T08:37:26.652Z | privEventType: 0 | privMetadata: {} | privConnectionId: 6064932B39494EF4A606982B8F8EA642 | privMessage: Unexpected server response: 200 | privType: error
ConsoleLoggingListener.js:55
2024-06-02T08:37:26.654Z | ConnectionStartEvent | privName: ConnectionStartEvent | privEventId: A23DB3BFC4D24C2E88168829F648CF0B | privEventTime: 2024-06-02T08:37:26.654Z | privEventType: 1 | privMetadata: {} | privConnectionId: 6064932B39494EF4A606982B8F8EA642 | privUri: wss://swedencentral.spr-frontend.speech.microsoft.com/speaker/ws/identification/text-independent/profile?format=simple&language=en-US&Ocp-Apim-Subscription-Key=XXXXXXXXXXXXXXXXXXXXX&X-ConnectionId=6064932B39494EF4A606982B8F8EA642&Apim-Subscription-Id=XXXXXXXXXXXXXXXXXXXXX | privHeaders: <NULL>
ConsoleLoggingListener.js:59
2024-06-02T08:37:26.934Z | ConnectionErrorEvent | privName: ConnectionErrorEvent | privEventId: 24EFB833D6B843AF842A3B8E3FAB541B | privEventTime: 2024-06-02T08:37:26.934Z | privEventType: 0 | privMetadata: {} | privConnectionId: 6064932B39494EF4A606982B8F8EA642 | privMessage: Unexpected server response: 200 | privType: error
ConsoleLoggingListener.js:55
2024-06-02T08:37:26.936Z | ConnectionStartEvent | privName: ConnectionStartEvent | privEventId: 818367DE1B87441C8A8EE95BCFEA6DCB | privEventTime: 2024-06-02T08:37:26.936Z | privEventType: 1 | privMetadata: {} | privConnectionId: 6064932B39494EF4A606982B8F8EA642 | privUri: wss://swedencentral.spr-frontend.speech.microsoft.com/speaker/ws/identification/text-independent/profile?format=simple&language=en-US&Ocp-Apim-Subscription-Key=XXXXXXXXXXXXXXXXXXXXX&X-ConnectionId=6064932B39494EF4A606982B8F8EA642&Apim-Subscription-Id=XXXXXXXXXXXXXXXXXXXXX | privHeaders: <NULL>
ConsoleLoggingListener.js:59
2024-06-02T08:37:27.209Z | ConnectionErrorEvent | privName: ConnectionErrorEvent | privEventId: 402256F413744E7CB8D4D6C2DCB52C9C | privEventTime: 2024-06-02T08:37:27.209Z | privEventType: 0 | privMetadata: {} | privConnectionId: 6064932B39494EF4A606982B8F8EA642 | privMessage: Unexpected server response: 200 | privType: error
ConsoleLoggingListener.js:55
err
eilonmore commented 5 months ago

Can you please guide me if there is anything missing from this ticket so we can figure it out?

github-actions[bot] commented 4 months ago

This item has been open without activity for 19 days. Provide a comment on status and remove "update needed" label.