-
Description: Following this guide: https://bref.sh/docs/first-steps.html How to reproduce:
serverless.yml
Saw this closed issue: #390 but it doesn't help. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
@kavatari this is most likely because you use php 8.0 locally and the serverless.yml is using the 7.4 layer When using Bref (and Lambda in general), you can see the logs in Cloudwatch > Log groups and you should see the error. Note that if you need support, you can use the Github discussion or join the Slack (see https://bref.sh/docs/community.html) |
Beta Was this translation helpful? Give feedback.
-
Hey, really sorry about the poor experience here. To find where the error is coming from, please run:
That will show the logs of the FYI that kind of error is a generic "server error", that means there's an error in the PHP code for some reason. |
Beta Was this translation helpful? Give feedback.
-
@mnapoli @t-richard just awesome guys, thanks for the quick response. Both answers were really helpful. I am new to AWS, so the hint using CloudWatch is awesome. Using "serverless logs" command is also a great a fast forward approach to view the logs. |
Beta Was this translation helpful? Give feedback.
-
I having the same issue, unfortunately setting the layer to php-80-fpm did not help. This is the error I'm getting in cloudwatch:
serverless.yml
|
Beta Was this translation helpful? Give feedback.
-
I have same issue, This is the error from the serverless logs: START RequestId: 2cc8d7a8-5111-4181-9173-8e1c9f86a481 Version: $LATEST [23-Jan-2022 12:35:47] NOTICE: fpm is running, pid 9 [23-Jan-2022 12:35:47] NOTICE: ready to handle connections NOTICE: PHP message: PHP Fatal error: Uncaught UnexpectedValueException: There is no existing directory at "/var/task/storage/logs" and it could not be created: Read-only file system in /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:216 Stack trace: #0 /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php(135): Monolog\Handler\StreamHandler->createDir() #1 /var/task/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(125): Monolog\Handler\StreamHandler->write() #2 /var/task/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48): Monolog\Handler\RotatingFileHandler->write() #3 /var/task/vendor/monolog/monolog/src/Monolog/Logger.php(327): Monolog\Handler\AbstractProcessingHandler->handle() #4 /var/task/vendor/monolog/monolog/src/Monolog/Logger.php(565): Monolog\Logger->addRecord() #5 /var/task/vendor/illuminate/log/Logger.php(183): Monolog\Logger->error() #6 /var/task/vendor/illuminate/log/Logger.php(94): Illuminate\Log\Logger->writeLog() #7 /var/task/vendor/illuminate/lo in /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 216 NOTICE: PHP message: PHP Fatal error: Uncaught UnexpectedValueException: There is no existing directory at "/var/task/storage/logs" and it could not be created: Read-only file system in /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:216 Stack trace: #0 /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php(135): Monolog\Handler\StreamHandler->createDir() #1 /var/task/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(125): Monolog\Handler\StreamHandler->write() #2 /var/task/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48): Monolog\Handler\RotatingFileHandler->write() #3 /var/task/vendor/monolog/monolog/src/Monolog/Logger.php(327): Monolog\Handler\AbstractProcessingHandler->handle() #4 /var/task/vendor/monolog/monolog/src/Monolog/Logger.php(565): Monolog\Logger->addRecord() #5 /var/task/vendor/illuminate/log/Logger.php(183): Monolog\Logger->error() #6 /var/task/vendor/illuminate/log/Logger.php(94): Illuminate\Log\Logger->writeLog() #7 /var/task/vendor/illuminate/lo in /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 216 END RequestId: 2cc8d7a8-5111-4181-9173-8e1c9f86a481 REPORT RequestId: 2cc8d7a8-5111-4181-9173-8e1c9f86a481 Duration: 267.50 ms Billed Duration: 607 ms Memory Size: 1024 MB Max Memory Used: 79 MB Init Duration: 338.92 ms nd it could not be created: Read-only file system in /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:216 Stack trace: #0 /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php(135): Monolog\Handler\StreamHandler->createDir() #1 /var/task/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(125): Monolog\Handler\StreamHandler->write() #2 /var/task/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48): Monolog\Handler\RotatingFileHandler->write() #3 /var/task/vendor/monolog/monolog/src/Monolog/Logger.php(327): Monolog\Handler\AbstractProcessingHandler->handle() #5 /var/task/vendor/illuminate/log/Logger.php(183): Monolog\Logger->error() #6 /var/task/vendor/illuminate/log/Logger.php(94): Illuminate\Log\Logger->writeLog() #7 /var/task/vendor/illuminate/lo in /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 216 Stack trace: #0 /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php(135): Monolog\Handler\StreamHandler->createDir() #1 /var/task/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(125): Monolog\Handler\StreamHandler->write() #2 /var/task/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php(48): Monolog\Handler\RotatingFileHandler->write() #4 /var/task/vendor/monolog/monolog/src/Monolog/Logger.php(565): Monolog\Logger->addRecord() #5 /var/task/vendor/illuminate/log/Logger.php(183): Monolog\Logger->error() #6 /var/task/vendor/illuminate/log/Logger.php(94): Illuminate\Log\Logger->writeLog() #7 /var/task/vendor/illuminate/lo in /var/task/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 216 END RequestId: 7c46413a-8750-4b69-8880-d1aac2349da5 REPORT RequestId: 7c46413a-8750-4b69-8880-d1aac2349da5 Duration: 5.96 ms Billed Duration: 6 ms Memory Size: 1024 MB Max Memory Used: 79 MB |
Beta Was this translation helpful? Give feedback.
@kavatari this is most likely because you use php 8.0 locally and the serverless.yml is using the 7.4 layer
${bref:layer.php-74-fpm}
. Replace it by the 8.0 layer${bref:layer.php-80-fpm}
When using Bref (and Lambda in general), you can see the logs in Cloudwatch > Log groups and you should see the error.
Note that if you need support, you can use the Github discussion or join the Slack (see https://bref.sh/docs/community.html)