bref: Serverless invoke local error "Runtime.ExitError"

Edit: please try the workaround here: https://github.com/brefphp/bref/issues/409#issuecomment-581425967


Hello,

i followed your new documentation under https://bref.sh/docs/local-development.html and get following error if try to run “serverless invoke local --docker -f myFunction”

Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Building Docker image...
START RequestId: 52fdfc07-2182-154f-163f-5f0f9a621d72 Version: $LATEST
END RequestId: 52fdfc07-2182-154f-163f-5f0f9a621d72
REPORT RequestId: 52fdfc07-2182-154f-163f-5f0f9a621d72	Duration: 0.00 ms	Billed Duration: 100 ms	Memory Size: 1536 MB	Max Memory Used: 6 MB	
{
  "errorType": "Runtime.ExitError",
  "errorMessage": "RequestId: 52fdfc07-2182-154f-163f-5f0f9a621d72 Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap]"
}


/usr/lib/node_modules/serverless/lib/classes/Error.js:94
    throw new Error(inspect(e));
          ^
Error: 1
    at process.module.exports.logError.e (/usr/lib/node_modules/serverless/lib/classes/Error.js:94:11)
    at process.emit (events.js:198:13)
    at process.emit (/usr/lib/node_modules/serverless/node_modules/source-map-support/source-map-support.js:465:21)
    at /usr/lib/node_modules/serverless/node_modules/bluebird/js/release/debuggability.js:199:33
    at activeFireEvent (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/debuggability.js:242:44)
    at fireRejectionEvent (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/debuggability.js:632:14)
    at Promise._notifyUnhandledRejection (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/debuggability.js:65:9)
    at Timeout._onTimeout (/usr/lib/node_modules/serverless/node_modules/bluebird/js/release/debuggability.js:44:14)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

Any idea whats wrong?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 34 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Hey everyone, I think wit the Docker images we now have a much more reliable + much faster method to run functions locally:

docker run --rm -v $(PWD):/var/task:ro,delegated bref/php-74 my-handler.php '{}'

Replace my-handler.php with the name of your handler file. The event is passed at the end as a JSON string.

As you will see, execution is near-instantaneous because we don’t need the overhead of the serverless local command downloading layers.

Let me know if this works well. If it does, we can change the documentation and probably add a vendor/bin/bref command to simplify this.

Will be solved in v1.0 by #785 (vendor/bin/bref local hello).

Great news, I’ve been working on a solution that solves all the problems (AFAICT), I’m really excited about it: #785

Feedback is welcome!

Also, I came on this issue because of the “Runtime.ExitError”, and I had to try 3 different version of the php7.4 layer before gettin the function to run.

  - arn:aws:lambda:eu-west-2:209497400698:layer:php-74:7 // Working 🎉
  - arn:aws:lambda:eu-west-2:209497400698:layer:php-74:8 // Runtime.ExitError
  - arn:aws:lambda:eu-west-2:209497400698:layer:php-74:9 // Runtime.ExitError
  - ${bref:layer.php-74} // // Runtime.ExitError

I really hope new bref user never stamble upon this issue because it’s crazy 😦