nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.89k stars 4.01k forks source link

Bogus value in quota-available-bytes #23058

Closed DagNygren closed 2 months ago

DagNygren commented 4 years ago

How to use GitHub

Steps to reproduce

1.Do a PROPFIND on a DAV resource, What I did was: curl -k -i -X PROPFIND --basic --user dag https://owncloud.newtech.fi/remote.php/dav/files/dag/ >/home/dag/owncloud_response.txt

  1. Take a look at the result. Easier if using xmllint. You vill have to remove the header first.
  2. Check the result listing of the files and pay attention to the quota-available-bytes entry

Expected behaviour

The field should contain a reasonable value

Actual behaviour

You will see negative values

Server configuration

Operating system: LInux (Fedora 31)

Web server: Apache

Database: mysql (really mariadb)

PHP version: 7.3.22

Nextcloud version: (see Nextcloud admin page) 19.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Updated many many times

Where did you install Nextcloud from: Updates through the update interface, do not remember where the initial version came from.

Signing status:

Signing status ``` Login as admin user into your Nextcloud and access http://example.com/index.php/settings/integrity/failed paste the results here. 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.5.0 - activity: 2.12.0 - calendar: 2.0.4 - carnet: 0.22.2 - cloud_federation_api: 1.2.0 - comments: 1.9.0 - contacts: 3.3.0 - contactsinteraction: 1.0.0 - dav: 1.15.0 - external: 3.6.0 - federatedfilesharing: 1.9.0 - federation: 1.9.0 - files: 1.14.0 - files_external: 1.10.0 - files_pdfviewer: 1.8.0 - files_rightclick: 0.16.0 - files_sharing: 1.11.0 - files_trashbin: 1.9.0 - files_versions: 1.12.0 - files_videoplayer: 1.8.0 - firstrunwizard: 2.8.0 - gpxpod: 4.2.2 - keeweb: 0.6.2 - logreader: 2.4.0 - lookup_server_connector: 1.7.0 - mail: 1.4.1 - nextcloud_announcements: 1.8.0 - notes: 3.6.4 - notifications: 2.7.0 - oauth2: 1.7.0 - onlyoffice: 6.0.0 - password_policy: 1.9.1 - photos: 1.1.0 - privacy: 1.3.0 - provisioning_api: 1.9.0 - recommendations: 0.7.0 - serverinfo: 1.9.0 - settings: 1.1.0 - sharebymail: 1.9.0 - spreed: 9.0.4 - support: 1.2.1 - survey_client: 1.7.0 - systemtags: 1.9.0 - text: 3.0.1 - theming: 1.10.0 - twofactor_backupcodes: 1.8.0 - updatenotification: 1.9.0 - user_external: 0.6.1 - user_ldap: 1.9.0 - viewer: 1.3.0 - workflowengine: 2.1.0 Disabled: - admin_audit - encryption ```

Nextcloud configuration:

Config report ``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder or Insert your config.php content here. Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …) ```

Are you using external storage, if yes which one: local/smb/sftp/...

Yes, sftp

Are you using encryption: yes/no https? Yes

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... LDAP

LDAP configuration (delete this part if not used)

LDAP config ``` With access to your command line run e.g.: sudo -u www-data php occ ldap:show-config from within your Nextcloud installation folder Without access to your command line download the data/owncloud.db to your local computer or access your SQL server remotely and run the select query: SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap'; Eventually replace sensitive data as the name/IP-address of your LDAP server or groups. ```

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log ``` Insert your webserver log here ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` Insert your Nextcloud log here ```

Browser log

Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```

Example result of a PROPFIND:

/remote.php/dav/files/dag/ Sat, 26 Sep 2020 07:57:54 GMT 2827073754 **-3** "0132efa672c367354eea4da93c608f84" HTTP/1.1 200 OK Pay attention to the -3 in quota-available-bytes
szaimen commented 3 years ago

Is this Issue still valid in NC21.0.2? If not, please close this issue. Thanks! :)

DagNygren commented 3 years ago

Nope. The problem is still there

But a litte more information: It seems like this bogus value is only wrong for directories that are remotely mounted on Eternal storage by SFTP

jmue commented 2 years ago

I get the bogus quota-available-bytes value too if I set the user quota to 'Default' or 'Unlimited'. If I set a concrete value the quota-available-bytes property is filled correctly. I use no external storage backends nor e2e.

voxHumana0 commented 2 years ago

I experience this issue with version 23.0.0.0 and 23.0.3.2 or whatever the newest version is as of now. I removed the other ~ 100 d:response fields, each having the same bogus -3 value. See below... The quota here is set to "unlimited" as well.

I use ExpanDrive as sync client.

Further information on the environment... config.php:

<?php
$CONFIG = array (
  'instanceid' => 'REDACTED',
  'passwordsalt' => 'REDACTED',
  'secret' => 'REDACTED',
  'trusted_domains' => 
  array (
    0 => 'REDACTED',
    1 => 'REDACTED',
    2 => 'REDACTED',
    3 => 'REDACTED',
    4 => 'REDACTED',
  ),
  'trusted_proxies' => 
  array (
    0 => 'REDACTED',
  ),
  'datadirectory' => '/mnt/nextcloud-vm-data',
  'dbtype' => 'mysql',
  'version' => '23.0.3.2',
  'overwrite.cli.url' => 'REDACTED',
  'dbname' => 'REDACTED',
  'dbhost' => 'REDACTED',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'REDACTED',
  'dbpassword' => 'REDACTED',
  'installed' => true,
  'memcache.local' => '\OC\Memcache\APCu',
  'memcache.distributed' => '\OC\Memcache\Redis',
  'memcache.locking' => '\OC\Memcache\Redis',
  'filelocking.enabled' => 'true',
  'redis' => [
     'host'     => '/run/redis/redis-server.sock',
     'port'     => 0,
     'timeout'  => 0,
  ],
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'default_phone_region' => 'DE',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'updater.secret' => 'REDACTED',
);

The following is the message in question:

<?xml version="1.0" encoding="UTF-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:nc="http://nextcloud.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:s="http://sabredav.org/ns">
   <d:response>
      <d:href>/remote.php/webdav/</d:href>
      <d:propstat>
         <d:prop>
            <d:getlastmodified>Mon, 04 Apr 2022 13:22:00 GMT</d:getlastmodified>
            <d:resourcetype>
               <d:collection />
            </d:resourcetype>
            <d:quota-used-bytes>1148366757945</d:quota-used-bytes>
            <d:quota-available-bytes>-3</d:quota-available-bytes>
            <d:getetag>"4c007dfbce58150c0bd26ea8083bf430"</d:getetag>
         </d:prop>
         <d:status>HTTP/1.1 200 OK</d:status>
      </d:propstat>
   </d:response>
</d:multistatus>

Apps...

root@nextcloud-vm:/var/www/html/nextcloud/apps# ls -la
total 240
drwxr-x--- 60 www-data www-data 4096 Apr  1 14:08 .
drwxr-x--- 14 www-data www-data 4096 Apr  1 15:56 ..
drwxr-x--- 11 www-data www-data 4096 Mar 21 08:05 accessibility
drwxr-x--- 11 www-data www-data 4096 Mar 21 08:05 activity
drwxr-x---  6 www-data www-data 4096 Mar 21 08:05 admin_audit
drwxr-x---  7 www-data www-data 4096 Apr  1 14:06 bruteforcesettings
drwxr-xr-x 10 www-data www-data 4096 Apr  1 14:07 calendar
drwxr-x---  8 www-data www-data 4096 Apr  1 14:06 camerarawpreviews
drwxr-x--- 12 www-data www-data 4096 Mar 21 08:05 circles
drwxr-x---  6 www-data www-data 4096 Mar 21 08:05 cloud_federation_api
drwxr-x---  8 www-data www-data 4096 Mar 21 08:05 comments
drwxr-xr-x  9 www-data www-data 4096 Apr  1 14:08 contacts
drwxr-x---  6 www-data www-data 4096 Mar 21 08:05 contactsinteraction
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 dashboard
drwxr-x--- 10 www-data www-data 4096 Mar 21 08:05 dav
drwxr-x---  8 www-data www-data 4096 Apr  1 14:06 duplicatefinder
drwxr-x--- 10 www-data www-data 4096 Mar 21 08:05 encryption
drwxr-x--- 10 www-data www-data 4096 Mar 21 08:05 federatedfilesharing
drwxr-x--- 10 www-data www-data 4096 Mar 21 08:05 federation
drwxr-x--- 11 www-data www-data 4096 Mar 21 08:05 files
drwxr-x--- 11 www-data www-data 4096 Mar 21 08:05 files_external
drwxr-x---  8 www-data www-data 4096 Mar 21 08:05 files_pdfviewer
drwxr-x---  8 www-data www-data 4096 Mar 21 08:05 files_rightclick
drwxr-x--- 10 www-data www-data 4096 Mar 21 08:05 files_sharing
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 files_trashbin
drwxr-x---  8 www-data www-data 4096 Mar 21 08:05 files_versions
drwxr-x---  7 www-data www-data 4096 Mar 21 08:05 files_videoplayer
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 firstrunwizard
drwxr-x--- 12 www-data www-data 4096 Mar 21 08:05 logreader
drwxr-x---  6 www-data www-data 4096 Mar 21 08:02 lookup_server_connector
drwxr-xr-x 11 www-data www-data 4096 Apr  1 14:08 mail
drwxr-x---  9 www-data www-data 4096 Apr  1 14:06 metadata
drwxr-x---  8 www-data www-data 4096 Mar 21 08:05 nextcloud_announcements
drwxr-xr-x 10 www-data www-data 4096 Apr  1 14:08 notes
drwxr-x--- 10 www-data www-data 4096 Mar 21 08:05 notifications
drwxr-x---  8 www-data www-data 4096 Mar 21 08:05 oauth2
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 password_policy
drwxr-x--- 10 www-data www-data 4096 Mar 21 08:05 photos
drwxr-xr-x  5 www-data www-data 4096 Apr  1 14:08 previewgenerator
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 privacy
drwxr-x---  7 www-data www-data 4096 Mar 21 08:05 provisioning_api
drwxr-x---  6 www-data www-data 4096 Mar 21 08:05 recommendations
drwxr-xr-x 13 www-data www-data 4096 Apr  1 14:08 richdocuments
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 serverinfo
drwxr-x--- 11 www-data www-data 4096 Mar 21 08:05 settings
drwxr-x--- 10 www-data www-data 4096 Mar 21 08:05 sharebymail
drwxr-xr-x 10 www-data www-data 4096 Apr  1 14:08 spreed
drwxr-x--- 10 www-data www-data 4096 Mar 21 08:05 support
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 survey_client
drwxr-x--- 10 www-data www-data 4096 Mar 21 08:05 systemtags
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 text
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 theming
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 twofactor_backupcodes
drwxr-x---  9 www-data www-data 4096 Apr  1 14:06 unsplash
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 updatenotification
drwxr-x--- 12 www-data www-data 4096 Mar 21 08:05 user_ldap
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 user_status
drwxr-x---  7 www-data www-data 4096 Mar 21 08:05 viewer
drwxr-x---  7 www-data www-data 4096 Mar 21 08:05 weather_status
drwxr-x---  9 www-data www-data 4096 Mar 21 08:05 workflowengine
voxHumana0 commented 2 years ago

BTW, this -3 value comes from FileInfo.php when a file size check is performed.

I just can't find the spot in RFC4331 where this -3 value appears. Apparently, some DAV clients crash upon encountering this value.

Oh nevermind, changing the value to some other magic value "424242424242" didn't work. I'll contact the ExtenDrive support then.

szaimen commented 1 year ago

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+

jmue commented 1 year ago

I'm on 25.0.3 and the issue still persists.

joshtrichards commented 2 months ago

This is not a bug. It's a valid return value we rely on:

https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html#supported-properties