Errors with ftp filesystem


#1

We are using the ftp filesystem for our workspaces. We are encountering a situation that occasionally an error occurs with fopen stating the filename is empty. Once that occurs there is an endless repeat of feof and fread errors. It seems that the code gets stuck in a loop at that point.

Pydio 7
Ubuntu 14.04.5
PHP 5.6.30-5+ded.sury.org-trusty+2
MySQL 5.6.34

The same issue occurs in Pydio 8.

Here are the actual lines in the log for when the error first occurs. The feof &fread lines repeat forever, the syslog grew to 18GB before I killed the PHP process.

Jun  5 15:53:21 ip-***-***-***-*** php[31462]: PHP_CLI#011_username_#011FtpAccessDriver.php#011error l.141#011message=fopen(): Filename cannot be empty
Jun  5 15:53:21 ip-***-***-***-*** php[31462]: PHP_CLI#011_username_#011FtpAccessDriver.php#011error l.142#011message=feof() expects parameter 1 to be resource, boolean given
Jun  5 15:53:21 ip-***-***-***-*** php[31462]: PHP_CLI#011_username_#011FtpAccessDriver.php#011error l.143#011message=fread() expects parameter 1 to be resource, boolean given
Jun  5 15:53:21 ip-***-***-***-*** php[31462]: PHP_CLI#011_username_#011FtpAccessDriver.php#011error l.142#011message=feof() expects parameter 1 to be resource, boolean given
Jun  5 15:53:21 ip-***-***-***-*** php[31462]: PHP_CLI#011_username_#011FtpAccessDriver.php#011error l.143#011message=fread() expects parameter 1 to be resource, boolean given

#2

Hi,
do you have files/folders named using special characters on your FTP ?


#3

There may be the following: #, !, $, (, ), -, _, .,~,+, [, ]

Are there any that should not be used?
Could the uploader be modified to validate filenames and do an automatic rename and log it?

Ron


#4

Hi,
i would advise you to avoid all special chars, it’s tolerated to use - or _ but don’t start a file with that, for the validation of filenames i will have a look and see if it’s possible, i’ll keep you updated.


#5

Hello @zayn,

I agree special characters should not be used, however, when there are a large number of users that work on Windows which allows special characters and Pydio does not inform the user a filename is not acceptable, there will be this issue. An example was someone uploaded a folder that was labeled as PDF#7458. This was done to be meaningful to a team of people that the folder contained PDF documents for a particular item #. Makes logical sense. However, when it was uploaded in Pydio it did not tell the user there was an error. In fact when it tried to create the folder on the ftp site is when an error occurred. Then it tried to upload the files to the original folder name which didn’t exist.

So, one immediate fix that would be beneficial for the ftp filesystem would be to check for these type of errors and inform the user a folder cannot be created and then stop trying to copy files to a folder that could not be created.

A special symbol that did not cause issues is “@”. Folders and files were uploaded and created successfully. I am starting to make a list of common special characters that I typically see used in filenames and folder names and will test those and provide additional results as to which ones work.

Best regards,
Ron


#6

Hello @zayn,

I tested a variety of Special characters and found only one symbol that causes an error that Windows based computers allow, “#” for folders. Files containing these symbols upload without error.

Using the New folder feature in Pydio, or uploading folders, using a # character in the folder name looks like it is successful, shows the folder name with the #, and a pop-up message says that it created it.

If you attempt to open the folder it gives an error and then the list refreshes and shows two folders. One named as entered and the other with the name truncated at the #.

To duplicate,

  1. Create a new folder name called “PDF#1” - You will get a pop-up success message and the new folder will be listed
  2. Attempt to open the new folder called “PDF#1” - You will see an error pop-up with a Stack trace. The folder list refreshes with two folders: “PDF” and “PDF#1”. You will be able to open PDF with success.

Character causing error

Characters accepted
’ ! $ % & ( ) , ; @ [ ] ^ ` { } ~ + =