Coder Social home page Coder Social logo

Comments (6)

AdrieanKhisbe avatar AdrieanKhisbe commented on July 23, 2024

@comtom can you send the whole (redacted) serverless config?

The part of config you sent imply there would be some

resources:
  Resources:
    QueueName:
      Type: AWS::SQS::Queue
      Properties:
        QueueName: your-queue-name

Is that the case?

from serverless-plugins.

comtom avatar comtom commented on July 23, 2024

Correct, I have this:

  QueueName:
    Type: "AWS::SQS::Queue"
    Properties:
      QueueName: QueueName
      VisibilityTimeout: 30
      MessageRetentionPeriod: 1209600

the setup works correctly in AWS but not with serverless-ofline-sqs.
Is something wrong in these configs?

from serverless-plugins.

AdrieanKhisbe avatar AdrieanKhisbe commented on July 23, 2024

I think I got why, Queue creation is not done by default by serverless-offline-sqs

you need to activate it with option autoCreate: true and have a sqs localy running:

you find more details in the Configuration SQS section of the README:
https://github.com/CoorpAcademy/serverless-plugins/tree/master/packages/serverless-offline-sqs#sqs

from serverless-plugins.

comtom avatar comtom commented on July 23, 2024

hey, I've tried that without success, I debugged the plugin and the issue seems to be at serverless-offline-sqs/src/index.js:211 (it seems that it breaks before checking autoCreate param)

client.getQueueUrl({QueueName}, cb) call is raising an exception.

If change the line to const { QueueUrl } = await fromCallback(cb => http://localhost:9324/queue/${QueueName}`);` does not throw the exception below.

Tried serverless-offline-sqs from versions 5.12.1 down to 5.9.0; all of them with same results.

After changing the mentioned line serverless runs again but will not invoke handlers when new messages arrives. Checked manually creating all the queues with correct names and it did not invoke handlers either.

This is the error I'm getting:

  A W S. Simple Queue Service. Non Existent Queue --------
 
  AWS.SimpleQueueService.NonExistentQueue: The specified queue does not exist for this wsdl version.
      at Request.extractError (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/protocol/query.js:50:29)
      at Request.callListeners (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
      at Request.emit (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
      at Request.emit (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/request.js:683:14)
      at Request.transition (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/request.js:22:10)
      at AcceptorStateMachine.runTo (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/state_machine.js:14:12)
      at /home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/state_machine.js:26:10
      at Request.<anonymous> (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/request.js:38:9)
      at Request.<anonymous> (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/request.js:685:12)
      at Request.callListeners (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
      at Request.emit (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
      at Request.emit (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/request.js:683:14)
      at Request.transition (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/request.js:22:10)
      at AcceptorStateMachine.runTo (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/state_machine.js:14:12)
      at /home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/state_machine.js:26:10
      at Request.<anonymous> (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/request.js:38:9)
      at Request.<anonymous> (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/request.js:685:12)
      at Request.callListeners (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
      at callNextListener (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/sequential_executor.js:96:12)
      at IncomingMessage.onEnd (/home/comtom/Projects/electric/api-middleware/node_modules/aws-sdk/lib/event_listeners.js:307:13)
      at IncomingMessage.emit (events.js:203:15)
      at IncomingMessage.EventEmitter.emit (domain.js:448:20)
      at endReadableNT (_stream_readable.js:1145:12)
      at process._tickCallback (internal/process/next_tick.js:63:19)
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              10.19.0
     Framework Version:         1.67.0
     Plugin Version:            3.6.3
     SDK Version:               2.3.0
     Components Version:        2.27.0

from serverless-plugins.

comtom avatar comtom commented on July 23, 2024

Found that the config block was incorrectly indented. Now is working perfectly!!!

I think perhaps adding an error saying that the config is not there could be helpful. Thanks for your support :)

from serverless-plugins.

natac13 avatar natac13 commented on July 23, 2024

@comtom How so? I am experiencing the same error message but cannot find why my config is wrong. Especially after I just copied it from the docs lol.

Update - Fixed
My issues was having another sqs queue (a DLQ) in the resources section of serverless.yml. Because this is not used to trigger a lambda I tried to create it manually only and everything fired up! 🎆

from serverless-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.