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

Receiving TypeError: Cannot read property 'stepFunctions' of undefined since 3.0.0 release

Open dsciacca opened this issue 4 years ago • 9 comments

This is a Bug Report

Description

For bug reports:

  • What went wrong?
    Since the v3.0.0 release my team is unable to deploy stacks that include the stepFunctions section in the serverless.yaml file, seeing TypeError: Cannot read property 'stepFunctions' of undefined at least when trying to deploy a new stack that includes a stepFunctions section. Pinning to serverless-step-functions v2.32.0 resolves the issue.
  • What did you expect should have happened?
    Expected this to work as usual and stack to be deployed w/o issue. The same serverless.yaml files have been working for creating/updating new/existing stacks for years, no changes were made to these files on our end.
  • What was the config you used?
    Pertinent section of my serverless.yaml file:
stepFunctions:
  stateMachines:
    partnerStateMachine:
      name: dxdl_sm-partner_state_machine_${self:provider.stage}
      role: ${file(../../config/env_configs.yaml):${self:provider.stage}.role}
      definition: ${file(../../step_functions/partners/create_partner_sfn.yml):definition}

    deletePartnerStateMachine:
        name: dxdl_sm-delete_partner_state_machine_${self:provider.stage}
        role: ${file(../../config/env_configs.yaml):${self:provider.stage}.role}
        definition: ${file(../../step_functions/partners/delete_partner_sfn.yml):definition}
  • What stacktrace or error message from your provider did you see?
709 | Type Error ---------------------------------------------
--
710 |  
711 | Cannot read property 'stepFunctions' of undefined
712 |  
713 | For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
714 |  
715 | Get Support --------------------------------------------
716 | Docs:          docs.serverless.com
717 | Bugs:          github.com/serverless/serverless/issues
718 | Issues:        forum.serverless.com
719 |  
720 | Your Environment Information ---------------------------
721 | Operating System:          linux
722 | Node Version:              10.1.0
723 | Serverless Version:        1.48.3
724 | Enterprise Plugin Version: 1.3.11
725 | Platform SDK Version:      2.3.2

Similar or dependent issues:

  • NA AFAIK

Additional Data

  • Serverless Framework Core Version you're using: 1.48.3
  • The Plugin Version you're using: 3.0.0
  • Operating System: linux
  • Stack Trace:
709 | Type Error ---------------------------------------------
--
710 |  
711 | Cannot read property 'stepFunctions' of undefined
712 |  
713 | For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
714 |  
715 | Get Support --------------------------------------------
716 | Docs:          docs.serverless.com
717 | Bugs:          github.com/serverless/serverless/issues
718 | Issues:        forum.serverless.com
719 |  
720 | Your Environment Information ---------------------------
721 | Operating System:          linux
722 | Node Version:              10.1.0
723 | Serverless Version:        1.48.3
724 | Enterprise Plugin Version: 1.3.11
725 | Platform SDK Version:      2.3.2
  • Provider Error messages: TypeError: Cannot read property 'stepFunctions' of undefined

dsciacca avatar Aug 04 '21 16:08 dsciacca

same issue

Famin42 avatar Aug 09 '21 17:08 Famin42

take a look what i find at serverless forum link

Famin42 avatar Aug 09 '21 17:08 Famin42

Thanks for the additional link @Fomin2402 to confirm I do have serverless-step-functions called out in the plugins section of my serverless.yaml file:

plugins:
  - serverless-step-functions
  - serverless-pseudo-parameters

dsciacca avatar Aug 09 '21 17:08 dsciacca

Same issue with v3.0.0. Only it works with v2.32.0

antoniomartin-levatas avatar Aug 18 '21 13:08 antoniomartin-levatas

Same issue `Type Error ---------------------------------------------

TypeError: Cannot read property 'stepFunctions' of undefined at ServerlessStepFunctions.yamlParse (/home/Desktop/serverless-backend/node_modules/serverless-step-functions/lib/yamlParser.js:10:30) at ServerlessStepFunctions.tryCatcher (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromiseCtx (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/promise.js:641:10) at _drainQueueStep (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/async.js:97:12) at _drainQueue (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (internal/timers.js:464:21)

 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: 14.17.6 Framework Version: 2.0.0 Plugin Version: 4.0.2 SDK Version: 2.3.2 Components Version: 3.1.2`

mark1044 avatar Oct 04 '21 23:10 mark1044

Getting the same issue on 3.1.0. I've used 2.21.1 on previous APIs fine, but integrating step functions into a different API using the latest version doesn't seem to work.

TypeError: Cannot read property 'stepFunctions' of undefined at ServerlessStepFunctions.yamlParse (node_modules\serverless-step-functions\lib\yamlParser.js:10:30) at ServerlessStepFunctions.tryCatcher (node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromiseCtx (node_modules\bluebird\js\release\promise.js:641:10) at _drainQueueStep (node_modules\bluebird\js\release\async.js:97:12) at _drainQueue (node_modules\bluebird\js\release\async.js:86:9) at Async._drainQueues (node_modules\bluebird\js\release\async.js:102:5) at Immediate.Async.drainQueues [node_modules\bluebird\js\release\async.js:15:14) at processImmediate (internal/timers.js:439:21) at process.topLevelDomainCallback (domain.js:130:23)

Your Environment Information --------------------------- Operating System: win32 Node Version: 12.13.1 Framework Version: 1.62.0 SDK Version: 2.3.0 Components Core Version: 1.1.2 Components CLI Version: 1.4.0

Onosume avatar Oct 11 '21 13:10 Onosume

Any resolution to this issue ?

alsenydiallo avatar Jan 13 '22 15:01 alsenydiallo

I faced the same issue. I was running an incompatible plugin version with my serverless framework. I fixed it by downgrading the stepfunctions plugin version to "^1.20.0" "serverless-step-functions": "^1.20.0"

sezhava avatar Sep 07 '22 10:09 sezhava

Hi,

Someone manages to trigger a step functions workflow from a lambda ? I do not.

{
    "errorType": "TypeError",
    "errorMessage": "Cannot read properties of undefined (reading 'StepFunctions')",
    "stack": [
        "TypeError: Cannot read properties of undefined (reading 'StepFunctions')",
        "    at /var/task/handler.js:47:55",
        "    at step (/var/task/handler.js:33:23)",
        "    at Object.next (/var/task/handler.js:14:53)",
        "    at /var/task/handler.js:8:71",
        "    at new Promise (<anonymous>)",
        "    at __awaiter (/var/task/handler.js:4:12)",
        "    at Runtime.essaiworkflow [as handler] (/var/task/handler.js:41:47)",
        "    at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1083:29)"
    ]
}

rudyhadoux avatar Aug 17 '23 07:08 rudyhadoux