Skip to content

[Bug]: Preview Generation Fail - Local Storage #56510

@feeling001

Description

@feeling001

⚠️ This issue respects the following points: ⚠️

Bug description

Preview generation fail (because preview folder i'nt created) in NC 32.0.1 (latest).

Setup:

  • Nextcloud 32 trough docker compose (image: "nextcloud:32.0")
  • mariadb
  • apps installed (preview generator + memories) : latest
  • local volumes mounted trough volumes (docker):
    • /mnt/DiskCloud/:/var/www/html/data
    • /mnt/Photos:/mnt/Photos (mounted as local storage into nextcloud)

Issue:

  • Lot of preview are not generated into the stock photo (and memories) app's.
  • I tried with the local generator backend (imagick) and external (imaginary) with same result

Troubleshoot:

  • I did a lot of troubleshoot, together with previewmanager app
  • lib/private/PreviewManager.php call the lib/private/Preview/Generator.php backend.
  • lib/private/Preview/Generator.php try to write the preview (which is correctly generated trough the preview generator) in to the /app_xxx/preview/a/b/c/d/e/f/g/photo_id/ folder , which use the lib/private/Files/Node/File.php (trough lib/private/Files/View.php)

The fwrite fail because the folder /app_xxx/preview/a/b/c/d/e/f/g/photo_id/ is not created.
This is NOT a file permission issue since the process run as www-data and the permissions are 755 for folders and 644 for files for all the /app_xxx/ folder . (and of course ownership is also www-data).

I tried to manually create all the folder based on the fileid contained in oc_filecache ( matching jpg/JPG ) and after this, all previews are correctly generated.

==>> It seems to have an issue with the preview directory creation ....
Forcing the directory creation in View.php works but it's crappy.

Best regards.

Steps to reproduce

1.Recreate my setup here above
2.Put 300Gb of jpg in it
3.run php occ preview:generate-all
4.look at the photo (or memories) gallery (lot of preview cannot be created)

Expected behavior

All preview are correctly generated into the /app_xxxx/a/b/c/d/e/f/g/file_id/ folders.

Nextcloud Server version

32

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MariaDB

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

Updated from a MINOR version (ex. 32.0.1 to 32.0.2)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "upgrade.disable-web": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.XXX.YYY",
            "my.domain.com",
            "192.168.XXX.YYY"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "wopi": {
            "allow_hosts": [
                "my.domain.com"
                "collabora.my.domain.com"
            ]
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "32.0.1.2",
        "overwrite.cli.url": "https:\/\/cloud.my.domain.com",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpport": "587",
        "mail_smtpauth": true,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2,
        "maintenance": false,
        "maintenance_window_start": 1,
        "default_phone_region": "FR",
        "app_install_overwrite": [],
        "memories.max_preview_size": 2048,
        "files_external_allow_create_new_local": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\PDF",
            "OC\\Preview\\Movie",
            "OC\\Preview\\Image",
            "OC\\Preview\\Imaginary"
        ],
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "preview_max_filesize_image": 50,
        "preview_path": "data\/appdata_xxx\/preview",
        "enable_previews": true,
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "preview_max_scale_factor": 1,
        "jpeg_quality": 60,
        "preview_max_memory": 512,
        "preview_limit_enforcement": true,
        "memories.gis_type": 1,
        "memories.db.triggers.fcu": true,
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_allow_insecure": true,
        "memories.imaginary_url": "http:\/\/192.168.XXX.YYY:9000",
        "memories.preview_max_size": 2048,
        "memories.imaginary_proxy": false,
        "memories.vod.disable": false,
        "memories.vod.vaapi": true
    }
}

List of activated Apps

$ php occ app:list
Enabled:
  - activity: 5.0.0-dev.0
  - bruteforcesettings: 5.0.0-dev.0
  - cloud_federation_api: 1.16.0
  - comments: 1.22.0
  - dashboard: 7.12.0
  - dav: 1.34.2
  - drawio: 3.1.2
  - federatedfilesharing: 1.22.0
  - federation: 1.22.0
  - files: 2.4.0
  - files_external: 1.24.0
  - files_pdfviewer: 5.0.0-dev.0
  - files_reminders: 1.5.0
  - files_sharing: 1.24.0
  - files_trashbin: 1.22.0
  - files_versions: 1.25.0
  - logreader: 5.0.0-dev.0
  - lookup_server_connector: 1.20.0
  - memories: 7.7.0
  - music: 2.4.1
  - nextcloud_announcements: 4.0.0-dev.0
  - notifications: 5.0.0-dev.0
  - oauth2: 1.20.0
  - password_policy: 4.0.0-dev.0
  - photos: 5.0.0-dev.1
  - previewgenerator: 5.10.0
  - privacy: 4.0.0-dev.0
  - profile: 1.1.0
  - provisioning_api: 1.22.0
  - recognize: 10.0.6
  - related_resources: 3.0.0-dev.0
  - richdocuments: 9.0.1
  - serverinfo: 4.0.0-dev.0
  - settings: 1.15.1
  - sharebymail: 1.22.0
  - support: 4.0.0-dev.0
  - survey_client: 4.0.0-dev.0
  - systemtags: 1.22.0
  - tasks: 0.17.1
  - text: 6.0.1
  - theming: 2.7.0
  - twofactor_backupcodes: 1.21.0
  - updatenotification: 1.22.0
  - user_status: 1.12.0
  - viewer: 5.0.0-dev.0
  - webhook_listeners: 1.3.0
  - workflowengine: 2.14.0
Disabled:
  - admin_audit: 1.22.0
  - app_api: 32.0.0 (installed 32.0.0)
  - circles: 32.0.0 (installed 32.0.0)
  - contactsinteraction: 1.13.1 (installed 1.13.1)
  - encryption: 2.20.0
  - files_downloadlimit: 5.0.0-dev.0 (installed 5.0.0-dev.0)
  - firstrunwizard: 5.0.0-dev.0 (installed 5.0.0-dev.0)
  - recommendations: 5.0.0-dev.0 (installed 5.0.0-dev.0)
  - suspicious_login: 10.0.0-dev.0
  - twofactor_nextcloud_notification: 6.0.0-dev.0
  - twofactor_totp: 14.0.0
  - user_ldap: 1.23.0
  - weather_status: 1.12.0 (installed 1.12.0)

Nextcloud Signing status

Nextcloud Logs

y at /var/www/html/lib/private/Files/Storage/Local.php#302","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0","version":"32.0.1.2","data":{"app":"PHP"}}
{"reqId":"gVZ9kVqxxeCbruEOtzxb","level":2,"time":"2025-11-18T09:21:04+00:00","remoteAddr":"192.168.XXX.YYY","user":"myusername","app":"PHP","method":"GET","url":"/apps/memories/api/image/preview/235256?c=4efad271b7941b315aabbccf00008bb2&x=256&y=256&a=0","message":"Failed to open stream: No such file or directory at /var/www/html/lib/private/Files/Storage/Local.php#302","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0","version":"32.0.1.2","data":{"app":"PHP"}}

(cannot open stream since the preview is not generated)

Additional info

see troubleshooting here above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap32-feedbackbug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions