Problem/Motivation
The file system CRON is gives a somewhat unclear error message in logs when a temporary files can not be deleted because the have already been removed or due to permissions the file is not accessible.
The file system records the following Error in the logs: Could not delete temporary file "temporary://AAA.pdf" during garbage collection
Proposed resolution
Improve error message for logging
Remaining tasks
- Define new error message
- Update error message
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | drupal-2850497-10.patch | 668 bytes | littlecoding |
Comments
Comment #2
cilefen commentedIf it helps, file_cron() does the following:
Comment #3
littlecodingThe file does exist in the temp directory still. And I have ruled out the PHP safe mode restrictions in this case.
But if the error is triggered by the
file_exists(string $filename)function, I think the wording of the message could be improved. Something along the lines of :Could not delete temporary file "%path" during garbage collection. Temporary file not found or inaccessible due to safe mode restrictions.
with a link to the PHP safe mode page http://php.net/manual/en/features.safe-mode.php
Comment #4
cilefen commentedSafe mode doesn't exist any more. There is not an error triggered by the call to file_exists(). It is returning FALSE.
Comment #5
littlecodingOdd. Those are the only to reason the PHP doc list for returning FALSE.
A manual delete of the temporary file works via the admin UI provided by contrib module File Entity. I have also tried this manual delete method on a file that no longer exists in the temp directory and it works fine.
Comment #6
cilefen commentedYou must be reading different docs from me ;-).
file_exists() returns false if the file does not exist. If false, the message is logged.
Comment #7
littlecodingYep those are the reasons I was (I guess poorly) referring to. More work on those PHP log files then to give more insight on the issue.
Comment #8
littlecodingAfter a few days of allowing the site to function as normal and watching the logs, I've managed to identify that a server function is occasionally clearing out files from the temporary directory before the Drupal CRON garbage collection has a chance to clean up after itself. Default timing of these CRON job looking to remove a file like is is 6 hours, that is also the shortest time option give in the admin dashboard by core. I don't feel a shorter time interval needs to be added, rather a better error message in the watchdog could help site admins who may also run into this issue. So I have change the Category of the issue from Bug Report to Feature request, updated the title and issue description.
How about this for the improved error message?
Could not delete temporary file "%path" during garbage collection. File was not found or was not accessible.
Comment #9
littlecodingComment #10
littlecodingComment #11
littlecodingComment #12
berdirI believe we can do better, closing as duplicate of #2802803: Temporary files whose files are missing on the disk result in never-ending error log messages.