ajmath / serverless-offline-scheduler

MIT License
96 stars 40 forks source link

Not working with sns #36

Open VladisB opened 4 years ago

VladisB commented 4 years ago

When I used serverless-offline-scheduler I couldn't get a response from sns.publish().promise() it's just waiting and nothing did, but when I changed function event to http it worked normally. It's kinda strange, isn't it?

ajmath commented 4 years ago

Yeah that's weird. I'm not entirely sure of what you're trying to do though. This plugin shouldn't have any effect on sns.publish

shierro commented 4 years ago

@ajmath seems like serverless-offline restarts when the scheduler triggers. i'm on a windows 10 machine, and i'm using SNS offline

this is some of the stack trace

opts {
  endpoint: 'http://127.0.0.1:4001',
  region: 'ap-southeast-2',
  httpOptions: { connectTimeout: 15000, timeout: 5000 }
}
{"message":"error in publish function","level":"error"}
{"message":"{\"message\":\"Connection timed out after 5000ms\",\"code\":\"TimeoutError\",\"time\":\"2020-01-27T07:19:30.893Z\",\"region\":\"ap-southeast-2\",\"hostname\":\"127.0.0.1\",\"retryable\":true}","level":"error"}
"undefined"
Serverless: scheduler: Succesfully run scheduled job: taskDelegator

when I call the same publish function, w/o this scheduler, I get a success.

I think this plugin somehow restarts serverless-offline(based on the stack trace, webpack builds again), then the server started by serverless-offline-sns is prevented to restart.

Framework Core: 1.61.3
Plugin: 3.2.7
SDK: 2.3.0
Components Core: 1.1.2
Components CLI: 1.4.0

these are the plugins that i'm using

plugins:
  - serverless-webpack
  - serverless-iam-roles-per-function
  - serverless-dotenv-plugin
  - serverless-pseudo-parameters
  - serverless-domain-manager
  - serverless-prune-plugin
  - serverless-offline-sns
  - serverless-offline-scheduler
  - serverless-offline
tomusiaka commented 4 years ago

We are running into the same issue. I looks like it might be caused by #44.