Closed tobiasKaminsky closed 1 year ago
Next steps:
Hm. I've removed some folders via Desktop client, they are still on server and now Desktop tries to sync them again…
I will start with a fresh folder, to try to reproduce it.
Interesting:
Next observation:
Client was quiet, everything fine.
Then I opened s3 storage within web and now I have all the time problems with client syncing it:
please try https://github.com/nextcloud/server/issues/33785#issuecomment-1233832720
if something is changing the etag on the server without any interaction, then there's a bug of sorts
I assume you don't have a cron job running "occ files:scan" on the storage periodically ? (which I wouldn't recommend)
I had the same problem with a different storage provider. The files were uploaded, but then disappear from nextcloud after briefly showing. Checking on the S3 drive directly I can see and download the files. Turn out the issue was with the option "path style" that I used to have different space for each user. To do a test I removed it and changed the configuration to a fixed value and the files are showing correctly now, but obviously I can't keep this configuration and everyone will see the files of everybody else.
For me, I have to keep "enable path style" enabled, otherwise I see a config error. It is also written here: https://docs.contabo.com/docs/products/Object-Storage/Tools/nextcloud/
SQL:
SELECT fileid, name, etag FROM oc_filecache
WHERE fileid
in (15641644, 15641596, 15641520, 15641601);
{"fileid":"15641520","name":"Neues Textdokument.md","etag":"\"04e287dc9691f156bd00bfecdb156b2e\""}, {"fileid":"15641596","name":"temp","etag":"631600ce9ae07"}, {"fileid":"15641601","name":"20210207_121658.jpg","etag":"\"487a5eab0bddab96ee572aa9116e610f\""}, {"fileid":"15641644","name":"513d1d4b1ff757e464cc7622a7cf3d96cda26a89.pdf","etag":"6311c519b32c0"}
Right now it keeps re-downloading "Neues Textdokument.md" with stable etag on server side.
20220905_1608_owncloud.log.9:2022-09-05 16:08:51:251 [ debug nextcloud.gui.folder /build/nextcloud-client/src/nextcloud-client/src/gui/folder.cpp:580 ] [ OCC::Folder::slotWatchedPathChanged ]: Changed path was touched by SyncEngine, ignoring: "/home/tobi/nextcloud/test2/Neues Textdokument.md
@mgallien
20220905_1608_owncloud.log.9:2022-09-05 16:08:51:251 [ debug nextcloud.gui.folder /build/nextcloud-client/src/nextcloud-client/src/gui/folder.cpp:580 ] [ OCC::Folder::slotWatchedPathChanged ]: Changed path was touched by SyncEngine, ignoring: "/home/tobi/nextcloud/test2/Neues Textdokument.md
@mgallien
could you share your full log ?
Shared internally: https://cloud.nextcloud.com/index.php/f/6474148
If wanted, I can also create a test user with this S3, so you can test/debug on your own :)
looks very much like the etag received by desktop client has extra quotes around the value. they are not stripped by desktop client leading to an always differing etag leading to always syncing the same files again and again
So external storage app is doing something wrong when creating/storing eTag?
We do this also on Android, but in general I doubt that we should have different eTag syntax (with / without " ")…
@PVince81 while testing I found: Hm. This seems to be unrelated to client, as it happens also in this case:
note down etag: 123
stop client
refresh parent folder (where problematic folder is in) -> no change
open folder via web
see changing eTag
--> so it is enough to enter this folder to have a flipping etag
PR by Claudio still helps a lot, as now "only" problematic folder has a changing etag, but content remains the same, so Desktop client does not have to do actual work.
A small service provider bumped into this issue, might be worth to fix before large customers run into this problem
I cannot reproduce with minio, but maybe also failed to get the steps right.
From a first look at the code the changing etag on the folder seems expected according to:
For the extra quote on the Tag, it seems that this is passed through from the object storage these days, so maybe we should trim those in https://github.com/nextcloud/server/blob/54c05bcdb96fcbab8a8c552e6558dc18b1571af3/apps/files_external/lib/Lib/Storage/AmazonS3.php#L699
@tobiasKaminsky Do you have a test account that you could share temporarily to see if the actual storage service makes a difference there?
@tobiasKaminsky Maybe to check back on your findings. Entering the folder changing the root etag would be expected if the external storage is configured to always check for changes. Otherwise the desktop client would never get aware if files are changed outside of Nextcloud directly on the S3 bucket.
With the desktop client related fixes, do you still see issues with syncing already synced files?
Sorry for coming back this late. Now I often receive a 504 gateway timeout. I am actually not sure if this as a NC problem, or if the service quality of the S3 provider is this poor.
With the desktop client related fixes, do you still see issues with syncing already synced files?
I have the same issue with the latest desktop client.
Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!
My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!
If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+
I am using version 25.0.3 now and the issue still persists. It also affects the thumbnail generation. Only after visiting the folders using the android app the thumbnails work again.
Just a thought, I built a "S3->local" and a "local->S3" migration script. To perform a good migration I had to include a bunch of checks. I now also once in a while run that script to perform a "sanity check" of my nextcloud instance..
You could run it and see if it detects anything "odd"?
I have installed 25.0.4 now and after a complete resync it seems to work fine now. Thumbnails are still broken in the webinterface, but I suppose that's a different issue.
Hello. I am using the 26.0.0 on the server's end and the 3.8.0 desktop version on the macOS. The problem still persists. I am using external storage.
I am not a contributor to Nextcloud, but I know programming and I know a little bit about PHP. So here is my debugging process:
The error I see on my client:
Failed to find a valid token/etag combination for xxx
I searched this string in the code and located it here at /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php:1483
And I added an error_log
/* somecode */
if (($tokenValid && $etagValid) ^ $token['negate']) {
// Both were valid, so we can go to the next condition.
continue 2;
}
/* Added error_log */
error_log("\r\n\r\n".print_r($token['etag'], true)."\r\n".print_r($node->getETag(), true)."\r\n\r\n", 3, '/var/www/nextcloud/data/test.log');
}
// If we ended here, it means there was no valid ETag + token
// combination found for the current condition. This means we fail!
throw new Exception\PreconditionFailed('Failed to find a valid token/etag combination for '.$uri, 'If');
}
Then I saw something like this in '/var/www/nextcloud/data/test.log'.
4045ebdcba4faf227e41739a93bd4b9c-1
"4045ebdcba4faf227e41739a93bd4b9c-1"
So @juliushaertl is right. It is because the extra quotes. The clients will keep syncing while receiving the same error again and again, and the new files will never uploaded to S3. I also used the MySQL to see the oc_filecache table. Here is what I got from SELECT path, etag FROM oc_filecache WHERE path LIKE "%global333.less%"
. This file is created by Nextcloud in my External Storage (which is the S3 backend)
+--------------------+---------------+
| path | etag |
+--------------------+---------------+
| global333.less | 642e55ac1a537 |
+--------------------+---------------+
1 rows in set (0.007 sec)
However, when I try to find a file that is already in S3 before I mounted it at Nextcloud, here is what I got:
+-----------------------------------+--------------------------------------+
| path | etag |
+-----------------------------------+--------------------------------------+
| 2016/2016-08-07/ZE3_3819-Pano.dng | "51d4ffd5d95ceb68f32828fd5c39456a-1" |
+-----------------------------------+--------------------------------------+
1 row in set (0.008 sec)
So changing server/apps/files_external/lib/Lib/Storage/AmazonS3.php is not enough for existing installs. But changing this should solve this for new installs. The database is also needed to be updated to remove the extra quotes.
This bug is reproducible. Here is what to do to reproduce this bug:
Failed to find a valid token/etag combination for XXX
appears.etag
column in the oc_filecache
table. There are extra quotes.I hope this info is helpful.
I applied the patch https://github.com/nextcloud/server/pull/37611 and re-installed Nextcloud. Then I mount the S3 and the ETag seems to be working correctly. The database also reflects the corrected ETag.
⚠️ This issue respects the following points: ⚠️
Bug description
I added Contabo S3 storage (https://contabo.com/en/object-storage) as external storage with
Steps to reproduce
Expected behavior
Sync / usage should be as flawless as internal storage
Installation method
No response
Operating system
No response
PHP engine version
No response
Web server
No response
Database engine version
No response
Is this bug present after an update or on a fresh install?
No response
Are you using the Nextcloud Server Encryption module?
No response
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response