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

CaseClauseError: no case clause matching: {:error, "timeout"} in ExAws.Request.request_and_retry/7 #1010

Open
ryanbrainard opened this issue Oct 30, 2023 · 1 comment

Comments

@ryanbrainard
Copy link

Environment

  • Elixir & Erlang versions (elixir --version):
$ elixir --version
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]

Elixir 1.15.4 (compiled with Erlang/OTP 26)
  • ExAws version mix deps |grep ex_aws
$ mix deps |grep ex_aws
* ex_aws 2.4.4 (Hex package) (mix)
  locked at 2.4.4 (ex_aws) a7d63e48
* ex_aws_acm 1.0.1 (Hex package) (mix)
  locked at 1.0.1 (ex_aws_acm) cd1bdcb3
* ex_aws_kinesis 2.0.1 (Hex package) (mix)
  locked at 2.0.1 (ex_aws_kinesis) 7ba0e467
* ex_aws_kms 2.2.0 (Hex package) (mix)
  locked at 2.2.0 (ex_aws_kms) 9797e292
* ex_aws_s3 2.4.0 (Hex package) (mix)
  locked at 2.4.0 (ex_aws_s3) 85dda6e2
* ex_aws_secretsmanager 2.0.0 (Hex package) (mix)
  locked at 2.0.0 (ex_aws_secretsmanager) 8b2838af
* ex_aws_sts 2.3.0 (Hex package) (mix)
  locked at 2.3.0 (ex_aws_sts) f14e4c7d
  • HTTP client version. IE for hackney do mix deps | grep hackney
$ mix deps | grep tesla
* opentelemetry_tesla 2.2.0 (Hex package) (mix)
  locked at 2.2.0 (opentelemetry_tesla) 4cad0380
* tesla 1.7.0 (Hex package) (mix)
  locked at 1.7.0 (tesla) 2e64f01e

Current behavior

Include code samples, errors and stacktraces if appropriate.

When calling ExAws.request/2 (in this case with ExAws.SecretsManager.create_secret/4 operation) and a timeout occurs, ExAws.Request.request_and_retry/7 does not have a matching case statement, so fails:

CaseClauseError: no case clause matching: {:error, "timeout"}
ExAws.Request.request_and_retry/7 (ex_aws)(lib/ex_aws/request.ex:38)

ExAws.Operation.ExAws.Operation.JSON.perform/2 (ex_aws)(lib/ex_aws/operation/json.ex:50)

MyApp.EnvVar.create_secret_in_aws/4 (myapp)(lib/myapp/instances/env_var.ex:172)

Note, these timeouts are rare and transient. This same app code works 100s of times a day, but occasionally like this apparently from either a network or AWS failure.

Expected behavior

I would expect timeouts to either be retried or gracefully return an error.

@ryanbrainard
Copy link
Author

ryanbrainard commented Oct 30, 2023

Looking at past occurances, this error also happens for CaseClauseError no case clause matching: {:error, "socket closed"} in the same location. It would be good to fix both of these together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant