awsdocs / aws-doc-sdk-examples

Welcome to the AWS Code Examples Repository. This repo contains code examples used in the AWS documentation, AWS SDK Developer Guides, and more. For more information, see the Readme.md file below.
Apache License 2.0
9.5k stars 5.61k forks source link

[Bug]: Transcribe C++ example fails #5707

Closed paolostefan closed 9 months ago

paolostefan commented 10 months ago

Expected behavior

The cpp/example_code/transcribe/get_transcript.cpp should make calls to the Transcribe API and get a valid transcription of the audio file.

Actual behavior

The built get_transcript.exe enters an error loop saying:

Starting...
ERROR: A complete signal was sent without the preceding empty frame.
Failed to create a stream
Failed to send an empty frame
ERROR: A complete signal was sent without the preceding empty frame.
...

Steps to reproduce

1. Install vcpkg
2. Install zlib, curl and openssl using vcpkg
3. Build the AWS CPP SDK from sources with curl support
4. Clone this repo and -with powershell - cd to its root dir
5. Save the following code to a .ps1 script

# Build transcribe example
$buildPath = "build"
$transcribePath = "$buildPath\transcribe"

if (-not (Test-Path -Path $buildPath)) {
  mkdir $buildPath
}

if (-not (Test-Path -Path $transcribePath)) {
  mkdir $transcribePath
}

cd $transcribePath

# Set $buildType to "Debug" if you built AWS SDK in Debug mode
$buildType = "Release"
cmake ..\..\transcribe\ -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=$buildType
cmake --build . --config $buildType

if (-not (Test-Path -Path "$buildType\.media")) {
  mkdir "$buildType\.media"
}

copy ..\..\transcribe\.media\*.wav "$buildType\.media\"
# Run transcribe example
echo "Running transcribe example"
cd .\$buildType
.\get_transcript.exe

# Print out return code
# unfortunately, this part is never reached as the exe enters a death loop
echo "Transcribe example finished with return code $LASTEXITCODE"

cd ..\..\..\

6. Run the script you saved at step 5

Logs / stacktrace (if applicable)

[INFO] 2023-11-24 09:37:56.645 Aws_Init_Cleanup [2820] Initiate AWS SDK for C++ with Version:1.11.207
[TRACE] 2023-11-24 09:37:56.645 FileSystem [2820] Checking USERPROFILE for the home directory.
[DEBUG] 2023-11-24 09:37:56.645 FileSystem [2820] Environment value for variable USERPROFILE is C:\Users\paolo.stefan
[INFO] 2023-11-24 09:37:56.645 Aws::Config::AWSConfigFileProfileConfigLoader [2820] Initializing config loader against fileName C:\Users\paolo.stefan\.aws\credentials and using profilePrefix = 0
[TRACE] 2023-11-24 09:37:56.645 FileSystem [2820] Checking USERPROFILE for the home directory.
[DEBUG] 2023-11-24 09:37:56.645 FileSystem [2820] Environment value for variable USERPROFILE is C:\Users\paolo.stefan
[INFO] 2023-11-24 09:37:56.645 Aws::Config::AWSConfigFileProfileConfigLoader [2820] Initializing config loader against fileName C:\Users\paolo.stefan\.aws\config and using profilePrefix = 1
[TRACE] 2023-11-24 09:37:56.645 FileSystem [2820] Checking USERPROFILE for the home directory.
[DEBUG] 2023-11-24 09:37:56.645 FileSystem [2820] Environment value for variable USERPROFILE is C:\Users\paolo.stefan
[INFO] 2023-11-24 09:37:56.645 Aws::Config::ConfigFileProfileFSM [2820] Unknown property: aws_access_key_id in the profile: default
[INFO] 2023-11-24 09:37:56.645 Aws::Config::ConfigFileProfileFSM [2820] Unknown property: aws_secret_access_key in the profile: default
[DEBUG] 2023-11-24 09:37:56.645 Aws::Config::ConfigFileProfileFSM [2820] found access key AKIAW5U63C4L3JA6MD5D
[INFO] 2023-11-24 09:37:56.645 Aws::Config::AWSProfileConfigLoaderBase [2820] Successfully reloaded configuration.
[TRACE] 2023-11-24 09:37:56.645 Aws::Config::AWSProfileConfigLoaderBase [2820] reloaded config at 2023-11-24T09:37:56Z
[TRACE] 2023-11-24 09:37:56.645 FileSystem [2820] Checking USERPROFILE for the home directory.
[DEBUG] 2023-11-24 09:37:56.645 FileSystem [2820] Environment value for variable USERPROFILE is C:\Users\paolo.stefan
[DEBUG] 2023-11-24 09:37:56.645 Aws::Config::ConfigFileProfileFSM [2820] Found region eu-central-1
[INFO] 2023-11-24 09:37:56.645 Aws::Config::AWSProfileConfigLoaderBase [2820] Successfully reloaded configuration.
[TRACE] 2023-11-24 09:37:56.645 Aws::Config::AWSProfileConfigLoaderBase [2820] reloaded config at 2023-11-24T09:37:56Z
[INFO] 2023-11-24 09:37:56.645 event-loop [2820] id=0000022836DB4430: Initializing IO Completion Port
[INFO] 2023-11-24 09:37:56.645 event-loop [2820] id=0000022836DB4430: Starting event-loop thread.
[INFO] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DB61A8: cpu affinity of cpu_id 0 was specified, attempting to honor the value.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DB61A8: computed mask 1 on group 0.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DB61A8: SetThreadGroupAffinity() result 1.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DB61A8: SetThreadIdealProcessorEx() result 1.
[INFO] 2023-11-24 09:37:56.645 event-loop [2820] id=0000022836DB4D90: Initializing IO Completion Port
[INFO] 2023-11-24 09:37:56.645 event-loop [2820] id=0000022836DB4D90: Starting event-loop thread.
[INFO] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DC7A58: cpu affinity of cpu_id 0 was specified, attempting to honor the value.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DC7A58: computed mask 1 on group 0.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DC7A58: SetThreadGroupAffinity() result 1.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DC7A58: SetThreadIdealProcessorEx() result 1.
[INFO] 2023-11-24 09:37:56.645 event-loop [2820] id=0000022836DB4930: Initializing IO Completion Port
[INFO] 2023-11-24 09:37:56.645 event-loop [2820] id=0000022836DB4930: Starting event-loop thread.
[INFO] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DCAAD8: cpu affinity of cpu_id 0 was specified, attempting to honor the value.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DCAAD8: computed mask 1 on group 0.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DCAAD8: SetThreadGroupAffinity() result 1.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DCAAD8: SetThreadIdealProcessorEx() result 1.
[INFO] 2023-11-24 09:37:56.645 event-loop [2820] id=0000022836DB3FD0: Initializing IO Completion Port
[INFO] 2023-11-24 09:37:56.645 event-loop [2820] id=0000022836DB3FD0: Starting event-loop thread.
[INFO] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DCE998: cpu affinity of cpu_id 0 was specified, attempting to honor the value.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DCE998: computed mask 1 on group 0.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DCE998: SetThreadGroupAffinity() result 1.
[DEBUG] 2023-11-24 09:37:56.645 thread [2820] id=0000022836DCE998: SetThreadIdealProcessorEx() result 1.
[INFO] 2023-11-24 09:37:56.645 event-loop [2820] id=0000022836DB4E30: Initializing IO Completion Port
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB4E30: Starting event-loop thread.
[INFO] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DC7F08: cpu affinity of cpu_id 0 was specified, attempting to honor the value.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DC7F08: computed mask 1 on group 0.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DC7F08: SetThreadGroupAffinity() result 1.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DC7F08: SetThreadIdealProcessorEx() result 1.
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB42A0: Initializing IO Completion Port
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB42A0: Starting event-loop thread.
[INFO] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DD87A8: cpu affinity of cpu_id 0 was specified, attempting to honor the value.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DD87A8: computed mask 1 on group 0.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DD87A8: SetThreadGroupAffinity() result 1.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DD87A8: SetThreadIdealProcessorEx() result 1.
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB4660: Initializing IO Completion Port
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB4660: Starting event-loop thread.
[INFO] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDA598: cpu affinity of cpu_id 0 was specified, attempting to honor the value.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDA598: computed mask 1 on group 0.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDA598: SetThreadGroupAffinity() result 1.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDA598: SetThreadIdealProcessorEx() result 1.
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB4A70: Initializing IO Completion Port
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB4A70: Starting event-loop thread.
[INFO] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC6D8: cpu affinity of cpu_id 0 was specified, attempting to honor the value.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC6D8: computed mask 1 on group 0.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC6D8: SetThreadGroupAffinity() result 1.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC6D8: SetThreadIdealProcessorEx() result 1.
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB4AC0: Initializing IO Completion Port
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB4AC0: Starting event-loop thread.
[INFO] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC588: cpu affinity of cpu_id 0 was specified, attempting to honor the value.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC588: computed mask 1 on group 0.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC588: SetThreadGroupAffinity() result 1.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC588: SetThreadIdealProcessorEx() result 1.
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB4750: Initializing IO Completion Port
[INFO] 2023-11-24 09:37:56.646 event-loop [2820] id=0000022836DB4750: Starting event-loop thread.
[INFO] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC048: cpu affinity of cpu_id 0 was specified, attempting to honor the value.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC048: computed mask 1 on group 0.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC048: SetThreadGroupAffinity() result 1.
[DEBUG] 2023-11-24 09:37:56.646 thread [2820] id=0000022836DDC048: SetThreadIdealProcessorEx() result 1.
[INFO] 2023-11-24 09:37:56.646 dns [2820] id=0000022836DCB850: Initializing default host resolver with 8 max host entries.
[INFO] 2023-11-24 09:37:56.646 channel-bootstrap [2820] id=0000022836DC96A0: Initializing client bootstrap with event-loop group 0000022836DAB760
[INFO] 2023-11-24 09:37:56.646 event-loop [15356] id=0000022836DB4D90: main loop started
[INFO] 2023-11-24 09:37:56.646 event-loop [15356] id=0000022836DB4D90: default timeout 100000
[TRACE] 2023-11-24 09:37:56.646 event-loop [15356] id=0000022836DB4D90: waiting for a maximum of 100000 ms
[INFO] 2023-11-24 09:37:56.646 event-loop [5712] id=0000022836DB4660: main loop started
[INFO] 2023-11-24 09:37:56.646 event-loop [5712] id=0000022836DB4660: default timeout 100000
[INFO] 2023-11-24 09:37:56.646 event-loop [19840] id=0000022836DB4930: main loop started
[INFO] 2023-11-24 09:37:56.646 event-loop [19840] id=0000022836DB4930: default timeout 100000
[TRACE] 2023-11-24 09:37:56.646 event-loop [19840] id=0000022836DB4930: waiting for a maximum of 100000 ms
[TRACE] 2023-11-24 09:37:56.646 event-loop [5712] id=0000022836DB4660: waiting for a maximum of 100000 ms
[INFO] 2023-11-24 09:37:56.646 event-loop [3192] id=0000022836DB3FD0: main loop started
[INFO] 2023-11-24 09:37:56.646 event-loop [3192] id=0000022836DB3FD0: default timeout 100000
[TRACE] 2023-11-24 09:37:56.646 event-loop [3192] id=0000022836DB3FD0: waiting for a maximum of 100000 ms
[INFO] 2023-11-24 09:37:56.646 event-loop [9560] id=0000022836DB4E30: main loop started
[INFO] 2023-11-24 09:37:56.646 event-loop [9560] id=0000022836DB4E30: default timeout 100000
[TRACE] 2023-11-24 09:37:56.646 event-loop [9560] id=0000022836DB4E30: waiting for a maximum of 100000 ms
[INFO] 2023-11-24 09:37:56.646 event-loop [3680] id=0000022836DB4430: main loop started
[INFO] 2023-11-24 09:37:56.646 event-loop [3680] id=0000022836DB4430: default timeout 100000
[TRACE] 2023-11-24 09:37:56.646 event-loop [3680] id=0000022836DB4430: waiting for a maximum of 100000 ms
[INFO] 2023-11-24 09:37:56.646 event-loop [14024] id=0000022836DB42A0: main loop started
[INFO] 2023-11-24 09:37:56.646 event-loop [14024] id=0000022836DB42A0: default timeout 100000
[TRACE] 2023-11-24 09:37:56.646 event-loop [14024] id=0000022836DB42A0: waiting for a maximum of 100000 ms
[INFO] 2023-11-24 09:37:56.646 event-loop [14040] id=0000022836DB4A70: main loop started
[INFO] 2023-11-24 09:37:56.646 event-loop [14040] id=0000022836DB4A70: default timeout 100000
[TRACE] 2023-11-24 09:37:56.646 event-loop [14040] id=0000022836DB4A70: waiting for a maximum of 100000 ms
[INFO] 2023-11-24 09:37:56.646 event-loop [14896] id=0000022836DB4AC0: main loop started
[INFO] 2023-11-24 09:37:56.646 event-loop [14896] id=0000022836DB4AC0: default timeout 100000
[TRACE] 2023-11-24 09:37:56.646 event-loop [14896] id=0000022836DB4AC0: waiting for a maximum of 100000 ms
[DEBUG] 2023-11-24 09:37:56.646 HttpClientFactory [2820] Initializing Http Static State
[DEBUG] 2023-11-24 09:37:56.646 HttpClientFactory [2820] Initializing Curl Http Client
[INFO] 2023-11-24 09:37:56.646 CurlHttpClient [2820] Initializing Curl library with version: 8.4.0-DEV, ssl version: Schannel
[INFO] 2023-11-24 09:37:56.646 event-loop [6408] id=0000022836DB4750: main loop started
[INFO] 2023-11-24 09:37:56.646 event-loop [6408] id=0000022836DB4750: default timeout 100000
[TRACE] 2023-11-24 09:37:56.646 event-loop [6408] id=0000022836DB4750: waiting for a maximum of 100000 ms
[INFO] 2023-11-24 09:37:56.647 EC2MetadataClient [2820] Using IMDS endpoint: http://169.254.169.254
[DEBUG] 2023-11-24 09:37:56.647 ClientConfiguration [2820] Request Compression enabled
[DEBUG] 2023-11-24 09:37:56.647 ClientConfiguration [2820] ClientConfiguration will use MinReqCompression: 10240
[DEBUG] 2023-11-24 09:37:56.647 ClientConfiguration [2820] ClientConfiguration will use SDK Auto Resolved profile: [default] if not specified by users.
[INFO] 2023-11-24 09:37:56.647 ClientConfiguration [2820] Retry Strategy will use the default max attempts.
[INFO] 2023-11-24 09:37:56.648 EC2MetadataClient [2820] Creating AWSHttpResourceClient with max connections 2 and scheme http
[INFO] 2023-11-24 09:37:56.648 CurlHandleContainer [2820] Initializing CurlHandleContainer with size 2
[DEBUG] 2023-11-24 09:37:56.648 ClientConfiguration [2820] Request Compression enabled
[DEBUG] 2023-11-24 09:37:56.648 ClientConfiguration [2820] ClientConfiguration will use MinReqCompression: 10240
[DEBUG] 2023-11-24 09:37:56.648 ClientConfiguration [2820] ClientConfiguration will use SDK Auto Resolved profile: [default] if not specified by users.
[INFO] 2023-11-24 09:37:56.648 ClientConfiguration [2820] Retry Strategy will use the default max attempts.
[TRACE] 2023-11-24 09:37:56.648 FileSystem [2820] Checking USERPROFILE for the home directory.
[DEBUG] 2023-11-24 09:37:56.648 FileSystem [2820] Environment value for variable USERPROFILE is C:\Users\paolo.stefan
[INFO] 2023-11-24 09:37:56.648 Aws::Config::AWSConfigFileProfileConfigLoader [2820] Initializing config loader against fileName C:\Users\paolo.stefan\.aws\credentials and using profilePrefix = 0
[TRACE] 2023-11-24 09:37:56.648 FileSystem [2820] Checking USERPROFILE for the home directory.
[DEBUG] 2023-11-24 09:37:56.648 FileSystem [2820] Environment value for variable USERPROFILE is C:\Users\paolo.stefan
[TRACE] 2023-11-24 09:37:56.648 FileSystem [2820] Checking USERPROFILE for the home directory.
[DEBUG] 2023-11-24 09:37:56.648 FileSystem [2820] Environment value for variable USERPROFILE is C:\Users\paolo.stefan
[INFO] 2023-11-24 09:37:56.648 ProfileConfigFileAWSCredentialsProvider [2820] Setting provider to read credentials from C:\Users\paolo.stefan\.aws\credentials for credentials file and C:\Users\paolo.stefan\.aws\config for the config file , for use with profile default
[INFO] 2023-11-24 09:37:56.648 ProcessCredentialsProvider [2820] Setting process credentials provider to read config from default
[WARN] 2023-11-24 09:37:56.648 STSAssumeRoleWithWebIdentityCredentialsProvider [2820] Token file must be specified to use STS AssumeRole web identity creds provider.
[INFO] 2023-11-24 09:37:56.648 SSOBearerTokenProvider [2820] Setting sso bearerToken provider to read config from default
[INFO] 2023-11-24 09:37:56.648 SSOCredentialsProvider [2820] Setting sso credentials provider to read config from default
[DEBUG] 2023-11-24 09:37:56.648 DefaultAWSCredentialsProviderChain [2820] The environment variable value AWS_CONTAINER_CREDENTIALS_RELATIVE_URI is 
[DEBUG] 2023-11-24 09:37:56.648 DefaultAWSCredentialsProviderChain [2820] The environment variable value AWS_CONTAINER_CREDENTIALS_FULL_URI is 
[DEBUG] 2023-11-24 09:37:56.648 DefaultAWSCredentialsProviderChain [2820] The environment variable value AWS_EC2_METADATA_DISABLED is 
[INFO] 2023-11-24 09:37:56.648 InstanceProfileCredentialsProvider [2820] Creating Instance with default EC2MetadataClient and refresh rate 300000
[INFO] 2023-11-24 09:37:56.648 DefaultAWSCredentialsProviderChain [2820] Added EC2 metadata service credentials provider to the provider chain.
[INFO] 2023-11-24 09:37:56.648 Aws::Config::ConfigFileProfileFSM [2820] Unknown property: aws_access_key_id in the profile: default
[INFO] 2023-11-24 09:37:56.648 Aws::Config::ConfigFileProfileFSM [2820] Unknown property: aws_secret_access_key in the profile: default
[DEBUG] 2023-11-24 09:37:56.648 Aws::Config::ConfigFileProfileFSM [2820] found access key AKIAW5U63C4L3JA6MD5D
[INFO] 2023-11-24 09:37:56.648 Aws::Config::AWSProfileConfigLoaderBase [2820] Successfully reloaded configuration.
[TRACE] 2023-11-24 09:37:56.648 Aws::Config::AWSProfileConfigLoaderBase [2820] reloaded config at 2023-11-24T09:37:56Z
[INFO] 2023-11-24 09:37:56.648 CurlHandleContainer [2820] Initializing CurlHandleContainer with size 25
[TRACE] 2023-11-24 09:37:56.649 Aws::Endpoint::DefaultEndpointProvider [2820] Endpoint str eval parameter: Region = eu-central-1
[TRACE] 2023-11-24 09:37:56.649 Aws::Endpoint::DefaultEndpointProvider [2820] Endpoint bool eval parameter: UseFIPS = 0
[TRACE] 2023-11-24 09:37:56.649 Aws::Endpoint::DefaultEndpointProvider [2820] Endpoint bool eval parameter: UseDualStack = 0
[DEBUG] 2023-11-24 09:37:56.649 Unknown [2820] Resolved endpoint with status 0
[DEBUG] 2023-11-24 09:37:56.649 Aws::Endpoint::DefaultEndpointProvider [2820] Endpoint rules engine evaluated the endpoint: https://transcribestreaming.eu-central-1.amazonaws.com
[DEBUG] 2023-11-24 09:37:56.649 AWSAuthEventStreamV4Signer [24420] Canonical Header String: amz-sdk-invocation-id:E5C33729-84B7-41C8-8CC0-2305E7A3AB79
amz-sdk-request:attempt=1
content-type:application/vnd.amazon.eventstream
host:transcribestreaming.eu-central-1.amazonaws.com
x-amz-api-version:2017-10-26
x-amz-content-sha256:STREAMING-AWS4-HMAC-SHA256-EVENTS
x-amz-date:20231124T093756Z
x-amzn-transcribe-language-code:en-US
x-amzn-transcribe-media-encoding:pcm
x-amzn-transcribe-sample-rate:8000

[DEBUG] 2023-11-24 09:37:56.649 AWSAuthEventStreamV4Signer [24420] Signed Headers value:amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date;x-amzn-transcribe-language-code;x-amzn-transcribe-media-encoding;x-amzn-transcribe-sample-rate
[DEBUG] 2023-11-24 09:37:56.649 AWSAuthEventStreamV4Signer [24420] Canonical Request String: POST
/stream-transcription

amz-sdk-invocation-id:E5C33729-84B7-41C8-8CC0-2305E7A3AB79
amz-sdk-request:attempt=1
content-type:application/vnd.amazon.eventstream
host:transcribestreaming.eu-central-1.amazonaws.com
x-amz-api-version:2017-10-26
x-amz-content-sha256:STREAMING-AWS4-HMAC-SHA256-EVENTS
x-amz-date:20231124T093756Z
x-amzn-transcribe-language-code:en-US
x-amzn-transcribe-media-encoding:pcm
x-amzn-transcribe-sample-rate:8000

amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date;x-amzn-transcribe-language-code;x-amzn-transcribe-media-encoding;x-amzn-transcribe-sample-rate
STREAMING-AWS4-HMAC-SHA256-EVENTS
[DEBUG] 2023-11-24 09:37:56.649 AWSAuthEventStreamV4Signer [24420] Final String to sign: AWS4-HMAC-SHA256
20231124T093756Z
20231124/eu-central-1/transcribe/aws4_request
6a4292907c34000a3bb99acb2ec26115515695d4de6e13846f778b91d1169dff
[DEBUG] 2023-11-24 09:37:56.649 AWSAuthEventStreamV4Signer [24420] Signing request with: AWS4-HMAC-SHA256 Credential=AKIAW5U63C4L3JA6MD5D/20231124/eu-central-1/transcribe/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date;x-amzn-transcribe-language-code;x-amzn-transcribe-media-encoding;x-amzn-transcribe-sample-rate, Signature=31b4e31641480d209372b1186eef0afff311d7fcb925692a336ea2cb788a2f61
[DEBUG] 2023-11-24 09:37:56.649 AWSClient [24420] Request Successfully signed
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] Making request to https://transcribestreaming.eu-central-1.amazonaws.com/stream-transcription
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] Including headers:
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] amz-sdk-invocation-id: E5C33729-84B7-41C8-8CC0-2305E7A3AB79
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] amz-sdk-request: attempt=1
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] authorization: AWS4-HMAC-SHA256 Credential=AKIAW5U63C4L3JA6MD5D/20231124/eu-central-1/transcribe/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date;x-amzn-transcribe-language-code;x-amzn-transcribe-media-encoding;x-amzn-transcribe-sample-rate, Signature=31b4e31641480d209372b1186eef0afff311d7fcb925692a336ea2cb788a2f61
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] content-type: application/vnd.amazon.eventstream
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] host: transcribestreaming.eu-central-1.amazonaws.com
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] user-agent: aws-sdk-cpp/1.11.207 ua/2.0 md/aws-crt#0.24.7 os/Windows#10.0.22621.2428 md/arch#AMD64 lang/c++#C++199711L md/MSVC#1938 cfg/retry-mode#default api/Transcribe_Streaming
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] x-amz-api-version: 2017-10-26
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] x-amz-content-sha256: STREAMING-AWS4-HMAC-SHA256-EVENTS
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] x-amz-date: 20231124T093756Z
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] x-amzn-transcribe-language-code: en-US
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] x-amzn-transcribe-media-encoding: pcm
[TRACE] 2023-11-24 09:37:56.649 CurlHttpClient [24420] x-amzn-transcribe-sample-rate: 8000
[DEBUG] 2023-11-24 09:37:56.649 CurlHandleContainer [24420] Attempting to acquire curl connection.
[DEBUG] 2023-11-24 09:37:56.649 CurlHandleContainer [24420] No current connections available in pool. Attempting to create new connections.
[DEBUG] 2023-11-24 09:37:56.649 CurlHandleContainer [24420] attempting to grow pool size by 2
[INFO] 2023-11-24 09:37:56.649 CurlHandleContainer [24420] Pool grown by 2
[DEBUG] 2023-11-24 09:37:56.649 CurlHandleContainer [24420] Connection has been released. Continuing.
[DEBUG] 2023-11-24 09:37:56.649 CurlHandleContainer [24420] Returning connection handle 0000022836E26F00
[DEBUG] 2023-11-24 09:37:56.649 CurlHttpClient [24420] Obtained connection handle 0000022836E26F00
[DEBUG] 2023-11-24 09:37:56.649 CURL [24420] (Text) WARNING: failed to open cookie file ""

[DEBUG] 2023-11-24 09:37:56.649 AWSAuthEventStreamV4Signer [2820] Payload hash  - e2d57400f68f51993a10dc0c00441ebebb0ab0ba9ec8ba68f9181a5d98bf1b1c
[DEBUG] 2023-11-24 09:37:56.649 AWSAuthEventStreamV4Signer [2820] Final String to sign: AWS4-HMAC-SHA256-PAYLOAD
20231124T093756Z
20231124/eu-central-1/transcribe/aws4_request
31b4e31641480d209372b1186eef0afff311d7fcb925692a336ea2cb788a2f61
0ef886512dc7e740dbfb68a7a3b58aebaac3ad38d7f029d9303b0ac914d1e7d3
e2d57400f68f51993a10dc0c00441ebebb0ab0ba9ec8ba68f9181a5d98bf1b1c
[DEBUG] 2023-11-24 09:37:56.649 AWSAuthEventStreamV4Signer [2820] Final computed signing hash: ab0a37c90a886dafa983c13d3c826abf6b616664d0222de6e6e8eb47f6b15df0
[INFO] 2023-11-24 09:37:56.649 AWSAuthEventStreamV4Signer [2820] Event chunk final signature - ab0a37c90a886dafa983c13d3c826abf6b616664d0222de6e6e8eb47f6b15df0
[TRACE] 2023-11-24 09:37:56.650 ConcurrentStreamBuf [24420] Stream characters in buffer: 1024
[DEBUG] 2023-11-24 09:37:56.654 CURL [24420] (Text)   Trying 18.158.179.42:443...

[DEBUG] 2023-11-24 09:37:56.680 AWSAuthEventStreamV4Signer [2820] Payload hash  - 6fee3cc51d84cd2eb07e22ffa6c2de2716f6618075a808fd6574c6699a046c6d
[DEBUG] 2023-11-24 09:37:56.680 AWSAuthEventStreamV4Signer [2820] Final String to sign: AWS4-HMAC-SHA256-PAYLOAD
20231124T093756Z
20231124/eu-central-1/transcribe/aws4_request
ab0a37c90a886dafa983c13d3c826abf6b616664d0222de6e6e8eb47f6b15df0
4aaa168a24e3dfe4dd70c58a1cf5c40a0fca59189526d0c9df92bb256681df89
6fee3cc51d84cd2eb07e22ffa6c2de2716f6618075a808fd6574c6699a046c6d
[DEBUG] 2023-11-24 09:37:56.680 AWSAuthEventStreamV4Signer [2820] Final computed signing hash: fc5fb6871065dec48c6eafab3c3e21b9303edff599a457cdacf609738d7bdbd1
[INFO] 2023-11-24 09:37:56.680 AWSAuthEventStreamV4Signer [2820] Event chunk final signature - fc5fb6871065dec48c6eafab3c3e21b9303edff599a457cdacf609738d7bdbd1
[DEBUG] 2023-11-24 09:37:56.711 CURL [24420] (Text) Connected to transcribestreaming.eu-central-1.amazonaws.com (18.158.179.42) port 443

[DEBUG] 2023-11-24 09:37:56.711 AWSAuthEventStreamV4Signer [2820] Payload hash  - 6fee3cc51d84cd2eb07e22ffa6c2de2716f6618075a808fd6574c6699a046c6d
[DEBUG] 2023-11-24 09:37:56.711 CURL [24420] (Text) schannel: disabled automatic use of client certificate

[DEBUG] 2023-11-24 09:37:56.711 AWSAuthEventStreamV4Signer [2820] Final String to sign: AWS4-HMAC-SHA256-PAYLOAD
20231124T093756Z
20231124/eu-central-1/transcribe/aws4_request
fc5fb6871065dec48c6eafab3c3e21b9303edff599a457cdacf609738d7bdbd1
18e84baac67bd6ebbc87bf7757f001d5f2300e04895a383a2b74f988807aa38e
6fee3cc51d84cd2eb07e22ffa6c2de2716f6618075a808fd6574c6699a046c6d
[DEBUG] 2023-11-24 09:37:56.711 AWSAuthEventStreamV4Signer [2820] Final computed signing hash: 5f178882d0b5509b06bdd0c06029a353521437e2b2c91b000c2db2188013ce57
[INFO] 2023-11-24 09:37:56.711 AWSAuthEventStreamV4Signer [2820] Event chunk final signature - 5f178882d0b5509b06bdd0c06029a353521437e2b2c91b000c2db2188013ce57
[DEBUG] 2023-11-24 09:37:56.712 CURL [24420] (Text) ALPN: curl offers http/1.1

[DEBUG] 2023-11-24 09:37:56.784 CURL [24420] (Text) schannel: added 141 certificate(s) from CA file 'C:/curl-ca-bundle.crt'

[DEBUG] 2023-11-24 09:37:56.799 CURL [24420] (Text) schannel: connection hostname (transcribestreaming.eu-central-1.amazonaws.com) validated against certificate name (transcribestreaming.eu-central-1.amazonaws.com)

[DEBUG] 2023-11-24 09:37:56.800 CURL [24420] (Text) ALPN: server did not agree on a protocol. Uses default.

[DEBUG] 2023-11-24 09:37:56.800 CURL [24420] (Text) using HTTP/1.x

[DEBUG] 2023-11-24 09:37:56.800 CURL [24420] (HeaderOut) POST /stream-transcription HTTP/1.1

Host: transcribestreaming.eu-central-1.amazonaws.com

Accept: */*

amz-sdk-invocation-id: E5C33729-84B7-41C8-8CC0-2305E7A3AB79

amz-sdk-request: attempt=1

authorization: AWS4-HMAC-SHA256 Credential=AKIAW5U63C4L3JA6MD5D/20231124/eu-central-1/transcribe/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date;x-amzn-transcribe-language-code;x-amzn-transcribe-media-encoding;x-amzn-transcribe-sample-rate, Signature=31b4e31641480d209372b1186eef0afff311d7fcb925692a336ea2cb788a2f61

content-type: application/vnd.amazon.eventstream

user-agent: aws-sdk-cpp/1.11.207 ua/2.0 md/aws-crt#0.24.7 os/Windows#10.0.22621.2428 md/arch#AMD64 lang/c++#C++199711L md/MSVC#1938 cfg/retry-mode#default api/Transcribe_Streaming

x-amz-api-version: 2017-10-26

x-amz-content-sha256: STREAMING-AWS4-HMAC-SHA256-EVENTS

x-amz-date: 20231124T093756Z

x-amzn-transcribe-language-code: en-US

x-amzn-transcribe-media-encoding: pcm

x-amzn-transcribe-sample-rate: 8000

Expect: 100-continue

[DEBUG] 2023-11-24 09:37:56.877 CURL [24420] (HeaderIn) HTTP/1.1 100 Continue

[TRACE] 2023-11-24 09:37:56.877 CurlHttpClient [24420] HTTP/1.1 100 Continue

[TRACE] 2023-11-24 09:37:56.877 CurlHttpClient [24420] 

[DEBUG] 2023-11-24 09:37:56.877 CURL [24420] (DataOut)

Which SDK were you using?

C++

Which OS were you using?

Windows

SDK version

1.11.207

OS version

Windows 11

jmklix commented 10 months ago

Which version of curl/openssl are you using? This has been reported as a problem here and using the system curl fixed their issue. Looking though that issue might help you fix your bug

paolostefan commented 10 months ago

Curl version is 8.4.0-DEV, as mentioned in the logs above:

[INFO] 2023-11-24 09:37:56.646 CurlHttpClient [2820] Initializing Curl library with version: 8.4.0-DEV, ssl version: Schannel

Openssl version is 3.1.4 .

Which version of curl/openssl are you using? This has been reported as a problem here and using the system curl fixed their issue. Looking though that issue might help you fix your bug

BTW, in the (terrible) online docs there's no mention of how one could use the "system" curl under Windows (but anyway, I don't think it would be possible to use it without a C++ header telling my program how to call curl functions).

meyertst-aws commented 10 months ago

Because you are on Windows, there is no "system curl". Windows has WinHTTP instead.

However, WinHTTP 1.0 does not support HTTP/2 bidirectional streaming, which is required for some AWS services such as Amazon Transcribe and Amazon Lex.

https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup-windows.html

This curl build worked on Windows with SDK 1.11.207

Initializing Curl library with version: 8.4.0, ssl version: OpenSSL/3.1.4 (Schannel)

Downloaded from https://curl.se/windows/

paolostefan commented 10 months ago

Because you are on Windows, there is no "system curl". Windows has WinHTTP instead.

However, WinHTTP 1.0 does not support HTTP/2 bidirectional streaming, which is required for some AWS services such as Amazon Transcribe and Amazon Lex.

https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup-windows.html

Yes, I've read these docs. I did exactly what they said. BUT, nothing worked, so I resorted to using vcpkg to download and install both Curl and Openssl. AND, nothing is working yet, that's why I opened this issue.

meyertst-aws commented 9 months ago

This does not appear to be a code examples' library issue.