Luke Wyman
08/30/2021, 5:09 AMKAR_ROT_complete_performance.py
, which puts a PerformanceCompleted
event on my event bus. Works great, works great, returns a result with "FailedEntryCount": 0
- all good.
• Then, I have a Lambda, called KAR_HST_add_performance.py
, that consumes said event and places it in a performance history dynamodb table.
• If I do a npx sst deploy --stage test
and then POST to the API to complete a performance, everything works great. No errors in the CloudWatch logs, and I can see my performance in the performance table. So, it works end-to-end with a deploy
.
• If I do a npx sst start --stage test
, my KAR_ROT_complete_performance.py
still works well, but my KAR_HST_add_performance.py
throws the following exception in the terminal:
2d5b30dd-1daa-4bb4-af6b-da4ea4e975cf REQUEST test-karaoke-performance-his-historylogger7C190503-GGOSGWNuWwtH [src/services/performance-history/KAR_HST_add_performance.handler] invoked
SyntaxError: Unexpected token n in JSON at position 0
at JSON.parse (<anonymous>)
at createStrictSyntaxError (/home/lukewyman/Documents/code/karaoke-backend-sst/node_modules/body-parser/lib/types/json.js:158:10)
• I've also simplified the subscribed lambda so that I'm not trying to do anything at all with the event:
def handler(event, context):
print('Inside the add performance handler!')
and I still get the exception shown above, while also printing Inside the add performance handler!
to to the terminal.
So, somehow, the subscribed lambda is falling apart with Live Lambda, but working as expected when deployed.Frank
PerformanceCompleted
and AddPerformance
in the same stack?Luke Wyman
08/30/2021, 10:06 PMPerformanceCompleted
doesn't really exist outside of being the detailType
string in my event bus rule in my EventBusStack
. Over in the RotationsStack
where the performance is actually marked complete, It's an environment variable for the Lambda that will put_events
, and over in PerformanceHistoryStack
, I've passed in the event rule so that the AddPerformance
can be subscribed to it.Frank
KAR_ROT_complete_performance.py
and KAR_HST_add_performance.py
, are they in the same stack or separate stacks?Luke Wyman
08/30/2021, 11:16 PMKAR_ROT_complete_performance.py
is in the RotationsStack
while KAR_HST_add_performance.py
is in the PerformanceHistoryStack
. The EventBusStack
is shared between the two as needed to make the pub/sub for the custom event bus happen.Frank
Frank
sst start
after an sst deploy
?