Closed (fixed)
Project:
Boost
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Apr 2011 at 11:08 UTC
Updated:
9 May 2012 at 14:00 UTC
Jump to comment: Most recent file
I have this error
Warning: rmdir(cache/normal/empresa.artic-group.net//taxonomy) [function.rmdir]: Directory not empty en _boost_rmdir() (línea 1047 de /home/empresa/public_html/sites/all/modules/boost/boost.module).
Warning: rmdir(cache/normal/empresa.artic-group.net//rate) [function.rmdir]: Directory not empty en _boost_rmdir() (línea 1047 de /home/empresa/public_html/sites/all/modules/boost/boost.module).
And I have also a question, My sitemap is being deleted is it possible boost deletes it?
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | boost-1138630-12-rmdir-race-condition.patch | 390 bytes | mikeytown2 |
| #2 | boost-rmdir.patch | 274 bytes | bgm |
Comments
Comment #1
egarias commentedSorry mistakenly assigned to Elysia,
Comment #2
bgm commentedIn Boost 6.x-1.x, the rmdir was called with @, i.e. @rmdir(), to suppress PHP warnings.
It's a rather minor issue, and is probably caused by the webserver permissions (ex: files copied over from an old installation). I'm rather tempted to silence the rmdir as in previous versions of boost.
Related issue : #101073: rmdir - directory not empty, take two (for Drupal 4.7!)
For the sitemap question: Boost is careful to delete only files in the cache directory. I'd need more information about that if your bug is caused by boost (test by disabling the boost module). Please open a separate issue if the issue persists.
Comment #3
bgm commented(changing issue title for people who search 'rmdir')
Comment #4
bgm commentedDuplicate 7.x issue: #1132156: rmdir warning given for non-empty directory
Comment #5
endrus commentedPatch in #2 fixed the issue for me.
Comment #6
ergophobe commented#2 seems to work okay.
Of course, it doesn't change the behavior, but it does suppress the error.
File ownership and permissions all look right to me, though, so I'm not sure why the rmdir is failing.
Comment #7
Bandy commentedBetter is:
Replace with:
Comment #8
ergophobe commentedBandy, that doesn't really make sense. If (empty($dir)) evaluates to true, that means that the value of $dir is an empty string, empty array, zero, NULL, or whatever - anything but a path or name of a directory. So in effect, that will only fire if $dir is an empty string which means that the rmdir call will always fail.
If $empty_dir is TRUE, that means that is_dir($dir) has already returned true (line 788 in current git HEAD).
So the original change is the right way.
Comment #9
Bandy commentedWell, the problem is that it suppressed with @ only an error message. Because there were other problems at the site I get this not to face. What happened to my path, the folders will be created including the sides, but then after the expiration of the time, only the sides, but not the folder will be deleted. As for me, do not change the folder as normal, I think it makes more sense.
Comment #10
ergophobe commentedYes, that's true - this fix is merely suppressing the errors, but not dealing with the root cause. The problem is that to figure that out, you need to know why rmdir() isn't working (file permissions, directory permissions, etc) and then you need to figure out a way to handle that problem.
Some of this in terms of which functions are available will be dependent on your environment (Unix/Windows, Posix extensions installed/not installed, safe mode in effect or not in effect, and to some extent whether PHP is running as CGI, in which case the site owner is probably the script owner, where in other circumstances the process is owned by 'nobody' or 'system').
If you want to have a go at it, depending on your environment and permissions, PHP gives you a lot of tools.
You can check file permissions, file ownership, find out owner of the current script file, which user owns the PHP process (and you need a fallback for Windows or if Posix extensions are otherwise not installed - see the function comments). If you (or more accurately, the user running the PHP process) have adequate permissions, you can change file permissions and file ownership, perhaps even check if the parent directory is writeable since that determines what you can do with files in a directory (so it could determine why the directory you're trying to delete is not empty, but also why you can't remove an empty dir).
Comment #11
Bandy commented...
Comment #12
mikeytown2 commentedThis is a race condition most likely. I've added in one more check to make sure this is a dir before trying to remove it; but this is a race condition; using @ is the safest way forward.
Comment #13
bgm commentedThanks for the patch!
Committed to 7.x-1.x.