symfony-bridge icon indicating copy to clipboard operation
symfony-bridge copied to clipboard

With cache warmup i have Warning: touch(): Unable to create file /var/task/var/cache/prod/Container3BKBjE9.legacy because Read-only file system

Open cedric-r-mycelium opened this issue 2 years ago • 7 comments

Symfony ~~6.1~~ 6.2

if a had - 'var/cache/prod/**' to servelerless.yaml package patterns i have this error

Warning: touch(): Unable to create file /var/task/var/cache/prod/Container3BKBjE9.legacy because Read-only file system

image

Only at the first run of lambda

cedric-r-mycelium avatar Dec 13 '22 09:12 cedric-r-mycelium

The .legacy extension lead me to think the cache you uploaded to lambda is not "fresh" and so Symfony tries to generate a new one. Did you include your var/cache/prod folder in your deployment package and did you run bin/console cache:warmup ---env=prod before the deployment ?

t-richard avatar Dec 13 '22 10:12 t-richard

i have a makefile for my deploy and in this file i have : @php bin/console cache:warmup --env=prod --no-debug sls deploy --stage=prod --region=eu-west-1

cedric-r-mycelium avatar Dec 13 '22 10:12 cedric-r-mycelium

👍 I found the root cause, it's append when you update Symfony in Symfony 6.2

cedric-r-mycelium avatar Dec 23 '22 14:12 cedric-r-mycelium

Now have this error on all version 6.*

cedric-r-mycelium avatar Jan 06 '23 08:01 cedric-r-mycelium

I found the probleme !!! it's only APP_DEBUG = true make this error !!!

cedric-r-mycelium avatar Jan 06 '23 12:01 cedric-r-mycelium

oh interesting, thanks for getting back to us with what you found !

Indeed the bridge is intended for production use and assumes you're running a APP_ENV=prod and APP_DEBUG=false because those versions generate stable var/cache folders.

But you're not the first one reporting something linked to running Symfony in a non-prod config, maybe we should reconsider that at some point :thinking:

t-richard avatar Jan 06 '23 12:01 t-richard

May be add more warning on the Bref/Symfony documentation will be enough

cedric-r-mycelium avatar Jan 12 '23 05:01 cedric-r-mycelium