nextcloud / server

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

[Bug]: Wrong metadata due to inconsistent scanning behavior of external storage #35066

Closed haarp closed 3 weeks ago

haarp commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

When an local external storage is freshly added, manually navigating it will update folders with the correct timestamp. But waiting for it to automatically get scanned will update folders with the wrong timestamp (time of scan) instead.

Steps to reproduce

  1. Add new local external storage w/ Check for changes=Once every direct access
  2. Navigate to folder in web interface
  3. -> Storage and all subfolders marked as pending
  4. Navigate one subfolder and all its items
  5. -> Subfolders are eventually updated properly with the correct timestamp ✓
  6. Wait for Nextcloud to scan the remaining subfolders on its own (cron?)
  7. -> Remaining subfolders have wrong timestamp, i.e. from time of scanning.

Expected behavior

Correct timestamp used in both cases

Installation method

Community Manual installation with Archive

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Nginx

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

No response

What user-backends are you using?

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "overwritewebroot": "\/",
        "htaccess.RewriteBase": "\/",
        "version": "24.0.7.1",
        "knowledgebaseenabled": false,
        "apps_paths": [
            {
                "path": "\/var\/www\/nextcloud\/apps",
                "url": "\/apps",
                "writable": true
            }
        ],
        "dbtype": "pgsql",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "DE",
        "installed": true,
        "loglevel": 2,
        "mail_smtpmode": "sendmail",
        "maintenance": false,
        "maintenance_window_start": 1,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "preview_max_filesize_image": 100,
        "preview_max_memory": 256,
        "app_install_overwrite": [
            "checksum",
            "files_3d"
        ],
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "password": "***REMOVED SENSITIVE VALUE***",
            "dbindex": 0
        }
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - calendar: 3.5.2
  - camerarawpreviews: 0.8.0
  - checksum: 1.1.5
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contacts: 4.2.2
  - dav: 1.22.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_external: 1.16.1
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - metadata: 0.17.0
  - nextcloud_announcements: 1.13.0
  - notes: 4.5.1
  - notifications: 2.12.1
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - phonetrack: 0.7.2
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - root_cache_cleaner: 0.1.3
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - support: 1.7.0
  - text: 3.5.1
  - theming: 1.15.0
  - theming_customcss: 1.12.0
  - twofactor_backupcodes: 1.13.0
  - twofactor_totp: 6.4.1
  - updatenotification: 1.14.0
  - viewer: 1.8.0
  - workflowengine: 2.6.0
Disabled:
  - admin_audit
  - circles: 22.1.1
  - contactsinteraction: 1.0.0
  - dashboard: 7.0.0
  - duplicatefinder: 0.0.15
  - encryption
  - files_3d: 0.5.0
  - files_pdfviewer: 0.8.1
  - files_videoplayer: 0.9.8
  - firstrunwizard: 2.8.0
  - ransomware_protection: 1.14.0
  - recommendations: 1.1.0
  - survey_client: 1.10.0
  - systemtags: 1.11.0
  - user_ldap
  - user_status: 1.0.1
  - weather_status: 1.1.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

-

Additional info

Thanks!

szaimen commented 1 year ago

Hi, please update to 25.0.7 or better 26.0.2 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 26-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+

haarp commented 1 year ago

Nextcloud 27.0.0, bug is still present. Sorry for the delay, @szaimen

Screenshot:

Screenshot_2023-07-02_10-33-29

The first directory was scanned by navigating into it manually, it has the correct timestamp. The other dirs were left to be scanned by Nextcloud.

joshtrichards commented 3 weeks ago

Sounds like #1583 in essence

DorraJaouad commented 3 weeks ago

duplicate of #1583