serverless-step-functions-local icon indicating copy to clipboard operation
serverless-step-functions-local copied to clipboard

Missing required key 'stateMachineArn' in params

Open ymulenll opened this issue 3 years ago • 4 comments

The plugin is not adding the environment variable with the state machine ARN, when I execute the state machine locally, I get this error:

{
	"errorMessage": "Missing required key 'stateMachineArn' in params",
	"errorType": "String",
	"stackTrace": null
}

demo: https://github.com/ymulenll/serverless-step-functions-demo the line when the env variable is undefined: https://github.com/ymulenll/serverless-step-functions-demo/blob/master/handler.js#L9

I am starting the project and running the function to start the state maching: GET http://localhost:3500/startSF

ymulenll avatar Jan 05 '22 16:01 ymulenll

I haven't used this package in forever but maybe it's getting mapped to OFFLINE_STEP_FUNCTIONS_ARN_FirstState?

Try printing process.env and see if it's available somewhere else.

codetheweb avatar Jan 05 '22 23:01 codetheweb

I haven't used this package in forever but maybe it's getting mapped to OFFLINE_STEP_FUNCTIONS_ARN_FirstState?

Try printing process.env and see if it's available somewhere else.

In my code, in the hello function I am returning the process.env object and there is nothing there related to the ARN.

ymulenll avatar Jan 06 '22 00:01 ymulenll

I think I stumbled upon this issue myself, and it has something to do with

serverless offline vs serverless offline start

I found it via a different package that mentions it within their known issues: see - https://www.npmjs.com/package/@fernthedev/serverless-offline-step-functions

I tried adding start to this package and it started adding the env vars/setting up properly

Scott-lasertrade avatar Feb 18 '22 09:02 Scott-lasertrade

@Scott-lasertrade thanks for the tip - I'll stop trying to figure out what I am doing wrong. serverless offline does start successfully but doesn't create the ARN for the step function. serverless offline start doesn't work behind a corporate proxy. it just says "Downloading Step Functions Local..." And then eventually it times out and doesn't start - however it works fine from outside the proxy.

jerryjeremiah avatar Mar 30 '22 21:03 jerryjeremiah