Deploying Through Seed

Link to chapter - https://serverless-stack.com/chapters/deploying-through-seed.html

I get the warnings below when deploying to dev. Am I supposed to get these?

Seems like it canā€™t fine the env.yml file, which is no surprise since itā€™s in .gitignore.

But I guess SEED should create that file with the env vars that we specify - or am i missing something?

2018/05/24 22:57:52 Fetching deployment info

$ serverless info --verbose --stage dev
 
 Serverless Warning --------------------------------------
 
  A valid file to satisfy the declaration 'file(env.yml):dev,file(env.yml):default' could not be found.
 
 
 Serverless Warning --------------------------------------
 
  A valid file to satisfy the declaration 'file(env.yml):dev,file(env.yml):default' could not be found.
 
 
 Serverless Warning --------------------------------------
 
  A valid service attribute to satisfy the declaration 'self:custom.environment.stripeSecretKey' could not be found.

These should be fine since the env.yml is not a part of the repo and wonā€™t be available in the build process.

Iā€™ll add a note to the chapter to avoid any confusion.

Iā€™m getting build failed errors (ā€œFailed to generate build artifactsā€) and I donā€™t understand what the error is because of all my tests pass and the build log looks fine apart from the warnings mentioned in the above post. Looked at the artifacts log and Iā€™m seeing this error at the end:

Serverless: Invoke webpack:package
Serverless: Package lock found - Using locked versions
Serverless: Packing external modules: source-map-support@^0.4.18, babel-runtime@^6.26.0, stripe@^6.2.1, uuid@^3.3.2
Serverless: Packaging serviceā€¦
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage

2018/07/13 10:46:54 Error: exec: internal error

====================
:wastebasket: Cleanup

2018/07/13 10:46:54 Post artifact build cleanup

It seems just for the production artifacts. I think we might be in touch over email as well.

When I tried manual deploy, as I didnā€™t want every git push to trigger an auto deploy, the deployment is successful, since I am able to use dev v2 as far as running the lambda functions and seeing logs, etc. But the SEED page doesnā€™t reflect that.

I suspect thereā€™s some sort of state mismatch between the SEED backend and the web GUI?

At the moment Iā€™m unable to promote v2 to prod via the SEED page.

Any idea? Thanks!

Is the build that is in progress still deploying? If you check the build logs?

The deploy process is made up of a few concurrent process (building artifacts). So it is quite possible that the Lambdas have been deployed while itā€™s waiting for the other artifacts to be generated.

I think the build process in Seed have changed since this chapter was written?
I donā€™t see the build stage for PROD when I deploy to dev, but I get the opportunity to promote to PROD afterwards.

I donā€™t know if I have done something different? :slight_smile:

Hmm there have been some changes. Not critical ones but the chapter needs to be updated.

Have you been able to get through this chapter?

Yes I managed to get through :slight_smile:

1 Like

Seed will not trigger a build for me at all, by pushing to master or by manually using the web interface, even using the serverless.yml from your git.

Iā€™m not seeing the stack outputs when deploying to seed - I can see them when deploying manually with sls deploy -v. Is there some config that I may have changed by mistake to prevent the verbose deployment?

I think by default Seed, uses the verbose flag. Can you post a screenshot of the output you are seeing on Seed?

Has this issue been resolved for you?

I was looking at the Build Log instead of the Serverless Info output :expressionless:. Problem solved.

1 Like

Iā€™ve spent the last couple hours trying to get a deployment with the limited policy definitions as described here:

There have been a number of issues. One by one, I seem to be resolving them (though I am writing this while yet another Promote build is going on, so donā€™t know if Iā€™ll get through it.) Do you think that guide is now out of date?

Below is a sample from the Compile step. Locally, I ran ā€˜npm audit fixā€™ to clean up vulnerabilities. It appears the Seed build process does not. Is this something that perhaps should be added?

====================
:hammer_and_wrench: Compile

$ npm install
npm WARN goalcats-api@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {ā€œosā€:ā€œdarwinā€,ā€œarchā€:ā€œanyā€} (current: {ā€œosā€:ā€œlinuxā€,ā€œarchā€:ā€œx64ā€})

added 973 packages from 591 contributors and audited 23448 packages in 18.304s
found 12 vulnerabilities (8 low, 4 high)
run npm audit fix to fix them, or npm audit for details

When I promoted the fist dev build to prod, unlike what the text say, it seems that a full build and upload to S3 was going on. This process took some time and I could see these steps in the build log.
(Iā€™m referring to this chapter: https://serverless-stack.com/chapters/deploying-through-seed.html)

1 Like

Yeah that chapter in the docs needs an update. Thanks for letting us know.

The npm audit fix would be a valuable addition to the steps. Iā€™ll pass the feedback along to the team.

Hello,

deploying dev works fine.

When I promote the dev version I get the following error log (ERROR: Missing required key ā€˜Bucketā€™ in params):

Serverless: Uploading CloudFormation file to S3...
 
  Serverless Error ---------------------------------------
 
  Missing required key 'Bucket' in params
 
  Stack Trace --------------------------------------------
 
ServerlessError: Missing required key 'Bucket' in params
    at BbPromise.fromCallback.catch.err (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:286:11)
From previous event:
    at persistentRequest (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:268:13)
    at doCall (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:217:9)
    at BbPromise (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:234:14)
From previous event:
    at persistentRequest (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:215:38)
    at Object.request.requestQueue.add [as promiseGenerator] (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:255:49)
    at Queue._dequeue (/sls-1.35.1/node_modules/promise-queue/lib/index.js:153:30)
    at /sls-1.35.1/node_modules/promise-queue/lib/index.js:109:18
From previous event:
    at Queue.add (/sls-1.35.1/node_modules/promise-queue/lib/index.js:94:16)
    at AwsProvider.request (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:255:39)
    at AwsDeploy.uploadCloudFormationFile (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/deploy/lib/uploadArtifacts.js:49:26)
From previous event:
    at AwsDeploy.uploadArtifacts (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/deploy/lib/uploadArtifacts.js:18:8)
From previous event:
    at AwsDeploy.BbPromise.bind.then (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/deploy/index.js:113:39)
From previous event:
    at Object.aws:deploy:deploy:uploadArtifacts [as hook] (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/deploy/index.js:109:10)
    at BbPromise.reduce (/sls-1.35.1/node_modules/serverless/lib/classes/PluginManager.js:391:55)
From previous event:
    at PluginManager.invoke (/sls-1.35.1/node_modules/serverless/lib/classes/PluginManager.js:391:22)
    at PluginManager.spawn (/sls-1.35.1/node_modules/serverless/lib/classes/PluginManager.js:409:17)
    at AwsDeploy.BbPromise.bind.then (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/deploy/index.js:95:48)
From previous event:
    at Object.deploy:deploy [as hook] (/sls-1.35.1/node_modules/serverless/lib/plugins/aws/deploy/index.js:91:10)
    at BbPromise.reduce (/sls-1.35.1/node_modules/serverless/lib/classes/PluginManager.js:391:55)
From previous event:
    at PluginManager.invoke (/sls-1.35.1/node_modules/serverless/lib/classes/PluginManager.js:391:22)
    at PluginManager.run (/sls-1.35.1/node_modules/serverless/lib/classes/PluginManager.js:422:17)
    at variables.populateService.then.then (/sls-1.35.1/node_modules/serverless/lib/Serverless.js:157:33)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
    at Serverless.run (/sls-1.35.1/node_modules/serverless/lib/Serverless.js:144:8)
    at serverless.init.then (/sls-1.35.1/node_modules/serverless/bin/serverless:44:28)
    at <anonymous>
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information -----------------------------
     OS:                     linux
     Node Version:           8.15.1
     Serverless Version:     1.35.1
 
ERROR: Missing required key 'Bucket' in params

Any idea?