php artisan cache:clear Make sure you have the appropriate permissions #4765

Closed
opened 2026-02-05 09:13:50 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @m4ntic0r on GitHub (May 12, 2024).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

After updating my bookstack today to version 24.05 i see this error for the first time:

root@bookstack:/var/www/html# php artisan cache:clear i get the error: ERROR Failed to clear cache. Make sure you have the appropriate permissions.

debian 12, latest stable version. never had this before.
php artisan config:clear and php artisan view:clear without error only cache:clear with error.

checked permissions, set new permissions, tried temporary full permissions -> always this error?

Exact BookStack Version

v24.05

Log Content

No response

Hosting Environment

Debian 12, PHP8.2 fpm

Originally created by @m4ntic0r on GitHub (May 12, 2024). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario After updating my bookstack today to version 24.05 i see this error for the first time: root@bookstack:/var/www/html# php artisan cache:clear i get the error: ERROR Failed to clear cache. Make sure you have the appropriate permissions. debian 12, latest stable version. never had this before. php artisan config:clear and php artisan view:clear without error only cache:clear with error. checked permissions, set new permissions, tried temporary full permissions -> always this error? ### Exact BookStack Version v24.05 ### Log Content _No response_ ### Hosting Environment Debian 12, PHP8.2 fpm
OVERLORD added the 🛠️ Enhancement🐛 Bug🏭 Back-End labels 2026-02-05 09:13:50 +03:00
Author
Owner

@m4ntic0r commented on GitHub (May 12, 2024):

for a test i reverted my container back to 24.02 an tried again:
image

after update to 24.05:
image

@m4ntic0r commented on GitHub (May 12, 2024): for a test i reverted my container back to 24.02 an tried again: ![image](https://github.com/BookStackApp/BookStack/assets/24922164/4b83c902-56d7-49f7-9227-b55d4b490dad) after update to 24.05: ![image](https://github.com/BookStackApp/BookStack/assets/24922164/87f8492d-32ac-4a61-848a-baf571d7a608)
Author
Owner

@ssddanbrown commented on GitHub (May 13, 2024):

@m4ntic0r I've checked on a couple of my instances, but those clear fine. Did a quick scan of famework code for the command and cache flushing but can't see any issues.

  • Do you have any option set in your env starting with CACHE_?
  • Can you share the output of running ls -alh storage/framework/cache/data/ from your BookStack install directory?
  • Are you ever manually deleting the storage/framework/cache/data/ folder as part of your process?
@ssddanbrown commented on GitHub (May 13, 2024): @m4ntic0r I've checked on a couple of my instances, but those clear fine. Did a quick scan of famework code for the command and cache flushing but can't see any issues. - Do you have any option set in your env starting with `CACHE_`? - Can you share the output of running `ls -alh storage/framework/cache/data/` from your BookStack install directory? - Are you ever manually deleting the `storage/framework/cache/data/` folder as part of your process?
Author
Owner

@maxi322 commented on GitHub (May 13, 2024):

I had the same problem yesterday when I updated my instance wich is running inside a LXC container on Proxmox.
I wanted to reproduce it today but now this command does not throw this error anymore and seems to work.

@maxi322 commented on GitHub (May 13, 2024): I had the same problem yesterday when I updated my instance wich is running inside a LXC container on Proxmox. I wanted to reproduce it today but now this command does not throw this error anymore and seems to work.
Author
Owner

@m4ntic0r commented on GitHub (May 13, 2024):

@ssddanbrown
only line with cache_ is:
CACHE_DRIVER=file

i dont have a data directory there.

root@bookstack:/var/www/html/storage/framework/cache# ls -lha
insgesamt 12K
drwxrwxr-x 2 www-data www-data 4,0K 12. Mai 15:51 .
drwxrwxr-x 5 www-data www-data 4,0K 31. Dez 2021 ..
-rwxrwxr-x 1 root root 20 23. Feb 2020 .gitignore
root@bookstack:/var/www/html/storage/framework/cache#

i created an empty data dir there and:
INFO Application cache cleared successfully.

@m4ntic0r commented on GitHub (May 13, 2024): @ssddanbrown only line with cache_ is: CACHE_DRIVER=file i dont have a data directory there. root@bookstack:/var/www/html/storage/framework/cache# ls -lha insgesamt 12K drwxrwxr-x 2 www-data www-data 4,0K 12. Mai 15:51 . drwxrwxr-x 5 www-data www-data 4,0K 31. Dez 2021 .. -rwxrwxr-x 1 root root 20 23. Feb 2020 .gitignore root@bookstack:/var/www/html/storage/framework/cache# i created an empty data dir there and: INFO Application cache cleared successfully.
Author
Owner

@ssddanbrown commented on GitHub (May 13, 2024):

@m4ntic0r Thanks for the info and thanks @maxi322 for the confirmation.

Looks like the path did change in the last release to add the data folder, so could do with ensuring this folder exists via version control. I'll mark this to be done for the next patch release.

Dev Notes

  • Double check .gitignore addition does not conflict with cases where folder already exists
  • Will need to update parent .gitignore to ignore existing folders where existing but not added data folder (reference).
@ssddanbrown commented on GitHub (May 13, 2024): @m4ntic0r Thanks for the info and thanks @maxi322 for the confirmation. Looks like the path did change in the last release to add the data folder, so could do with ensuring this folder exists via version control. I'll mark this to be done for the next patch release. ### Dev Notes - Double check `.gitignore` addition does not conflict with cases where folder already exists - Will need to update parent `.gitignore` to ignore existing folders where existing but not added data folder ([reference](https://github.com/laravel/laravel/blob/10.x/storage/framework/cache/.gitignore)).
Author
Owner

@FreeTheTech101 commented on GitHub (May 13, 2024):

Just the heads up for anyone manually making the data folder, you need to also ensure that you use chown to set the owner to www-data, or else you'll end up getting HTTP 500 errors.

@FreeTheTech101 commented on GitHub (May 13, 2024): Just the heads up for anyone manually making the data folder, you need to also ensure that you use chown to set the owner to www-data, or else you'll end up getting HTTP 500 errors.
Author
Owner

@ssddanbrown commented on GitHub (May 13, 2024):

Maybe we should instead revert the folder path back then, to avoid unexpected issues with permissions.

@ssddanbrown commented on GitHub (May 13, 2024): Maybe we should instead revert the folder path back then, to avoid unexpected issues with permissions.
Author
Owner

@LordSimal commented on GitHub (May 16, 2024):

Just had the same issue here after updating to 24.05

> @php artisan cache:clear

   ERROR  Failed to clear cache. Make sure you have the appropriate permissions.  

> @php artisan view:clear

   INFO  Compiled views cleared successfully.  

   INFO  Nothing to migrate.  

   ERROR  Failed to clear cache. Make sure you have the appropriate permissions.  

   INFO  Compiled views cleared successfully.  

The problem was fixed by creating the folder storage/framework/cache/data

@LordSimal commented on GitHub (May 16, 2024): Just had the same issue here after updating to 24.05 ``` > @php artisan cache:clear ERROR Failed to clear cache. Make sure you have the appropriate permissions. > @php artisan view:clear INFO Compiled views cleared successfully. INFO Nothing to migrate. ERROR Failed to clear cache. Make sure you have the appropriate permissions. INFO Compiled views cleared successfully. ``` The problem was fixed by creating the folder `storage/framework/cache/data`
Author
Owner

@ssddanbrown commented on GitHub (May 18, 2024):

I've now reverted the directory change via 5651d2c43d, and this change will be part of a soon patch release.

@ssddanbrown commented on GitHub (May 18, 2024): I've now reverted the directory change via 5651d2c43d3e5e1ba34b74d566b017c45921f069, and this change will be part of a soon patch release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#4765