serverless / serverless

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.
https://serverless.com
MIT License
46.47k stars 5.72k forks source link

BUG: deploy from Semaphore CI fails (accuses bad yml file) #3262

Closed igorrocha closed 7 years ago

igorrocha commented 7 years ago

Bug Report

Description

frameworkVersion: "=1.1.0"
service: testnew-service

provider:
  name: aws
  runtime: python2.7
  iamRoleARN: arn:aws:iam::********************
  stage: ${opt:stage, self:provider.default_stage}
  default_stage: dev
  region: us-east-1
  memorySize: 128

custom:
  writeEnvVars: ${file(./env/env.yml)}
plugins:
 - serverless-plugin-write-env-vars

# you can add packaging information here 
package:
  include:
    - vendored/*
  exclude:
    - tests/*
#  artifact: my-service-code.zip

_definitions:
  auth: &auth
    Properties:
      AuthorizationType: NONE
      RequestParameters:
        method.request.header.*********: integration.request.header.**********
  vpc: &fixed_ip_vpc
    securityGroupIds:
    - sg-*******
    subnetIds:
    - subnet-*******
    - subnet-********
  #_vpc: &_db_vpc
    #- "None"
  cors: &cors
    origins:
    - '*'
    headers:
    - Content-Type
    - X-Amz-Date
    - Authorization
    - X-Api-Key
    - X-Amz-Security-Token
    - ********

functions:
# CSV upload function, triggered directly by an S3 upload
  clientsBatchCreateInternal:
    handler: clientsBatchCreateInternal.handler
    events:
      - s3:
          bucket: ${self:provider.stage}-clients-csv-******
          event: s3:ObjectCreated:*
          rules:
            - suffix: .csv

# you can add CloudFormation resource templates here
resources:

Serverless: Wrote .env file to /tmp/deploy_serverless_11_31868/.env Serverless: Packaging service… .. Serverless: Stack update finished… Serverless: Removing old service versions…



Similar or dependent issues:
* Couldn't find any, only this Serverless forum post http://forum.serverless.com/t/issue-with-yml-file/943

## Additional Data

* ***Serverless Framework Version you're using***: 1.1.0
* ***Operating System***: linux
* ***Provider Error messages***:

>   Y A M L Exception --------------------------------------
>  
>      end of the stream or a document separator is expected
>      in "/tmp/deploy_serverless_13_8076/serverless.yml" at
>      line 2, column 1:
>     _definitions:
>     ^
>  
>      For debugging logs, run again after setting SLS_DEBUG env var.
>  
>   Get Support --------------------------------------------
>      Docs:          docs.serverless.com
>      Bugs:          github.com/serverless/serverless/issues
>  
>      Please report this error. We think it might be a bug.
pmuens commented 7 years ago

Hey @IgorRocha thanks for opening. 👍

Your YAML is invalid. The - ******** part needs to be wrapped in '' --> - '********'.

You can use https://www.json2yaml.com/ to check your YAML for syntax errors.

igorrocha commented 7 years ago

Hey @pmuens , thanks for looking into it. I failed to mention, but all the *** you see in my YAML are just placeholders for sensitive business information that I hid before pasting the file here.

I now checked the original file (without the ***) using https://www.json2yaml.com/ and it passed, so the YAML file's syntax is correct.

Can the issue be reopened, or should I create a new one?

pmuens commented 7 years ago

Ah OK. That makes sense (Most of the time I do the same, but with xxxxxxx 😄 .

I'll reopen this one since it's not resolved yet!

pmuens commented 7 years ago

Any update on this one @IgorRocha ?

igorrocha commented 7 years ago

Unfortunately not, @pmuens . We temporarily gave up on building that stack through Semaphore CI and decided to deploy it manually (sls deploy).

Did anyone on the serverless team have a chance to take a look at this issue?

pmuens commented 7 years ago

@IgorRocha yes, we tried to reproduce it with the provided serverless.yml file.

However if we replace all the ***** with a string we are able to parse the YAML without an exception.

Maybe something is going on on Semaphores end.

I'll close this issue for now since you've moved on to manual deployment and we're unable to reproduce it.

Let us know if you face any other issues...