External Storage - FTP Folder does not get populated

Ever since owncloud 8 I had a folder to an FTP-share where all the scanned documents of everybody gets saved. It did unfortunately not regularly update the contents from the FTP-server. So users generally ignored it and used the bookmark I set in their file browsers.

I was always hoping for a next update to fix this.

Now I have Nextcloud 10 happily installed. The shared Scanner folder is now empty. No new scans (which do exist on the folder) are being shown at all. It was an embaresment when I first tried to introduce this and happily announced they’d find all their scans in their shared folder on their PC and it didn’t update on time.
But now, nothing at all happens. No updates for days. Be it I access the directory directly via web-interface, or try to delete the External Storage entry in the Admin-Panel and putting it back in. Changing folder names also doesn’t help.

I was really hoping for a close to real time update of this FTP-share in Nextcloud 10. But it not working at all now is way worse.

What can I do? The logfile doesn’t show anything for this.

Just minutes after this the following happened.

Before my first post, I renamed the original folder “Scanner” to “Scanner1” just to see if that would do the trick. It didn’t. I then created a second External Storage entry as the Folder “Scanner” with the same login credentials. This one stayed empty, too.
I then wrote the post above.

I now deleted the secondly created External Storage entry “Scanner” because the groups weren’t assigned yet and just renamed “Scanner1” back to “Scanner”.
Now the folder got populated with all the scans (files in that folder on the FTP-Server)

So now on the FTP-server i did touch test.txt and then chown scanner:scanner test.txt with chmod 666 test.txt and also wrote a line into it, then reloading the folder on the webinterface again and again, “test.txt” doesn’t show at all.
It is set to check for changes after every direct access.

So still, how to remedy this?

The log states now this after almost every file in that FTP-folder was accessed:
fclose(): FTP server error 451:451 Transfer aborted. Broken pipe at /usr/local/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php#124
This seems to be related to the data transfermode being passive instead of active, which afaik the FTP-client has to do? So, how can I change that. Maybe that helps with all of this. Is it something in Nextcloud, or maybe even my PHP installation?
This error is also only shown in relation to my connected user account, which I am not logged in as (just the desktop-client which downloaded all the files onto my harddrive). I am currently only logged in as the admin account.

When I now delete a file via the desktop client, the deleted file still shows in the webinterface, and I get this error attributed to the user account that deleted the file:

{"reqId":"0FSOH64YouYY9dzH22Uy","remoteAddr":"217.253.***.***","app":"DeleteOrphanedItems","message":"0 orphaned comment read marks deleted","level":0,"time":"2016-09-09T03:03:42+02:00","method":"GET","url":"\/cron.php","user":"--"}
{"reqId":"Xms7CdMcVyXPEzmOWqVd","remoteAddr":"217.253.***.***","app":"admin_audit","message":"File deleted: \"\/Scanner\/doc01909420160823154301.pdf\"","level":1,"time":"2016-09-09T03:03:45+02:00","method":"DELETE","url":"\/remote.php\/webdav\/Scanner\/doc01909420160823154301.pdf","user":"user.name"}
{"reqId":"Xms7CdMcVyXPEzmOWqVd","remoteAddr":"217.253.***.***","app":"no app in context","message":"Could not find mount point, can't keep encryption keys","level":3,"time":"2016-09-09T03:03:45+02:00","method":"DELETE","url":"\/remote.php\/webdav\/Scanner\/doc01909420160823154301.pdf","user":"user.name"}
{"reqId":"Xms7CdMcVyXPEzmOWqVd","remoteAddr":"217.253.***.***","app":"PHP","message":"fclose(): FTP server error 451:451 Transfer aborted. Broken pipe\r\n at \/usr\/local\/www\/nextcloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#124","level":3,"time":"2016-09-09T03:03:45+02:00","method":"DELETE","url":"\/remote.php\/webdav\/Scanner\/doc01909420160823154301.pdf","user":"user.name"}
{"reqId":"Xms7CdMcVyXPEzmOWqVd","remoteAddr":"217.253.***.***","app":"PHP","message":"fclose(): FTP server error 450:450 Transfer aborted. Link to file server lost\r\n at \/usr\/local\/www\/nextcloud\/apps\/files_external\/3rdparty\/icewind\/streams\/src\/Wrapper.php#124","level":3,"time":"2016-09-09T03:03:47+02:00","method":"DELETE","url":"\/remote.php\/webdav\/Scanner\/doc01909420160823154301.pdf","user":"user.name"}
{"reqId":"Xms7CdMcVyXPEzmOWqVd","remoteAddr":"217.253.***.***","app":"PHP","message":"unlink(): Error Deleting file: 550 \/doc01909420160823154301.pdf: No such file or directory\r\n at \/usr\/local\/www\/nextcloud\/apps\/files_external\/lib\/Lib\/Storage\/FTP.php#98","level":3,"time":"2016-09-09T03:03:49+02:00","method":"DELETE","url":"\/remote.php\/webdav\/Scanner\/doc01909420160823154301.pdf","user":"user.name"}
{"reqId":"DvFb2\/\/yPwGnzfKo3GGw","remoteAddr":"217.253.***.***","app":"no app in context","message":"Invalidating tokens older than 2016-09-08T01:14:40+00:00","level":1,"time":"2016-09-09T03:14:40+02:00","method":"GET","url":"\/cron.php","user":"--"}

Same and curently only user using the desktop client, as the others are fast asleep.

Now again a few minutes later, the file is deleted, no log entry concerning this except the above. And the file test.txt still doesn’t show.

One day later, the test.txt still doesn’t show.

In the bugtracker, you find a number of FTP issues. For ownCloud 9.2 and NC 11 (expected end of the year), there will be a new FTP storage implementation:

There are still some open issues: https://github.com/owncloud/core/issues/16407 and other topics. You’ll find some more ideas how to debug this problem. Then it’s probably better to track such issues on the bugtracker on github.com/nextcloud/server/issues.

Thank you very much for that info. I just thought that the error was somewhere on my side of the implementation.

I’ll be looking forward to NC11 then. And still supply my users with a link to the share using their native file browsers until then.

There could still be an issue with your FTP-server.

Only because it is new doesn’t mean that it is working in your case. If you have some time, you can use the daily build (that is the developing branch) and test if it is working. But don’t use this yet for a productive environment. It’s just in case it doesn’t work, you can already now report issues and developers can start working on the problem, so it is sure that it will work once NC 11 is released.

I will do that later this weekend then.