-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serious issue of sync: all files become 0KB #945
Comments
Seemingly this is related to the size of notes, but the threshold is extremely low. I upload a file which fails to synchronize |
I tried to modify the code to upload random bytes of data to test this behavior. Files with a size of a few hundred bytes got uploaded correctly and bigger files (about 5kb) sometimes got uploaded correctly and sometimes resulted in 0 byte files. I think this is related to the nextcloud library. Also uploading the same data multiple times didn't always produce the same result, so the content of the files is probably irrelevant. |
Do you suggest that it is an issue of nextcloud-neon? |
It could be, but I'm not very familiar with it. Maybe something else in Saber is preventing uploads. Also - although unlikely - the Saber Nextcloud Server could be the problem, but I don't have a compatible Nextcloud server to try it with instead. |
I just tried to upload a file (~ 7.56 MB) with Nextcloud Neon built in https://github.com/nextcloud/neon/suites/17264681811/artifacts/986280647 and there seems no problem. |
@adil192 can you point me to the source code that does the uploading? Then I can check what is going on. |
|
See |
I checked the code on our side and I am pretty sure there is no problem (and we also never had any issues). final random = Random();
for (var i = 0; i < 20; i++) {
test('upload small files $i', () async {
final path = Uri(pathSegments: ['$i.bin']);
final length = i * 1024;
final data = Uint8List.fromList(List.generate(length, (final index) => random.nextInt(256)));
final putResponse = await client.webdav.put(
data,
path,
);
expect(putResponse.statusCode, 201);
final propfindResponse = await client.webdav.propfind(
path,
prop: WebDavPropWithoutValues.fromBools(
davgetcontentlength: true,
ocsize: true,
),
depth: WebDavDepth.zero,
);
final props = propfindResponse.responses.single.propstats.single.prop;
expect(props.davgetcontentlength, length);
expect(props.ocsize, length);
final getResponse = await client.webdav.get(path);
expect(getResponse, data);
});
} It uploads 20 files from 0KB to 19KB and validates that the reported size and the downloaded content are correct. No issue at all, so I think this a problem with saber. |
This comment was marked as outdated.
This comment was marked as outdated.
@provokateurin Running your test on my server also fails: ahanney@pop-os:~/Documents/GitHub/saber$ flutter test -r expanded test/nc_webdav_write_test.dart
00:00 +0: NC webdav upload small files 0
00:01 +1: NC webdav upload small files 1
00:02 +2: NC webdav upload small files 2
00:03 +3: NC webdav upload small files 3
00:04 +4: NC webdav upload small files 4
00:05 +5: NC webdav upload small files 5
00:06 +6: NC webdav upload small files 6
00:07 +7: NC webdav upload small files 7
00:08 +7 -1: NC webdav upload small files 7 [E]
Expected: <7168>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:08 +7 -1: NC webdav upload small files 8
00:09 +7 -2: NC webdav upload small files 8 [E]
Expected: <8192>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:09 +7 -2: NC webdav upload small files 9
00:10 +7 -3: NC webdav upload small files 9 [E]
Expected: <9216>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:10 +7 -3: NC webdav upload small files 10
00:10 +7 -4: NC webdav upload small files 10 [E]
Expected: <10240>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:10 +7 -4: NC webdav upload small files 11
00:11 +7 -5: NC webdav upload small files 11 [E]
Expected: <11264>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:11 +7 -5: NC webdav upload small files 12
00:12 +7 -6: NC webdav upload small files 12 [E]
Expected: <12288>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:12 +7 -6: NC webdav upload small files 13
00:12 +7 -7: NC webdav upload small files 13 [E]
Expected: <13312>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:12 +7 -7: NC webdav upload small files 14
00:13 +7 -8: NC webdav upload small files 14 [E]
Expected: <14336>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:13 +7 -8: NC webdav upload small files 15
00:14 +7 -9: NC webdav upload small files 15 [E]
Expected: <15360>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:14 +7 -9: NC webdav upload small files 16
00:15 +7 -10: NC webdav upload small files 16 [E]
Expected: <16384>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:15 +7 -10: NC webdav upload small files 17
00:15 +7 -11: NC webdav upload small files 17 [E]
Expected: <17408>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:15 +7 -11: NC webdav upload small files 18
00:16 +7 -12: NC webdav upload small files 18 [E]
Expected: <18432>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:16 +7 -12: NC webdav upload small files 19
00:17 +7 -13: NC webdav upload small files 19 [E]
Expected: <19456>
Actual: <0>
package:matcher expect
package:flutter_test/src/widget_tester.dart 454:18 expect
test/nc_webdav_write_test.dart 52:11 main.<fn>.<fn>
00:17 +7 -13: Some tests failed. test@@ -0,0 +1,60 @@
import 'dart:io';
import 'dart:math';
import 'dart:typed_data';
import 'package:flutter_test/flutter_test.dart';
import 'package:nextcloud/webdav.dart';
import 'package:saber/data/flavor_config.dart';
import 'package:saber/data/nextcloud/nextcloud_client_extension.dart';
import 'package:saber/data/prefs.dart';
import 'utils/test_mock_channel_handlers.dart';
void main() {
group('NC webdav', () {
TestWidgetsFlutterBinding.ensureInitialized();
HttpOverrides.global = null; // enable http requests in test
setupMockPathProvider();
FlavorConfig.setup();
Prefs.testingMode = true;
Prefs.init();
Prefs.username.value = 'test.deletion';
Prefs.ncPassword.value = 'PRmjb-NWLzz-Gisq5-TAbtj-RbpWP';
Prefs.encPassword.value = 'test.deletion';
final client = NextcloudClientExtension.withSavedDetails()!;
final random = Random();
for (var i = 0; i < 20; i++) {
test('upload small files $i', () async {
final path = Uri(pathSegments: ['$i.bin']);
final length = i * 1024;
final data = Uint8List.fromList(List.generate(length, (final index) => random.nextInt(256)));
final putResponse = await client.webdav.put(
data,
path,
);
expect(putResponse.statusCode, 201);
final propfindResponse = await client.webdav.propfind(
path,
prop: WebDavPropWithoutValues.fromBools(
davgetcontentlength: true,
ocsize: true,
),
depth: WebDavDepth.zero,
);
final props = propfindResponse.responses.single.propstats.single.prop;
expect(props.davgetcontentlength, length);
expect(props.ocsize, length);
final getResponse = await client.webdav.get(path);
expect(getResponse, data);
});
}
});
} |
I just tested syncing notes to my own Nextcloud server (version 27.1.2) and it worked without any problems, so the server is probably the issue. Is the server running on a different version? |
I'm on 27.1.1 (27/stable nextcloud-snap). |
Can confirm that it works on another server. What's unusual is that using WebDav in my file manager (Nautilus) works fine, I can upload 45KB/53KB/25MB files with no error. |
It seems to also work fine with Nextcloud Neon. |
Trying to sync Saber with Nextcloud also resulted in 0B Files for me (except the config file). Formatted:
raw: {"reqId":"Bn4abYZ4chI7xaYYqprl","level":2,"time":"2023-10-28T01:48:29+02:00","remoteAddr":"10.66.66.8","user":"--","app":"core","method":"PROPFIND","url":"/remote.php/webdav/Saber","message":"Session token is invalid because it does not exist","userAgent":"Dart/3.1 (dart:io)","version":"27.1.3.2","exception":{"Exception":"OC\\Authentication\\Exceptions\\InvalidTokenException","Message":"Token is too short for a generated token, should be the password during basic auth","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Authentication/Token/Manager.php","line":133,"function":"getToken","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":782,"function":"getToken","class":"OC\\Authentication\\Token\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":352,"function":"validateToken","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":452,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php","line":114,"function":"logClientIn","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php","line":103,"function":"validateUserPass","class":"OCA\\DAV\\Connector\\Sabre\\Auth","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php","line":232,"function":"check","class":"Sabre\\DAV\\Auth\\Backend\\AbstractBasic","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php","line":139,"function":"auth","class":"OCA\\DAV\\Connector\\Sabre\\Auth","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":179,"function":"check","class":"OCA\\DAV\\Connector\\Sabre\\Auth","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":135,"function":"check","class":"Sabre\\DAV\\Auth\\Plugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMethod","class":"Sabre\\DAV\\Auth\\Plugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":456,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php","line":85,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":172,"args":["/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","Line":155,"message":"Session token is invalid because it does not exist","user":"r1yuu","exception":[],"CustomMessage":"Session token is invalid because it does not exist"},"id":"653c4c4e06218"} This issue could maybe be related to this?: nextcloud/server#38674 (comment) |
@provokateurin Are you able to make sense of this? |
Not really. My testing has shown that our lib has no troubles with this. It is very likely related to your server setup, but I don't know which part would cause this. |
Running the test above yields this in `nextcloud.log: {"reqId":"2KhNm2Qws9CgbEWpg92A","level":0,"time":"2023-11-04T00:09:15+00:00","remoteAddr":"1.2.3.4","user":"--","app":"encryption","method":"PUT","url":"/remote.php/webdav/10.bin","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Dart/3.1 (dart:io)","version":"27.1.1.0","data":{"app":"encryption"}}
{"reqId":"78OqUGuAle3gaKSrsOl6","level":0,"time":"2023-11-04T00:09:15+00:00","remoteAddr":"1.2.3.4","user":"--","app":"encryption","method":"PUT","url":"/remote.php/webdav/14.bin","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Dart/3.1 (dart:io)","version":"27.1.1.0","data":{"app":"encryption"}}
{"reqId":"vXBNzmBOY3WTCJzW3qsV","level":0,"time":"2023-11-04T00:09:15+00:00","remoteAddr":"1.2.3.4","user":"--","app":"encryption","method":"PUT","url":"/remote.php/webdav/18.bin","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Dart/3.1 (dart:io)","version":"27.1.1.0","data":{"app":"encryption"}} Interestingly, the user is reported as formatted {
"reqId": "2KhNm2Qws9CgbEWpg92A",
"level": 0,
"time": "2023-11-04T00:09:15+00:00",
"remoteAddr": "1.2.3.4",
"user": "--",
"app": "encryption",
"method": "PUT",
"url": "/remote.php/webdav/10.bin",
"message": "/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.",
"userAgent": "Dart/3.1 (dart:io)",
"version": "27.1.1.0",
"data": {
"app": "encryption"
}
},
{
"reqId": "78OqUGuAle3gaKSrsOl6",
"level": 0,
"time": "2023-11-04T00:09:15+00:00",
"remoteAddr": "1.2.3.4",
"user": "--",
"app": "encryption",
"method": "PUT",
"url": "/remote.php/webdav/14.bin",
"message": "/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.",
"userAgent": "Dart/3.1 (dart:io)",
"version": "27.1.1.0",
"data": {
"app": "encryption"
}
},
{
"reqId": "vXBNzmBOY3WTCJzW3qsV",
"level": 0,
"time": "2023-11-04T00:09:15+00:00",
"remoteAddr": "1.2.3.4",
"user": "--",
"app": "encryption",
"method": "PUT",
"url": "/remote.php/webdav/18.bin",
"message": "/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.",
"userAgent": "Dart/3.1 (dart:io)",
"version": "27.1.1.0",
"data": {
"app": "encryption"
}
} |
Completely resetting the server didn't work: <?php
$CONFIG = array (
'apps_paths' =>
array (
0 =>
array (
'path' => '/snap/nextcloud/current/htdocs/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
'url' => '/extra-apps',
'writable' => true,
),
),
'supportedDatabases' =>
array (
0 => 'mysql',
),
'memcache.locking' => '\\OC\\Memcache\\Redis',
'memcache.local' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/tmp/sockets/redis.sock',
'port' => 0,
),
'log_type' => 'file',
'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',
'logfilemode' => 416,
'passwordsalt' => '[REDACTED]',
'secret' => '[REDACTED]',
'trusted_domains' =>
array (
0 => 'nc.saber.adil.hanney.org',
1 => 'www.nc.saber.adil.hanney.org',
),
'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
'dbtype' => 'mysql',
'version' => '27.1.3.2',
'overwrite.cli.url' => 'http://localhost',
'dbname' => 'nextcloud',
'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
'dbpassword' => '[REDACTED]',
'installed' => true,
'instanceid' => 'och6rs2g1xye',
'default_phone_region' => 'GB',
'profile.enabled' => false,
'skeletondirectory' => '',
'maintenance' => false,
);
formatted{
"reqId": "Y3T1zKgtBML6bLjPFmVm",
"level": 2,
"time": "2023-11-04T01:04:05+00:00",
"remoteAddr": "1.2.3.4",
"user": "--",
"app": "core",
"method": "PROPFIND",
"url": "/remote.php/webdav/5.bin",
"message": "Session token is invalid because it does not exist",
"userAgent": "Dart/3.1 (dart:io)",
"version": "27.1.3.2",
"exception": {
"Exception": "OC\\Authentication\\Exceptions\\InvalidTokenException",
"Message": "Token is too short for a generated token, should be the password during basic auth",
"Code": 0,
"Trace": [
{
"file": "/snap/nextcloud/38457/htdocs/lib/private/Authentication/Token/Manager.php",
"line": 133,
"function": "getToken",
"class": "OC\\Authentication\\Token\\PublicKeyTokenProvider",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/snap/nextcloud/38457/htdocs/lib/private/User/Session.php",
"line": 782,
"function": "getToken",
"class": "OC\\Authentication\\Token\\Manager",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/snap/nextcloud/38457/htdocs/lib/private/User/Session.php",
"line": 352,
"function": "validateToken",
"class": "OC\\User\\Session",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/snap/nextcloud/38457/htdocs/lib/private/User/Session.php",
"line": 452,
"function": "login",
"class": "OC\\User\\Session",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/snap/nextcloud/38457/htdocs/apps/dav/lib/Connector/Sabre/Auth.php",
"line": 114,
"function": "logClientIn",
"class": "OC\\User\\Session",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/snap/nextcloud/38457/htdocs/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php",
"line": 103,
"function": "validateUserPass",
"class": "OCA\\DAV\\Connector\\Sabre\\Auth",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/snap/nextcloud/38457/htdocs/apps/dav/lib/Connector/Sabre/Auth.php",
"line": 232,
"function": "check",
"class": "Sabre\\DAV\\Auth\\Backend\\AbstractBasic",
"type": "->"
},
{
"file": "/snap/nextcloud/38457/htdocs/apps/dav/lib/Connector/Sabre/Auth.php",
"line": 139,
"function": "auth",
"class": "OCA\\DAV\\Connector\\Sabre\\Auth",
"type": "->"
},
{
"file": "/snap/nextcloud/38457/htdocs/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",
"line": 180,
"function": "check",
"class": "OCA\\DAV\\Connector\\Sabre\\Auth",
"type": "->"
},
{
"file": "/snap/nextcloud/38457/htdocs/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",
"line": 135,
"function": "check",
"class": "Sabre\\DAV\\Auth\\Plugin",
"type": "->"
},
{
"file": "/snap/nextcloud/38457/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "beforeMethod",
"class": "Sabre\\DAV\\Auth\\Plugin",
"type": "->"
},
{
"file": "/snap/nextcloud/38457/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 456,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/snap/nextcloud/38457/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 253,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/snap/nextcloud/38457/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 321,
"function": "start",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/snap/nextcloud/38457/htdocs/apps/dav/appinfo/v1/webdav.php",
"line": 85,
"function": "exec",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/snap/nextcloud/38457/htdocs/remote.php",
"line": 172,
"args": [
"/snap/nextcloud/38457/htdocs/apps/dav/appinfo/v1/webdav.php"
],
"function": "require_once"
}
],
"File": "/snap/nextcloud/38457/htdocs/lib/private/Authentication/Token/PublicKeyTokenProvider.php",
"Line": 155,
"message": "Session token is invalid because it does not exist",
"user": "github.actions.tester",
"exception": {},
"CustomMessage": "Session token is invalid because it does not exist"
}
} |
That's interesting, but I don't know if it is a problem. As far as I understood you also face these problems with other clients, right? |
No, other WebDAV clients work correctly. Though I haven't looked at the logs for other webdav clients yet. The user being reported as Also I was trying to modify the |
I've seen that error and I'll fix it soon. |
But you can easily run the tests locally and you don't need to use Github Actions for that. |
The upper stream nextcloud-snap/nextcloud-snap#2583 was closed without comment. |
@adil192 I don't think that this is specific to your server. I just tested another provider https://nch.pl and the same issue reproduces. |
Yeah I'm pretty sure the issue is with the neon package since the error occurs even with a blank new server |
@adil192 Please create a reproducible test setup that only includes our nextcloud package and shows that it is indeed broken. I already created some tests a while back that showed everything was working fine. I can't really help if there is nothing to debug/verify against. |
And tbh I am pretty sure the problem is not in the nextcloud package. We have unit tests, never had anyone else encounter issues and I even read through all the code that is responsible for uploading just to verify that there is nothing weird going on. |
I'm sorry, I didn't intend to assign blame to you. I meant that I've tried everything I can from my end and I don't know what more to try. |
Is it possible to reproduce the issue on the server of provider https://nch.pl/ via the code in #945 (comment), and is it possible dump decrypted network packages on the Nextcloud server side? |
I've made a small repo that installs the nextcloud snap and then tries the above test: see https://github.com/adil192/nextcloud_snap_tests/actions/runs/7093165889/job/19306034781 Running |
I encountered a similar issue. My two clients did not synchronize. I looked into the files and found all but Since this is a test setup without any serious data, I tried to restart from scratch and new files are still 0 size. This was one of the debugging log from the nginx proxy showing the Android client is indeed creating a 0 size file:
But somehow Saber started to create non-zero-size files and the sync functionality started to work while I'm trying to look into the raw HTTP request. So I cannot reproduce it at this moment. |
Please disregard my previous log, which is not relevant. I was able to reproduce the bug using adil192/nextcloud_snap_tests after restore my Nginx configuration. I think I found the issue now.
After comparing the decrypted WebDav traffic from nextcloud-neon and that from other clients, I found that nextcloud-neon didn't set content-length header. Below is the request header sent from neon, which is very succint:
Below is the header sent from the Nextcloud client:
My Nginx proxy passed empty Some people couldn't reproduce the bug, possibly because their HTTP servers somehow filled in the correct content length. In my case, I failed to reproduce the bug after I set up the mirror directive with the intention to inspect the raw HTTP traffic -- but somehow Nginx started to fill in Interestingly, neon added the content-length header in nextcloud/neon#335 but only for the To prove it works, I replaced the final putResponse = await client.webdav.putStream(
Stream.value(data),
path,
contentLength: length,
); Then there was no error:
And now the new header looks like:
|
I came to another solution which is immediately deployable on the server side. Although neon didn't set I then found this old issue: nextcloud/server#7995 that chunked encoding + fastcgi leading to empty file! The workaround is to set Weirdly, nginx by default turns this on but Nextcloud's recommended nginx setting set it off. |
@cuihaoleo thanks for the investigation and the fix!
It was added to both but we later refactored the methods and then it went missing from the |
@adil192 I guess that it might be important enough to have a new version with this being patched. |
I am not sure if my issue is related but my new installation of Saber v0.24.1 syncs to the nextcloud server with what looks like the right file size, but there is no syncing between my Android devices. I have a phone and a tablet each has the same version of saber and each is setup to sync to the same Nextcloud account with the same encryption password. They both sync there files to the saber folder but files created on the phone don't show up on the tablet and viz versa. I have also installed Saber on ubuntu as a snap and have the same issue, no syncing between devices. I am running Nextcloud 29.02 behind an nginx reverse proxy. Other apps that are using nextcloud sync are working fine. eg. Moonreader, files, notes deck. |
Same,I can only upload but not download |
Describe the bug
There is a serious issue of synchronization: seemingly all modified files are uploaded empty, which will subsequently trigger a removal of all existent files.
To reproduce
Expected behavior
The modified notes upload correctly.
Saber version
v0.16.1 F-Droid (160102); v0.15.5 flatpak
Device
(irrelevant)
Anything else?
No response
The text was updated successfully, but these errors were encountered: