Open d-rep opened 6 years ago
Using returnValueAsString: true
on the upstream works as well.
String result = invokeLambda(
functionName: 'myLambdaFunction',
payloadAsString: '{"key": "value"}',
returnValueAsString: true
)
https://github.com/jenkinsci/pipeline-aws-plugin#invokelambda
Introduced in 1.17 https://github.com/jenkinsci/pipeline-aws-plugin#117-use--118
After a successful lambda deploy + invoke, I was seeing a jenkins job fail with the following error.
My configuration is like this:
The lambda being invoked was python where the last line was
return 'Finished'
. The fix was to change that to simplyreturn
without a string.I think I am getting "Invalid JSON String" when the response was
'Finished'
because string literals can't be parsed, but AWS allows it as a valid return. Should this fail the whole job?It would also be friendlier if the error from invokeLambda mentioned that the response was the culprit. I mistakenly thought it was the input payload or jsonParameters that were the problem.
In addition, why does response even matter when I have
synchronous: false
?