Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage path is somehow being reset to default #166

Open
damoncasale opened this issue Dec 23, 2024 · 2 comments
Open

Storage path is somehow being reset to default #166

damoncasale opened this issue Dec 23, 2024 · 2 comments

Comments

@damoncasale
Copy link

The storage path is somehow being reset to default, after the /tmp/storage paths are created. Help?

Here's my CloudWatch log:

<!--StartFragment-->
INIT_START Runtime Version: provided:al2.v75	Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:(obscured)
--
Creating storage directories: /tmp/storage/bootstrap/cache, /tmp/storage/framework/cache, /tmp/storage/framework/views, /tmp/storage/psysh
Running 'php artisan config:cache' to cache the Laravel configuration
INFO  Configuration cached successfully.
[23-Dec-2024 04:13:15] NOTICE: [pool default] 'user' directive is ignored when FPM is not running as root
[23-Dec-2024 04:13:15] NOTICE: fpm is running, pid 14
[23-Dec-2024 04:13:15] NOTICE: ready to handle connections
START RequestId: (obscured) Version: $LATEST
[2024-12-23 04:13:15] production.ERROR: The /var/task/bootstrap/cache directory must be present and writable. {"exception":"[object] (Exception(code: 0): The /var/task/bootstrap/cache directory must be present and writable. at /var/task/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php:179)
[stacktrace]
#0 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(132): Illuminate\\Foundation\\PackageManifest->write(Array)
#1 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(108): Illuminate\\Foundation\\PackageManifest->build()
#2 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(91): Illuminate\\Foundation\\PackageManifest->getManifest()
#3 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(80): Illuminate\\Foundation\\PackageManifest->config('aliases')
#4 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php(26): Illuminate\\Foundation\\PackageManifest->aliases()
#5 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(316): Illuminate\\Foundation\\Bootstrap\\RegisterFacades->bootstrap(Object(Illuminate\\Foundation\\Application))
#6 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(187): Illuminate\\Foundation\\Application->bootstrapWith(Array)
#7 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(171): Illuminate\\Foundation\\Http\\Kernel->bootstrap()
#8 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#9 /var/task/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1190): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#10 /var/task/public/index.php(17): Illuminate\\Foundation\\Application->handleRequest(Object(Illuminate\\Http\\Request))
#11 {main}
"}
END RequestId: (obscured)
REPORT RequestId: (obscured)	Duration: 202.42 ms	Billed Duration: 1130 ms	Memory Size: 2048 MB	Max Memory Used: 97 MB	Init Duration: 926.59 ms

<!--EndFragment-->

I'm using serverless to deploy a Laravel 11 application from a Github action, and attempting to make a single API call to that application. Let me know what other information you need to debug this.

@mnapoli
Copy link
Member

mnapoli commented Dec 23, 2024

Can you provide more details: is this a brand new Bref and Laravel project? Or was it working before and stopped after upgrading? (if yes, upgrading what?)

Trying to understand if it is impacting everyone or related to something in your project that trips up the Laravel Bridge.

@damoncasale
Copy link
Author

damoncasale commented Dec 23, 2024

I've attempted to define a single API route which generates a PDF inside of a brand new Laravel 11 installation. It works fine in a local environment (running on an Amazon EC2 instance) but errors running on Lambda.

Since it's difficult to trace what parameters are being passed in Lambda, I logged the manifest path to a file in my local environment (by adding some logging code to the PackageManifest.php file itself). The manifest file isn't being written to the /tmp/storage folder, which is why this is erroring out.

I looked over the code for BrefServiceProvider.php and it looks like it's expecting the settings changes in the register hook to be preserved? I don't fully understand how that's supposed to happen.

Also, it looks like the Bref example is Laravel 10, not Laravel 11. Could Laravel 11 be causing an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants