Skip to content

Variable that self references causes deploy to hang #7807

Closed

Description

@apsoto

If you mistakenly have a variable reference itself it gets stuck in what appears to be an infinite loop. I've waited many minutes, and the deploy process provides no feedback nor does it error out.

An example I mistakenly did due to a bad cut and paste in my serverless.yml:

provider:
  environment:
    SOME_VARIABLE: ${self:provider.environment.SOME_VARIABLE}

sls deploy -v hangs with no output

Other mention: #4687 (comment)

serverless.yml
service: test
provider:
  name: aws
  runtime: nodejs12.x
  environment:
    SOME_VARIABLE: ${self:provider.environment.SOME_VARIABLE}
functions:
  hello:
    handler: handler.hello
REPLACE WITH FULL COMMAND NAME output
sls deploy -v

Installed version

Framework Core: 1.72.0
Plugin: 3.6.13
SDK: 2.3.1
Components: 2.30.12

Activity

  1. medikoo commented on Jun 3, 2020

    @medikoo
    Contributor

    @apsoto thanks for reporting. It's definitely a bug, that at some point should be fixed.

    We will possibly rewrite variables resolution logic at some point in time (we cover that here: #7207 ) and then we'll ensure that this issue is then addressed.

    Otherwise if there's some quick fix that can be done just to address this issue, PR is definitely welcome

  2. medikoo commented on Mar 3, 2021

    @medikoo
    Contributor

    Fixed with #8987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions