-
Notifications
You must be signed in to change notification settings - Fork 8
How should Lambdakiq be setup in app.rb? #4
-
Hi,
I've deployed an app now with Lamby and after having followed the readme of lambdakiq I've also successfully issued a job to be performed. The job enters the SQS queue and SQS also starts executing the Lambda job instance. But here it breaks:
2021年02月15日T22:28:09.728+01:00 START RequestId: 3d414185-d0e1-5f38-9a8b-192139433362 Version: $LATEST
2021年02月15日T22:28:09.733+01:00 Critical exception from handler
2021年02月15日T22:28:09.733+01:00 {
2021年02月15日T22:28:09.733+01:00 "errorMessage": "undefined method `match?' for nil:NilClass",
2021年02月15日T22:28:09.733+01:00 "errorType": "Function<NoMethodError>",
2021年02月15日T22:28:09.733+01:00 "stackTrace": [
2021年02月15日T22:28:09.733+01:00 "/var/task/app.rb:16:in `handler'"
2021年02月15日T22:28:09.733+01:00 ]
2021年02月15日T22:28:09.733+01:00 }
2021年02月15日T22:28:09.753+01:00 END RequestId: 3d414185-d0e1-5f38-9a8b-192139433362
In the previous cookiecutter documentation you created a separate Dockerfile for the jobs lambda which used a different handler to execute the ActiveJob.
But here the documentation states to use same Dockerfile. So how will lambda / sqs now what handler to fire?
I found the Lambdakiq.handler
method, but not how it's fired?
Any advise? Anything I'm missing here?
Beta Was this translation helpful? Give feedback.
All reactions
Here! de161f2 let me know if that helps.
Replies: 2 comments 1 reply
-
In the previous cookiecutter documentation you created a separate Dockerfile for the jobs lambda which used a different handler to execute the ActiveJob.
Yup, ignore those now.
But here the documentation states to use same Dockerfile.
Correct, the main Dockerfile
is shared for both web and jobs functions. The Lamby starter makes sure the Rails (web) Metadata is set (https://github.com/customink/lamby-cookiecutter/blob/master/%7B%7Bcookiecutter.project_name%7D%7D/template.yaml#L26-L28) so all you have to do is make another function as described here (https://github.com/customink/lambdakiq#iam-permissions) note how it has a DockerTag of (jobs) and there are comments below on why that is important.
So how will lambda / sqs now what handler to fire?
Oh crap! I think I missed a very important part of the docs... one sec...
Beta Was this translation helpful? Give feedback.
All reactions
-
Here! de161f2 let me know if that helps.
Beta Was this translation helpful? Give feedback.
All reactions
-
That did the trick - thanks!
Beta Was this translation helpful? Give feedback.