I'm using Symfony 3.4.36 and experiencing a recurring cache issue where randomly every few days or hours, the application stops working with this error on screen:
Unable to write in the cache directory (var/cache/prod)
Current Behavior:
The application works fine for several days
Suddenly displays the cache write error
When I rename
var/cache/prodtoprod2and refresh, Symfony generates a newprodfolderApplication works again temporarily, but the issue recurs
Environment Details:
Shared hosting environment
Cache folder permissions: drwxr-xr-x 9 agenc agenc 4096 Nov 10 14:15 prod (after the prod folder has been generated automatically as mentioned in step 3)
The issue is completely random - sometimes it happens after days, sometimes after hours. The temporary fix works but doesn't provide a permanent solution.
Has anyone experienced similar random cache write issues in Symfony? What could be causing the cache directory to suddenly become unwritable, and what permanent solutions should I investigate?