Server: Client syncing every file after encryption - 0B error said by server

Created on 18 May 2019  Â·  4Comments  Â·  Source: nextcloud/server

Steps to reproduce

  1. Nextcloud non-fresh installation.
  2. Enabled encryption app.
  3. Encrypted all files of all users available on server.

Expected behaviour

The files are encrypted correctly and the clients requests the decrypted version of the file, without any errors and rescaning.

Actual behaviour

The files are encrypted correctly but clients are syncing "for ever" every file uploaded to the server. Then, it tries to download everything but 0B error (Expected file size XXXB but server said 0B).

Server configuration

<?php
$CONFIG = array (
  'instanceid' => 'PRIVATE',
  'passwordsalt' => 'PRIVATE',
  'secret' => 'PRIVATE',
  'trusted_domains' =>
  array (
    0 => 'javinator9889.com',
    1 => 'www.javinator9889.com',
    2 => 'cloud.javinator9889.com',
  ),
  'datadirectory' => 'PRIVATE',
  'knowledgebaseenabled' => true,
  'allow_user_to_change_display_name' => true,
  'enable_avatars' => true,
  'remember_login_cookie_lifetime' => 1296000,
  'session_lifetime' => 86400,
  'session_keepalive' => true,
  'auth.bruteforce.protection.enabled' => true,
  'has_internet_connection' => true,
  'overwrite.cli.url' => 'https://cloud.javinator9889.com',
  'htaccess.RewriteBase' => '/',
  'trashbin_retention_obligation' => 'auto',
  'dbtype' => 'pgsql',
  'version' => '15.0.7.0',
  'dbname' => 'PRIVATE',
  'dbhost' => 'PRIVATE',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'PRIVATE',
  'dbpassword' => 'PRIVATE',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => 'tls',
  'mail_from_address' => 'PRIVATE',
  'mail_domain' => 'PRIVATE',
  'mail_smtphost' => 'PRIVATE',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'PRIVATE',
  'mail_smtppassword' => 'PRIVATE',
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'redis' =>
  array (
    'host' => 'PRIVATE',
    'port' => 6379,
  ),
  'theme' => '',
  'loglevel' => 2,
  'logfile' => 'PRIVATE',
  'logtimezone' => 'Europe/Madrid',
  'log_rotate_size' => 52428800,
  'filelocking.ttl' => 3600,
  'enable_previews' => true,
  'preview_max_x' => 2048,
  'preview_max_y' => 2048,
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'preview_office_cl_parameters' => ' --headless --nologo --nofirststartwizard --invisible --norestore --convert-to pdf --outdir ',
  'enabledPreviewProviders' =>
 array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\MP3',
    6 => 'OC\\Preview\\TXT',
    7 => 'OC\\Preview\\MarkDown',
    8 => 'OC\\Preview\\MSOffice2003',
    9 => 'OC\\Preview\\MSOffice2007',
    10 => 'OC\\Preview\\MSOfficeDoc',
    11 => 'OC\\Preview\\OpenDocument',
    12 => 'OC\\Preview\\PDF',
    13 => 'OC\\Preview\\Font',
    14 => 'OC\\Preview\\Movie',
  ),
  'openssl' =>
  array (
      'config' => '/usr/lib/ssl/openssl.cnf',
  ),
  'cache_chunk_gc_ttl' => 86400,
  'cipher' => 'AES-256-CFB',
  'updater.release.channel' => 'production',
);

Operating system:

Distributor ID: Debian
Description:    Debian GNU/Linux 9.9 (stretch)
Release:        9.9
Codename:       stretch
---------------------------------------------------
Linux DebianServer 4.19.44 #1 SMP Fri May 17 07:52:35 CEST 2019 x86_64 GNU/Linux

Web server:

Server version: Apache/2.4.25 (Debian)
Server built:   2019-04-02T19:05:13

Database:

psql (PostgreSQL) 11.3 (Debian 11.3-1.pgdg90+1)

PHP version:

PHP 7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b (cli) (built: May  3 2019 09:38:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.5-1+0~20190503093827.38+stretch~1.gbp60a41b, Copyright (c) 1999-2018, by Zend Technologies

Nextcloud version:
15.0.7

Updated from an older Nextcloud/ownCloud or fresh install:
Updated from older Nextcloud installation

Where did you install Nextcloud from:
Installed using sources

Signing status:


Signing status: No errors have been found.

List of activated apps:


App list

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Enabled:
  - accessibility: 1.1.0
  - activity: 2.8.2
  - admin_audit: 1.5.0
  - announcementcenter: 3.4.1
  - apporder: 0.6.0
  - audioplayer: 2.7.0
  - bruteforcesettings: 1.3.0
  - calendar: 1.6.5
  - checksum: 0.4.2
  - cloud_federation_api: 0.1.0
  - comments: 1.5.0
  - contacts: 3.1.1
  - dav: 1.8.1
  - drop_account: 0.1.0
  - encryption: 2.3.0
  - federatedfilesharing: 1.5.0
  - federation: 1.5.0
  - files: 1.10.0
  - files_automatedtagging: 1.5.0
  - files_downloadactivity: 1.4.0
  - files_external: 1.6.0
  - files_markdown: 2.0.6
  - files_pdfviewer: 1.4.0
  - files_rightclick: 0.13.0
  - files_sharing: 1.7.0
  - files_texteditor: 2.7.0
  - files_versions: 1.8.0
  - files_videoplayer: 1.4.0
  - firstrunwizard: 2.4.0
  - flowupload: 0.1.0
  - gallery: 18.2.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.3.0
  - metadata: 0.9.0
  - nextcloud_announcements: 1.4.0
  - notes: 2.6.0
  - notifications: 2.3.0
  - oauth2: 1.3.0
  - onlyoffice: 2.1.10
  - password_policy: 1.5.0
  - polls: 0.10.2
  - previewgenerator: 2.1.0
  - provisioning_api: 1.5.0
  - quota_warning: 1.4.0
  - registration: 0.4.6
  - serverinfo: 1.5.0
  - sharebymail: 1.5.0
  - sociallogin: 1.14.3
  - socialsharing_email: 1.0.5
  - socialsharing_facebook: 1.0.4
  - socialsharing_twitter: 1.0.4
  - spreed: 5.0.3
  - support: 1.0.0
  - survey_client: 1.3.0
  - systemtags: 1.5.0
  - tasks: 0.10.1
  - theming: 1.6.0
  - twofactor_backupcodes: 1.4.1
  - twofactor_totp: 2.1.2
  - updatenotification: 1.5.0
  - user_usage_report: 1.1.1
  - workflowengine: 1.5.0
Disabled:
  - admin_notifications 
  - end_to_end_encryption
  - files_trashbin
  - sharerenamer
  - socialsharing_googleplus
  - terms_of_service  
  - user_ldap

Are you using external storage, if yes which one: sftp

Are you using encryption: yes

Client configuration

Browser:
Chrome
Operating system:
Both Windows and Linux (Ubuntu 18.04).


There is a similar issue I found #7283 which looks like is similar to mine and is not resolved yet. In addition, OpenSSL was added days ago as a test for checking better performance or just for seeing if there is any change on the client side.

0. Needs triage bug encryption (client-side) encryption (server-side)

Most helpful comment

Any update about this issue?

I find fundamental having encryption enabled and fully working on a non-fresh Nextcloud installation

All 4 comments

cc @nextcloud/encryption

I think the hole issue is related to timestamps:
• When enabling/disabling encryption, the encrypted/unencrypted files are marked as "Modified" even if they are not (timestamp issue).
• The clients attempt to sync every modified file, which in fact is, the hole client data. Because of this, clients are consuming so much bandwidth checking which files have been modified.
• After checking, the clients try to download every changed file, but as there have been no modification indeed, the download is about 0B, which causes the client to expect XXX B size but receives 0 B (we only encrypted files but not changed their content)

@Javinator9889 cc @kesselb

Any update about this issue?

I find fundamental having encryption enabled and fully working on a non-fresh Nextcloud installation

Was this page helpful?
0 / 5 - 0 ratings