Cognito SDK, Broken Pipe #2494
-
I have an issue when invoking Cognito Admin API calls with C++ SDK both from Lambda and from an external client. I am using the the AWS C++ SDK Version 1.11.75, but have experiences this with previous versions too. Approximately, 1 in 5 requests (eg AdminUpdateUserAttributes) the API call crashes with a broken pipe. A typical request (this one executed from a Cognito Post Login Trigger), looks like this: Aws::CognitoIdentityProvider::Model::AdminUpdateUserAttributesRequest request; request.SetUsername(username); request.SetUserPoolId(user_pool_id); request.SetUserAttributes({Aws::CognitoIdentityProvider::Model::AttributeType().WithName("custom:client_queue").WithValue(queue_url)}); auto outcome{m_idp_client.AdminUpdateUserAttributes(request)}; ... The SDK is initialized just with default options and Identity Provider Client is default constructed. Has anyone any ideas how to make this more reliable? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hi @sosRoland , You did not specify the OS and the configuration you use, I assume it is some linux with default curl and OpenSSL crypto libraries. Could you please check if setting Aws::SDKOptions.httpOptions.installSigPipeHandler option will fix your issue?
Also, from https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/basic-use.html#sdk-setting-options:
Best regards, |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for getting back so quickly. Yes for the AWS Lambda, it is Amazon Linux 2 running on x86, with CURL version 7.79.1 and OpenSSL 1.0.2k-fips (the build environment is AL2 ECR image to match the Lambda environment the closest). I have also experienced the same issue (different IDP API calls) on Ubuntu with CURL Version 7.81.0 and OpenSSL 3.0.2 15. Thank for you pointing me to the documentation on the Sig Pipe handler, I will read up on this and see if this gets me any further. Best Regards, |
Beta Was this translation helpful? Give feedback.
-
I just wanted to say thank you very much for your help, this works a treat. Would it be a good idea for the SDK to default configure this flag on Linux when using CURL/OpenSSL to default this to true. I am sure some CMake magic could do this? Regards, |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi @sosRoland ,
You did not specify the OS and the configuration you use, I assume it is some linux with default curl and OpenSSL crypto libraries.
Could you please check if setting Aws::SDKOptions.httpOptions.installSigPipeHandler option will fix your issue?
Also, from https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/basic-use.html#sdk-setting-options: