Repository navigation
Description
I have no idea how to reproduce this yet.
Recently I did two operations with the Android client, first one was uploading a picture into "clientsync/pics/Camera" and the other one was deleting a folder inside "clientsync/pics/Berlin".
I have two computers: desktop D and laptop L. Both have the sync client configured to sync the subfolder "clientsync".
Today when I started D, I noticed that the sync client was downloading ALL files.
More details below.
Setup
ownCloud server 7.0.3RC2
Server OS: openSUSE 13.1
Sync client 1.7.0rc1 on both D and L
Client OS: openSUSE 13.1 on D, openSUSE Factory on L.
Using system cron
More information
These are my steps so far:
- Start sync client on D, notice that all files are getting synced.
- Cancel sync client
- Let's examine the file "clientsync/.directory" which didn't change synce August 2013
- On D's client database, the etag is now 54561feaa4358 and matches the server, because the file was already synced. However in my last backup, the etag was 527b548d98ec0.
- Then I had a look at L without starting the sync client, which gives the etag before the breakage: 527b548d98ec0. This is the same as on the backup.
This confirms that the etag of that untouched file ".directory" has been changed by some unknown event.
Since I'm only syncing "clientsync", I was curious whether the etag of other non-synced folders changed as well. Here's the file "files/amarok_eq.png" (a file that did not change since ages) in the current database:
+--------+---------+---------------------+----------------------------------+--------+---------------+----------+----------+-------+------------+-----------+---------------+------------------+---------------+-------------+
| fileid | storage | path | path_hash | parent | name | mimetype | mimepart | size | mtime | encrypted | etag | unencrypted_size | storage_mtime | permissions |
+--------+---------+---------------------+----------------------------------+--------+---------------+----------+----------+-------+------------+-----------+---------------+------------------+---------------+-------------+
| 17937 | 1 | files/amarok_eq.png | b4906cdc01f0ba7c04e1b218d1edf541 | 1 | amarok_eq.png | 16 | 6 | 41464 | 1331053852 | 1 | 54561fea83a9e | 30989 | 1331053852 | 27 |
+--------+---------+---------------------+----------------------------------+--------+---------------+----------+----------+-------+------------+-----------+---------------+------------------+---------------+-------------+
and here from the backup:
+--------+---------+---------------------+----------------------------------+--------+---------------+----------+----------+-------+------------+-----------+---------------+------------------+---------------+-------------+
| fileid | storage | path | path_hash | parent | name | mimetype | mimepart | size | mtime | encrypted | etag | unencrypted_size | storage_mtime | permissions |
+--------+---------+---------------------+----------------------------------+--------+---------------+----------+----------+-------+------------+-----------+---------------+------------------+---------------+-------------+
| 17937 | 1 | files/amarok_eq.png | b4906cdc01f0ba7c04e1b218d1edf541 | 1 | amarok_eq.png | 16 | 6 | 41464 | 1331053852 | 1 | 53b71c4809e7b | 30989 | 1331053852 | 27 |
+--------+---------+---------------------+----------------------------------+--------+---------------+----------+----------+-------+------------+-----------+---------------+------------------+---------------+-------------+
Very strange... so the etag even changed for files outside the syncing range.
So either something automatically triggered that on the server side or something went wrong related to the Android client, which isn't restricted to "clientsync".
I'll investigate access log to find out what even could have caused a change in ALL etags inside of "clientsync" (the synced folder).
Some things to test:
- delete a folder with the Android client three times in a row with a slow connection: I deleted it and got 204, second delete gave 403 and third one gave 404. Between the deletions a dialog said that the server didn't respond, possibly a timeout issue.
- upload a picture by selecting it on Android's gallery, then selecting "ownCloud"
Activity
PVince81 commentedon Nov 2, 2014
Apps
I might post logs later once I find the suspicious parts...
PVince81 commentedon Nov 2, 2014
@icewind1991 any idea what could cause ALL etags to be regenerated from the root ("files") ?
As far as I know even if the file scanner went through everything it shouldn't regenerate the etags since the files did not change (mtime is still the same), especially for files that are not even synced.
What code paths could trigger that ?
PVince81 commentedon Nov 2, 2014
I checked another home storage unrelated to mine, the etags stayed the same between now and the backup. So at least it's not a rogue scanner that affects all users.
Just my user is affected.
PVince81 commentedon Nov 2, 2014
I raised the triple delete case here: #11910
I'm not sure yet whether it's a side-effect of that which might have triggered the etag reset for all files.
Needs further research.
PVince81 commentedon Nov 3, 2014
My issue with changed etags might be caused by the double DELETE, needs further research: #11910 (comment)
PVince81 commentedon Nov 4, 2014
Still haven't found the reason why my etags got reset.
There's one bug related to restoring files from the trashbin here: #11932
But I'm pretty sure that I did NOT use the trashbin/restore feature (I seldom do), so there must be yet another issue that might cause etag resets.
While investigating #11932 I noticed that calling
scan("")on the storage root would by default reset the etags (unless the "reuse etags" option is passed). Grepping the code didn't reveal any other location that could have caused this.Needs further research.
PVince81 commentedon Nov 6, 2014
Just got an idea about what else could be investigated: I remember that on my server the double-delete operation (#11910) has also triggered a trashbin purge, which usually happens at delete time whenever the trashbin is too full.
What would happen if the purge code is run twice ? Would that have side-effects and cause the etags of my user to be reset ? This is the next thing to investigate.
PVince81 commentedon Nov 6, 2014
I examined the expiration code and saw that it is calling the method
getVersionsFromTrash()which used to reset all etags (fixed in #11932).On my server at the time I issued the delete operation I saw some logs telling me that files were auto-expired from the trashbin. Since auto-expiring is causing etag reset as per #11932 (comment) it explains the reset in my case.
Case closed. Fix is in #11932