Renamed files on read-only local external storage cause "File was deleted from server" error

help

#1

Steps to reproduce
1. Connect read-only, locally connected external storage on owncloud server version 8.1.x containing files whose file names contain some characters unknown in the ISO8859-1 encoding.
2. Allow desktop client to sync and produce an error relating to the strange characters (sorry - not sure what they were, they appeared as a '?'). File names containing the strange characters did not sync to the client.
3. Regenerate(*) those files whose file names contained strange characters using a UTF-8 character encoding and allow desktop client to sync again.
4. (optional) Upgrade owncloud server from 8.1.x t 9.0.8 (current stable) and run occ files:scan --all (which completed without error)

(*) The regeneration process was: a) delete file b) convert a flac file into mp3 format using lame and use iconv --to-code=UTF-8 to create the file name for the mp3.

Expected behaviour
After regenerating the files on the server-side, they will be re-downloaded on the client-side and there will be no errors in the client settings window.

Actual behaviour
The server-side files are indeed updated on the client-side with the correct file names, but there is a list of errors like:

mp3/Paul Lewis/Schubert - Piano Sonata D.845 - Wandererfantasie D.760 - etc - CD2 (2012)/03 - - Scherzo. Allegro vivace - Trio. Un poco piu: File was deleted from server

(in that example it was an accented u in "piu" which caused the need for re-naming the file)

The errors won't disappear on the client and the owncloud icon in the taskbar has a red cross.

I am currently syncing the files onto another machine to see if the errors will appear there. This will take about two days.

Client configuration
Client version: 2.3.1
Client operating system: Ubuntu 16.04

Server configuration
Operating system: Debian 8 (Jessie)
Web server: Apache2 2.4.10 (standard Debian package)
Database: Mysql-5.5 (standard Debian package)
PHP version: 5.6.30 (standard Debian package)
ownCloud version (see ownCloud admin page): 9.0.8
Updated from an older ownCloud or fresh install: Updated
Special configurations (external storage, external authentication, reverse proxy, server-side-encryption): Uses external storage to share specific folders read-only, otherwise fairly standard installation.

ownCloud log (data/owncloud.log)

Please paste possible errors in the following code block, see https://central.owncloud.org/t/how-to-find-webserver-or-oc-logfile-enable-php-logfile/808 for more info

No server logs are generated for these files.

#2

How did you "delete" the files? Sounds like you did this in the filesystem? In this case you would need to do a filescan to also eliminate them from the database.


#3

Hi, thanks for the quick reply! You're right; I deleted the files on the filesystem; outside of owncloud.

By "filescan" do you mean something like this:

sudo -u www-data php occ files:scan --all

I've done that on the server side and it doesn't seem to have solved the problem.


#4

Hi,

you should never touch files on the file system within the data directory. This can have unexpected side-effects, even with the availability of files:scan.

Instead use a client like cadaver and do the steps explained in [1] (just use remove/rm instead of move) to delete files.

[1] https://central.owncloud.org/t/moving-files-via-command-line-on-server-in-oc-9/6691/11


#5

Hello,

Do note that this is an "external storage" directory of type "Local" - that is, it's a directory on my owncloud server's standard filesystem which I am providing as a read-only share, but it's not the owncloud data directory. Surely I can change the files there server-side any way I wish, as long as I subsequently tell owncloud about it with files:scan?


#6

Ah, that wasn't that clear to me. Yes, if you're using the "external storage app" this should work with a files:scan, everything else is a bug and should be reported to https://github.com/owncloud/core/issues


#7

Ok, I've made a bug report: https://github.com/owncloud/core/issues/27550