Sitelet https://web.archive.org/web/20250616094641/https://github.com/localstack/localstack/pull/5351
Skip to content

base64 encode data payload in event_record for lambda functions #5351

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

Closed
wants to merge 1 commit into from

Conversation

KOConchobhair
Copy link

This fixes #5350.
I'm not familar enough with the codebase to fix this somewhere higher up the chain without potentially breaking other things since it does not appear this functionality is currently being unit tested. I looked at some existing tests but couldn't figure out the best way to test this sort of thing, i.e. a kinesis stream with .net lambda event source mapping. Didn't seem appropriate to just add it to the existing test_kinesis.py

@KOConchobhair
Copy link
Author

hmm, preflight is failing due to unit test test_fix_region_in_headers in tests.unit.test_dynamodb which I did not change...maybe someone can try re-running it?

@spwats spwats self-requested a review January 27, 2022 22:07
@spwats
Copy link
Contributor

spwats commented Jan 27, 2022 •

I tried re-running the build and it failed in the same way. Not totally sure what the issue is. Can you try pulling and rebasing off master?

@whummer
Copy link
Member

whummer commented Feb 7, 2022

Thanks for updating the PR @KOConchobhair ! 👍 Looks like we still have a small issue in our tests in the CI pipeline - did you have a chance to look into it? Also requesting help from @SwatsonCodes who can help us review what should be the right behavior here.. Thanks!

@alexrashed
Copy link
Member

Hi @KOConchobhair!
With #5807, the event encoding has been heavily refactored. It seems to me as if you issue has been addressed in the PR:

# boto3 automatically decodes records in get_records(), so we must re-encode
record_payload["data"] = to_str(base64.b64encode(record_payload["data"]))

I'll close this PR for now. Please feel free to create a new PR or issue in case you're still experiencing any issues.
Thanks!

@alexrashed alexrashed closed this Jun 30, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2022
@KOConchobhair KOConchobhair deleted the patch-1 branch July 2, 2022 15:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: kinesis stream with .net lambda event source mapping fails to execute with JsonSerializerException
4 participants