Value of property Variables must be an object

Hello, when i try to deploy I get this error:

Serverless: Checking Stack update progress...
..............................Serverless: Deployment failed!
 
  Serverless Error ---------------------------------------
 
     An error occurred while provisioning your stack: StripewebhookLambdaFunction
     - Value of property Variables must be an object with
     String (or simple type) properties.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
 
  Your Environment Information -----------------------------
     OS:                 linux
     Node Version:       7.5.0
     Serverless Version: 1.6.1

what am i missing?

It sounds like your Stripewebhook function definition (in the functions section of your serverless.yml has an invalid value for one of the properties - probably you’ve got an array instead of a string.

My serverless.yaml is like

service: test-serverless

#plugins:
#  - serverless-offline

provider:
  name: aws
  runtime: nodejs4.3
  stage: ${opt:stage}
  profile: ${self:custom.profiles.${self:provider.stage}}
  custom:
    profiles:
      dev:
        AUTH0_AUDIENCE: xx
        AUTH0_INTERNAL_AUDIENCE: xxx
        AUTH0_INTERNAL_SECRET: xxx
        AUTH0_SECRET: xxx
      prod:
        AUTH0_AUDIENCE: xx
        AUTH0_INTERNAL_AUDIENCE: xxx
        AUTH0_INTERNAL_SECRET: xxx
        AUTH0_SECRET: xxx
  iamRoleStatements:
       -  Effect: Allow
          Action:
            - dynamodb:*
          Resource: "*"
       -  Effect: Allow
          Action:
            - s3:*
          Resource: "*"
  environment:
    AUTH0_AUDIENCE: ${self:profile.AUTH0_AUDIENCE}
    AUTH0_INTERNAL_AUDIENCE: ${self:profile.AUTH0_INTERNAL_AUDIENCE}
    AUTH0_INTERNAL_SECRET: ${self:profile.AUTH0_INTERNAL_SECRET}
    AUTH0_SECRET: ${self:profile.AUTH0_SECRET}

functions:
  graphql:
    handler: build/main.graphql
    timeout: 12
    events:
      - http:
          path: graphql
          method: post
          cors: true

  stripewebhook:
    handler: build/main.stripewebhook
    events:
      - http:
          path: stripewebhook
          method: post
          cors: true

from https://serverless.com/framework/docs/providers/aws/guide/variables/#nesting-variable-references

the line profile: ${self:custom.profiles.${self:provider.stage}} seems to be failing

what am i missing?

doh, i am so blind. it should be

  stage: ${opt:stage}
  profile: ${self:custom.profiles.self:stage}

I didn’t realise you could put multiple “:” in a variables reference - thanks for sharing your solution!

This error message came to me too when referencing a field in custom in the environment

like that

    provider:
      name: aws
      runtime: nodejs6.10
      region: us-east-1
      stage: dev
      environment:
        stage: ${self:custom.stage}
    custom:
      stage: ${opt:stage, self:provider.stage}

I got the same error when using lists in secrets which were then mapped to environment variables