laardee / serverless-authentication-boilerplate

Generic authentication boilerplate for Serverless framework

Home Page:http://laardee.github.io/serverless-authentication-gh-pages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting errors when do serverless deploy

nguyenlocduy opened this issue · comments

commented
serverless deploy --verbose

<--- Last few GCs --->

   57874 ms: Scavenge 1323.2 (1434.4) -> 1323.2 (1434.4) MB, 24.8 / 0 ms [allocation failure].
   57899 ms: Scavenge 1323.2 (1434.4) -> 1323.2 (1434.4) MB, 24.7 / 0 ms [allocation failure].
   57924 ms: Scavenge 1323.2 (1434.4) -> 1323.2 (1434.4) MB, 25.0 / 0 ms [allocation failure].
   57949 ms: Scavenge 1323.2 (1434.4) -> 1323.2 (1434.4) MB, 24.8 / 0 ms [allocation failure].
   57973 ms: Scavenge 1323.2 (1434.4) -> 1323.2 (1434.4) MB, 24.8 / 0 ms [allocation failure].


<--- JS stacktrace --->
Cannot get stack trace in GC.
FATAL ERROR: Scavenger: semi-space copy
 Allocation failed - process out of memory
[1]    47248 abort      serverless deploy --verbose

I am getting the same errors aswell.

I was facing the same issue with serverless 1.18.1 or 1.19.0.
Using a 1.9.0 unblocked me.

I had to nest the environment object inside the custom section.

  custom:
    environment: ${file(./env.yml):${opt:stage, self:provider.stage}}

And then reference variables like so.

TableName: ${self:provider.custom.environment.CACHE_DB_NAME}

I also changes the env.yaml file too something like this.

# variables for "dev" stage
dev:
# General
  SERVICE: ${self:service}
  STAGE: ${opt:stage, self:provider.stage}
  REGION: ${opt:region, self:provider.region}
  REDIRECT_CLIENT_URI: http://127.0.0.1:3000/
  TOKEN_SECRET: token-secret-123
# Database
  CACHE_DB_NAME: ${self:service}-cache-${opt:stage, self:provider.stage}
  USERS_DB_NAME: ${self:service}-users-${opt:stage, self:provider.stage}
# Cognito
  USER_POOL_ID: eu-west-mypool-id
# Providers
  PROVIDER_FACEBOOK_ID: fb-mock-id
  PROVIDER_FACEBOOK_SECRET: fb-mock-secret
  PROVIDER_GOOGLE_ID: g-mock-id
  PROVIDER_GOOGLE_SECRET: cg-mock-secret
  PROVIDER_MICROSOFT_ID: ms-mock-id
  PROVIDER_MICROSOFT_SECRET: ms-mock-secret
  PROVIDER_CUSTOM_GOOGLE_ID: g-mock-id
  PROVIDER_CUSTOM_GOOGLE_SECRET: cg-mock-secret

Then when deploying pass in stage and region flags.

sls deploy --stage dev --region eu-west-1

Now it seems to be working fine for me.

Thanks @Valkyrie. I am able to proceed cheers

@laardee Is this something you have come across? If so I'm happy to submit a PR with my suggested changes.

@laardee I fixed my own issue using your observation above. Would be nice if you'd submit a PR.

Thanks for reporting. I somehow missed totally this issue, sorry. I'll check this as soon as possible.

@laardee Nice one man. Looks like it might some sort of circular dependency issue.