550 Server Nightmare

Im getting 550 Server errors every time I try to delete a directory that has things in it. Sometimes Im able to delete individual files, but often empty directories produce this same error (saying there’s something in there).

Ive posted something to support but Id like to know if Im doing something wrong here.

Which is correct! This is normal.

[quote]but often empty directories produce this same error (saying there’s something in there).
Is it possible there are “system” files within the directory that you are just not seeing? If you are using your ftp client to do this, make sure that you client is configured to show all files; many client by default will “supress” display of some system files (for example “.htaccess”).

The best way to check to see if the directory is really empty, is to log to the shell, cd to the directory in question, and run “ls -la” - you may well find there are files left in the directory after all :wink:


Hi RL,

I dont entirely understand your answer because I have been able to delete directories full of files without getting any warning from the server - for example, deleting the .old versions of joomla, phpbb, etc. Ive only gotten these errors beginning today.

Hi Lynn,

There are ways, of course, to delete directories full of files and I was probably remiss in not clarifying/qualifying my answer better. I assumed the original poster (you?) was seeing the errors from an ftp client that was passing a simple “RMD directoryname” FTP command - if this is the case, and there are files in the directory, a “550 directoryname: Directory not empty” is what will be returned. The “RMD” command will only delete an empty directory, and return the indicated error if there are any files in the directory.

That said, if an ftp client has a “recursive delete” command, absent the directory containing any files for which the ftp user has insufficient “write” permissions, the deletion will take place with no error (I use leechftp, and it does have that function).

You can also delete directories that contain files , assuming you have adequate permissions, from the shell command line using the “rm” command:

Usage: rm [OPTION]… FILE…
Remove (unlink) the FILE(s).

-d, --directory unlink FILE, even if it is a non-empty directory
(super-user only; this works only if your system
supports unlink' for nonempty directories) -f, --force ignore nonexistent files, never prompt -i, --interactive prompt before any removal --no-preserve-root do not treat/’ specially (the default)
–preserve-root fail to operate recursively on `/’
-r, -R, --recursive remove the contents of directories recursively
-v, --verbose explain what is being done
–help display this help and exit
–version output version information and exit

To remove a file whose name starts with a -', for example-foo’,
use one of these commands:
rm – -foo

rm ./-foo

Note that if you use rm to remove a file, it is usually possible to recover
the contents of that file. If you want more assurance that the contents are
truly unrecoverable, consider using shred.

This is different than using the “rmdir” command:

Usage: rmdir [OPTION]… DIRECTORY…
Remove the DIRECTORY(ies), if they are empty.

ignore each failure that is solely because a directory
is non-empty
-p, --parents remove DIRECTORY, then try to remove each directory
component of that path name. E.g., rmdir -p a/b/c' is similar tormdir a/b/c a/b a’.
-v, --verbose output a diagnostic for every directory processed
–help display this help and exit
–version output version information and exit

which you should be a little careful with, unless you are really sure of what you are doing with the -p option.

It is a little hard to determine exactly why you are getting the 550 response, unless we know what “method” (command) you were using in each of the “it worked” and “it returned a 550” instances.

A GUI ftp client can confuse things, as it is sometimes not readily apparent which command the client is sending. Different clients sending different commands can account for the “difference” in success. It could also be that permissions on the files/directories within the directory being deleted are the problem.

The “.old” directories left from “one-click upgrades” on Dreamhost, and their contents, are usually owned by the ftp user in whose directory they are stored - other directories could (and I suppose, theoretically, even certain “.old” directories -though I do not think that is the case with “one-clicks” currently supported on Dreamhost), depending upon your CGI set-up, if they were created programmatically from a running script, or had their permission set a certain way by a script, may not be able to be deleted by the user.

Given these clarifications, which I hope explain to some degree why you can *sometimes" delete a directory containing files, the 550 error remains the indication that there is a file, or are files, in the directory that are preventing the directory from being “deleted/removed” by the command that was issued.

I hope I haven’t just confused you more thoroughly with this; if you will post more specifics about the methods/commands in use when it “worked” and when it didn’t, I’m sure one of the “wizards” that hang out here can get to the bottom of it :smiley: