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

Error on SES SendRawEmail without Destinations specified #6287

Open
mmastika opened this issue Jun 16, 2022 · 1 comment
Open

Error on SES SendRawEmail without Destinations specified #6287

mmastika opened this issue Jun 16, 2022 · 1 comment
Assignees
Labels
aws:ses good first issue status: confirmed type: bug

Comments

@mmastika
Copy link

@mmastika mmastika commented Jun 16, 2022

Hi there,

We're in the process of isolating our build to use LocalStack. In the process we stumbled on an issue where LocalStack would fail with 500 error on SendRawEmail.

We're able to isolate the issue to what appears to be a LocalStack issue. According to a post on StackOverflow, for us to use SendRawEmail and to specify TO, CC and BCC, we must specify it on the on the message/email header, then we MUST not set destinations. This works as expected when we have AWS to test as well as in Production. LocalStack however, produces the following error:

2022-06-16T08:26:27.149:WARNING:localstack.utils.server.http2_server: Error in proxy handler for request POST http://localhost:4566/: object of type 'NoneType' has no len() Traceback (most recent call last):
  File "/opt/code/localstack/localstack/utils/server/http2_server.py", line 185, in index
    result = await run_sync(handler, request, data)
  File "/opt/code/localstack/localstack/utils/asyncio.py", line 85, in run_sync
    return await loop.run_in_executor(thread_pool, copy_context().run, func_wrapped)
  File "/opt/code/localstack/localstack/utils/threads.py", line 39, in run
    result = self.func(self.params, **kwargs)
  File "/opt/code/localstack/localstack/utils/asyncio.py", line 30, in _run
    return fn(*args, **kwargs)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 993, in handler
    return modify_and_forward(
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 534, in wrapper
    value = func(*args, **kwargs)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 614, in modify_and_forward
    listener_result = listener.forward_request(
  File "/opt/code/localstack/localstack/services/edge.py", line 170, in forward_request
    result = do_forward_request(api, method, path, data, headers, port=port)
  File "/opt/code/localstack/localstack/services/edge.py", line 225, in do_forward_request
    result = do_forward_request_inmem(api, method, path, data, headers, port=port)
  File "/opt/code/localstack/localstack/services/edge.py", line 249, in do_forward_request_inmem
    response = modify_and_forward(
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 534, in wrapper
    value = func(*args, **kwargs)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 614, in modify_and_forward
    listener_result = listener.forward_request(
  File "/opt/code/localstack/localstack/http/adapters.py", line 51, in forward_request
    response = self.request(request)
  File "/opt/code/localstack/localstack/aws/proxy.py", line 43, in request
    return self.skeleton.invoke(context)
  File "/opt/code/localstack/localstack/aws/skeleton.py", line 153, in invoke
    return self.dispatch_request(context, instance)
  File "/opt/code/localstack/localstack/aws/skeleton.py", line 165, in dispatch_request
    result = handler(context, instance) or {}
  File "/opt/code/localstack/localstack/aws/forwarder.py", line 57, in _call
    return handler(context, req)
  File "/opt/code/localstack/localstack/aws/skeleton.py", line 117, in __call__
    return self.fn(*args, **kwargs)
  File "/opt/code/localstack/localstack/aws/api/core.py", line 99, in operation_marker
    return fn(*args, **kwargs)
  File "/opt/code/localstack/localstack/services/ses/provider.py", line 261, in send_raw_email
    message = ses_backend.send_raw_email(source, destinations, raw_data, context.region)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/moto/ses/models.py", line 259, in send_raw_email
    recipient_count = len(destinations)
TypeError: object of type 'NoneType' has no len()

Adding a valid email address(es) to the destination will not result in the error from LocalStack (our tests will pass). There doesn't seem a way for us to use the SendRawEmailRequest destinations field to specify CC or BCC fields (which we require).

We're using the latest localstack docker image, on Java 14 and we're using java aws SDK 1.11.277.

Please help.

@github-actions
Copy link

@github-actions github-actions bot commented Jun 16, 2022

Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our Slack Community for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our contributing guidelines and our developer guide.

@MarcelStranak MarcelStranak added type: bug status: triage needed aws:ses labels Jun 17, 2022
@viren-nadkarni viren-nadkarni added good first issue status: confirmed and removed status: triage needed labels Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:ses good first issue status: confirmed type: bug
Projects
None yet
Development

No branches or pull requests

3 participants