Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How should Lambdakiq be setup in app.rb? #4

Answered by metaskills
mtrolle asked this question in Q&A
Discussion options

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?

You must be logged in to vote

Here! de161f2 let me know if that helps.

Replies: 2 comments 1 reply

Comment options

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...

You must be logged in to vote
0 replies
Comment options

Here! de161f2 let me know if that helps.

You must be logged in to vote
1 reply
Comment options

That did the trick - thanks!

Answer selected by mtrolle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /