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
- #409 Add a `bref local` command to invoke functions locally This command does not use Docker: it relies on a local PHP cli binary. — committed to brefphp/bref by mnapoli 4 years ago
- #409 Add a `bref local` command to invoke functions locally This command does not use Docker: it relies on a local PHP cli binary. — committed to brefphp/bref by mnapoli 4 years ago
- #409 Add a `bref local` command to invoke functions locally This command does not use Docker: it relies on a local PHP cli binary. — committed to brefphp/bref by mnapoli 4 years ago
- #409 Add a `bref local` command to invoke functions locally This command does not use Docker: it relies on a local PHP cli binary. — committed to brefphp/bref by mnapoli 4 years ago
- #409 Add a `--file` option to the `bref local` command — committed to brefphp/bref by mnapoli 4 years ago
- #409 Document the `bref local` command — committed to brefphp/bref by mnapoli 4 years ago
- #409 Support other other config formats than serverless.yml for `bref local` — committed to brefphp/bref by mnapoli 4 years ago
- Merge pull request #785 from brefphp/run-local #409 Add a `bref local` command to invoke functions locally — committed to brefphp/bref by mnapoli 4 years ago
Hey everyone, I think wit the Docker images we now have a much more reliable + much faster method to run functions locally:
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.
I really hope new bref user never stamble upon this issue because it’s crazy 😦