Intermittent 500 unknown command


I am exporting document ( in batches) to a ftp server using vsftpd. In every batch there is one document that generates the error 500 unknown command.
How can I debug this error without having to get arm deep in to the code?
Are there any config settings that I need to take a closer look at?

Hope some one can help with this.

Thanks in advance.