-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Cache flushing showing wrong output message when unsuccessful due to permission issue #33310
Comments
This is a file permission issue and unrelated to Laravel. |
@driesvints Since it is a permission issue, will it be wrong if Laravel correctly responds to such permission issue and even optionally notify users of same instead of wrongly (silently) notifying user that action was successful? |
I'm deploying my first laravel application and lost several hours because of this bug. |
@driesvints I think what's being asked of this issue isn't how/why the issue happens, but if Laravel's artisan command can be more verbose when that issue happens. My assumption is that it should be possible to do so - though may not be as simple/easy to pull off as one would expect it might be. For instance the So as @damms005 pointed out the root issue lies in All that said, IMHO I don't think solving it there is viable. Since Filesystem is such a fundamental component and changing Solving the issue in the So it would look like:
Instead of:
|
Thanks for the detailed reply @mallardduck. You can PR that for Taylor to have a look at 👍 |
@driesvints if you think that's a worthwhile solution to discuss I can make that happen! TBH I was not sure how much I liked it yet, it seems there could be a more elegant solution. Yet if this PR helps get that conversation started lets go for it. |
Description:
This issue was previously reported but @taylorotwell closed it because it was not "very critical" and also not "worth the time to fix at the moment".
However, it's now almost 7 years since then. I believe that the year 2013 to present year 2020 is a considerably long period of time, and hopefully, it should now matter that if the command
cache:clear
oroptimize:clear
fails, it should not falsely displayApplication cache cleared!
, when indeed a permission issue prevented the application cache stored instorage/framework/cache/data
from being cleared.Also, while investigating this, I found that the issue lies in the implementation of
deleteDirectory() in Filesystem.php
, which does not countenance the success/failure of callingdelete()
on a file.This means that, in the future, this bug can also potentially affect any implementation that depends on
deleteDirectory() in Filesystem.php
, not only the core Laravel cache flushing.If a PR is welcomed to this effect, I can submit one, since it only requires correctly consuming
delete()
.Steps To Reproduce:
cache:clear
oroptimize:clear
from an environment that does not have write permission to files stored instorage/framework/cache/data
Application cache cleared!
, when, in reality, it was not clearedThe text was updated successfully, but these errors were encountered: