Skip to content

Variables from external .yml file in provider name field cause sls to silently exit after packaging  #5278

Closed

Description

@philiiiiiipp

This is a Bug Report

Repository to reproduce:
https://github.com/philiiiiiipp/sls-deploy-bug

Description

  • What went wrong?

Running sls deploy with a serverless.yml containing a variable import inside the provider field silently stops. Setting the name to aws works fine.

serverless.yml:

service: sls-deploy-test

provider:
  # This works fine
  # name: aws

  # This does not work
  name: ${file(./serverless.values.yml):providerName}

  runtime: nodejs8.10
  region: eu-west-1
  stage: dev

functions:
  onlyDatHuisEmail:
    handler: ./index.handler
    memorySize: 128
    timeout: 3

serverless.values.yml:

providerName: aws

Deploying with import:

$ npm run sls:deploy

> [email protected] sls:deploy /test-folder/sls-deploy
> SLS_DEBUG=true sls deploy

Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Packaging service...
Serverless: Excluding development dependencies...

$ 

I have tried this with different versions of serverless dating back till 1.23.0, all with the same effect.

Running sls print gives the same correct output, with and without the import

$ sls print
service: sls-deploy-test
provider:
  stage: dev
  region: eu-west-1
  name: aws
  runtime: nodejs8.10
functions:
  onlyDatHuisEmail:
    handler: ./index.handler
    memorySize: 128
    timeout: 3

What did you expect should have happened?

It should deploy

Similar or dependent issues:

Additional Data

  • Serverless Framework Version you're using: 1.30.3 ( tried it with various versions till 1.23.3 )
  • Operating System: MacOS
  • Stack Trace: -
  • Provider Error messages: -

Activity

  1. changed the title [-]Variables from external .yml file cause sls deploy to silently exit after packaging [/-] [+]Variables from external .yml file in provider field cause sls deploy to silently exit after packaging [/+] on Sep 7, 2018
  2. changed the title [-]Variables from external .yml file in provider field cause sls deploy to silently exit after packaging [/-] [+]Variables from external .yml file in provider field cause sls to silently exit after packaging [/+] on Sep 7, 2018
  3. philiiiiiipp commented on Sep 7, 2018

    @philiiiiiipp
    ContributorAuthor

    sls remove also silently stops.

  4. changed the title [-]Variables from external .yml file in provider field cause sls to silently exit after packaging [/-] [+]Variables from external .yml file in provider `name` field cause sls to silently exit after packaging [/+] on Sep 7, 2018
  5. changed the title [-]Variables from external .yml file in provider `name` field cause sls to silently exit after packaging [/-] [+]Variables from external .yml file in provider name field cause sls to silently exit after packaging [/+] on Sep 7, 2018
  6. philiiiiiipp commented on Sep 7, 2018

    @philiiiiiipp
    ContributorAuthor

    After further investigation it seems like its only happening for the provider.name field

  7. ivanmartos commented on Feb 5, 2021

    @ivanmartos

    any update pls? This is still the case for me

    my serverless-workers.yml

    provider: ${file(./resources/shared/provider.yml):provider}
    

    and in provider.yml

    provider:
      name: aws
      stackTags:
        ENVIRONMENT: ${self:provider.stage}
        PROJECT: ${self:service}-${self:provider.stage}
      .....
    

    sls package and also sls deploy return same issue

    Serverless: Configuration warning: Unrecognized provider '[object Object]'
    

    I'm running on serverless version 2.20.1

  8. 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