-
Notifications
You must be signed in to change notification settings - Fork 133
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
Unhandled Exception on offline start #21
Comments
same issue here |
Hey @Redrazor, @brunocascio You can install ElasticMQ on its own or using Docker ElasticMQ
Then, modify your
Then you need to create the queue: Hope I've helped. |
Thanks @astuyve ! I am running all my stack on docker, so I had some race conditions problems, all of them solved with the following entry point code:
docker-compose.yml
Dockerfile
|
@astuyve I'm running localstack along with serverless-offline, and having this issue. So, using http://localstack:4576 for my endpoint. What is the --profile arg for? I don't see it on the CLI docs for create-queue. Edit: Figured out the --profile option: Still not finding the queue, as created on localstack. |
Yup, profile is essentially a no-op for offline usage - but their CLI requires it anyway. Can you reach your endpoint using CURL? I'm not familiar with OpenStack, but there must be some way to test that the queue is running and proxying traffic effectively. Perhaps try running an offline message queue outside of localstack to account for network issues? |
I can put a message on the queue with the CLI, from the shell. But serverless-offline-sqs is failing to find the queue in the event definition in my serverless.yml. The resource arn and event source arn appear to match. Wondering if serverless requires any additional permissions? I've allowed the lambda these:
|
@thetumper have you figured out how to solve this? I am encountering the same issue. I can use CLI aws sqs --endpoint-url to create queues |
@duythvn Yes, it's resolved for me. It was some combination of there being some issues with queue ARNs between localstack and moto, and maybe the way I was obtaining the arn for the event source configuration. Note - I'm using localstack for SQS, not ElasticMQ. Current working solution for me was:
I may not need 2 & 3 anymore, but just configure the global ARN, with variable stage portion in it. But I haven't gone back and tried yet -- there's always a more pressing issue each day. :/ |
cool. I'll try localstack (currently running serverless framework with the offline plugin) |
I realize this is an old ticket/post but it's one of the first hits to come up when searching for unhandled exceptions related to non existent queues and serverless-offline-sqs, so I thought I'd provide some more contemporary context for those who end up here, and mention a scenario that can cause the somewhat vague error (spoiler alert: if you're referencing a dead-letter-queue, make sure it is also accounted for - via lambda configuration - during local initialization):
As mentioned in other posts, you do need to stand up a local queueing service for serverless-offline-sqs to leverage. Now-a-days, though, the plugin has an option to automatically create the queues during 'sls offline start'. Typical configuration in your serverless.yml plugins section might look like:
When serverless offline starts, serverless-offline-sqs scans any functions you are importing for any triggered by SQS events and attempts to create the referenced queue in the queue service you should have running in the background. If the queue already exists, it gracefully skips. If the queue does not exist it attempts creates it. As described at https://www.npmjs.com/package/serverless-offline-sqs, the plugin helpfully supports CloudFormation references/syntax.
In my case this occurred due to the following sequence of init steps:
So as you are configuring pairs (nominal / dead-letter) of new queues - e.g., as CloudFormation - be sure to immediately add corresponding pairs of functions in order to initialize your new queues and seamlessly develop locally:
|
With serverless offline start (using serverless webpack) I get the following warning.
This is my config on serverless.yml
The text was updated successfully, but these errors were encountered: