question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting `existing: true` on an s3 lambda event causes deployment to fail

See original GitHub issue

This is a Bug Report

Description

  • What went wrong? Adding the existing: true property to the function below causes the previously passing deployment to fail

  • What did you expect should have happened? Serverless should deploy, adding an s3 trigger event to the existing bucket that triggers the lambda function

  • What was the config you used?

...
functions:
  trigger-update:
    handler: bin/triggerUpdate/triggerUpdate_lambda
    reservedConcurrency: 1
    events:
      - s3:
          bucket: ${self:provider.existingBucket}
          event: s3:ObjectCreated:*
          existing: true # commenting out this line fixes the error but means a bucket is created
  • What stacktrace or error message from your provider did you see?
Serverless: Installing dependencies for custom CloudFormation resources...

  Error --------------------------------------------------

  Error: Command failed: npm install --prefix C:\Users\ELLIOT~1.RIC\AppData\Local\Temp\tmpdirs-serverless\e175\29097f0ffcadbd41\resources
  npm ERR! code ENOLOCAL
  npm ERR! Could not install from "" as it does not contain a package.json file.

  npm ERR! A complete log of this run can be found in:
  npm ERR!     C:\Users\elliot.rice\AppData\Roaming\npm-cache\_logs\2019-09-05T15_25_23_483Z-debug.log

      at ChildProcess.exithandler (child_process.js:294:12)
      at ChildProcess.emit (events.js:188:13)
      at ChildProcess.EventEmitter.emit (domain.js:441:20)
      at maybeClose (internal/child_process.js:978:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)

Additional Data

  Your Environment Information ---------------------------
     Operating System:          win32
     Node Version:              11.6.0
     Framework Version:         1.51.0
     Plugin Version:            1.3.9
     SDK Version:               2.1.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
abhishekdixit1508commented, Sep 7, 2019

Hi, I was facing the same issue yesterday after serverless version upgrade. After spending a day 😦 I have downgraded the version to 1.49.0 (2019-07-30) and it just worked 😃. Hope serverless will fix this bug soon.

0reactions
tysoncadenheadcommented, Mar 31, 2020

I’m seeing a similar issue with existing: true

It gets to: “Installing dependencies for custom CloudFormation resources”

and then just exists without deploying and without throwing any errors. If I remove existing: true from my s3 bucket, it continues to deploy

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting existing:true on S3 bucket causes deployment to fail
I get this when I set existing: true to the s3 events trigger of a lambda function.
Read more >
Troubleshoot deployment issues in Lambda
When you upload a function's deployment package from an Amazon S3 bucket, the bucket must be in the same Region as the function....
Read more >
Function s3 trigger with existing: true generates another ...
Hello, as title says, i've a function with a trigger on S3 using the new definition: functions: lambda: handler: src/handler.handler events: ...
Read more >
Event trigger using serverless framwork on an existing S3 bucket
The issue comes from the fact that CustomDashresourceDashexistingDashs3LambdaFunction lambda runs as the deployementRole and not under the ...
Read more >
Top 10 Serverless Deployment Errors (and How to Fix Them)
This situation often arises when a deployed stack's subsequent deployment fails, along with the stack rollback or deletion. Deletes often fail ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found