Skip to content

No preview in public conversations when not logged in (guest) #19247

Description

@Sabst

Tip

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

This looks like a regression of old and closed issues, for example #4471 or #2309.

Steps to reproduce

  1. In Talk, use "Create a new conversation"
  • With default type
  • Activate "Allow guest to join by link"
  • And "Create the conversation"
  1. Add a JPEG image from your local disk ("Upload from device") to the conversation
  2. Connect to the conversation from another browser or from a private window (as a guest)
  3. The image is there but no preview is available
    The following URL (example) gets a 500 error and no other detail:
    https://mysite/apps/files_sharing/publicpreview/roL68HA6983KtHw?x=-1&y=384&a=1

Additional steps:
5. Click on the image, it opens a public share where the image is displayed
6. In that new context the preview is visible
The associated URL (example) is:
https://mysite/apps/files_sharing/publicpreview/roL68HA6983KtHw?file=%2FIMG_20260823_190436.jpg&x=32&y=32&mimeFallback=true&v=858990&a=0
7. If I add (using curl) "file=" to the first (failing) URL above, it works
8. All the previews work correctly if the user is logged in. The problem above only occurs for guests

Alternative scenario: same as above but using "Share from Files" (globally this should be checked with all the ways to share items).

Expected behaviour

The previews should work for guests of public conversations.

Actual behaviour

The previews in the public conversations fail when files were shared with "Upload from device"

Alternative scenario: Some of the previews in the public conversations fail when files were shared with "Share from Files"

Talk app

Talk app version: 24.0.4

Custom Signaling server configured: no

Custom TURN server configured: no

Custom STUN server configured: no

Browser

Microphone available: no

Camera available: no

Operating system: Ubuntu

Browser name: Firefox/Chromium

Browser version: Firefox 154/ Chromium 152

Browser log

Failed to load resource: the server responded with a status of 500 ()
GET
https://mysite/apps/files_sharing/publicpreview/roL68HA6983KtHw?x=-1&y=384&a=1
[HTTP/2 500 96ms]

(same kind of log for the alternative scenario)

Server configuration

Operating system: Debian (host that runs nextcloud through helm)

Web server: Apache/Nginx

Database: PostgreSQL

PHP version: 8.5.10

Nextcloud Version: 34.0.3

List of activated apps:

Details
Enabled:
  - activity: 7.0.0
  - app_api: 34.0.0
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - circles: 34.0.0
  - cloud_federation_api: 1.18.0
  - comments: 1.24.0
  - contactsinteraction: 1.15.0
  - dashboard: 7.14.0
  - dav: 1.40.0
  - federatedfilesharing: 1.24.0
  - federation: 1.24.0
  - files: 2.6.0
  - files_downloadlimit: 5.2.0
  - files_lock: 34.0.1
  - files_pdfviewer: 7.0.0-dev.0
  - files_reminders: 1.7.0
  - files_sharing: 1.26.0
  - files_sharing_raw: 0.7.2
  - files_trashbin: 1.24.0
  - files_versions: 1.27.0
  - firstrunwizard: 7.0.0-dev.0
  - logreader: 7.0.0
  - lookup_server_connector: 1.22.0
  - nextcloud_announcements: 6.0.0
  - notifications: 7.0.0-dev.1
  - oauth2: 1.22.0
  - office: 1.0.0
  - password_policy: 6.0.0-dev.0
  - photos: 7.0.0
  - privacy: 6.0.0-dev.1
  - profile: 1.3.0
  - provisioning_api: 1.24.0
  - recommendations: 7.0.0
  - related_resources: 5.0.0-dev.0
  - richdocuments: 11.1.0
  - serverinfo: 6.0.0
  - settings: 1.17.0
  - sharebymail: 1.24.0
  - spreed: 24.0.4
  - support: 6.0.0
  - survey_client: 6.0.0-dev.0
  - systemtags: 1.24.0
  - text: 8.0.0
  - theming: 2.9.0
  - theming_customcss: 1.21.0
  - twofactor_backupcodes: 1.23.0
  - twofactor_totp: 16.0.0
  - updatenotification: 1.24.0
  - user_status: 1.14.0
  - viewer: 7.0.0-dev.0
  - weather_status: 1.14.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - admin_audit: 1.24.0
  - encryption: 2.22.0
  - files_external: 1.26.0
  - suspicious_login: 12.0.0-dev.0
  - twofactor_nextcloud_notification: 8.0.0
  - user_ldap: 1.25.0

Nextcloud configuration:

Details
{
    "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
            }
        ],
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpsecure": "tls",
        "mail_smtpauth": true,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "upgrade.disable-web": true,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "<my host>"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "34.0.3.2",
        "overwrite.cli.url": "https:\/\/<my host>",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "updater.server.url": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2,
        "log_type": "syslog",
        "mail_smtptimeout": 30,
        "overwriteprotocol": "https",
        "mail_smtpdebug": false,
        "maintenance": false,
        "syslog_tag": "Nextcloud",
        "logfile": "",
        "openmetrics_allowed_clients": [
            "127.0.0.1",
            "10.42.0.0\/16",
            "10.43.0.0\/16"
        ],
        "enabledPreviewProviders": {
            "0": "OC\\Preview\\Movie",
            "1": "OC\\Preview\\MP4",
            "2": "OC\\Preview\\AVI",
            "3": "OC\\Preview\\MKV",
            "4": "OC\\Preview\\MOV",
            "5": "OC\\Preview\\Image",
            "6": "OC\\Preview\\PNG",
            "7": "OC\\Preview\\JPEG",
            "8": "OC\\Preview\\GIF",
            "9": "OC\\Preview\\HEIC",
            "11": "OC\\Preview\\JPG"
        },
        "backgroundjobs_mode": "cron",
        "update_check": false,
        "simpleSignUpLink.shown": false,
        "app_install_overwrite": [],
        "DB_PORT": "5432"
    }
}

Server log (data/nextcloud.log)

Details
{"reqId":"z8P6WciD4t2fhx0WgRaz","level":3,"time":"2026-09-03 07:16:37","remoteAddr":"192.168.193.165","user":"--","app":"index","method":"GET","url":"/apps/files_sharing/publicpreview/roL68HA6983KtHw?x=-1&y=384&a=1","scriptName":"/index.php","message":"OC\\PreviewManager::getPreview(): Argument #1 ($file) must be of type OCP\\Files\\File, OC\\Files\\Node\\Folder given, called in /var/www/html/apps/files_sharing/lib/Controller/PublicPreviewController.php on line 133 in file '/var/www/html/lib/private/PreviewManager.php' line 171","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36","version":"34.0.3.2","exception":{"Exception":"Exception","Message":"OC\\PreviewManager::getPreview(): Argument #1 ($file) must be of type OCP\\Files\\File, OC\\Files\\Node\\Folder given, called in /var/www/html/apps/files_sharing/lib/Controller/PublicPreviewController.php on line 133 in file '/var/www/html/lib/private/PreviewManager.php' line 171","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files_Sharing\\Controller\\PublicPreviewController"},"getPreview"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":324,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files_Sharing\\Controller\\PublicPreviewController","getPreview",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"files_sharing.publicpreview.getpreview","token":"roL68HA6983KtHw"}]},{"file":"/var/www/html/lib/base.php","line":1172,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/files_sharing/publicpreview/roL68HA6983KtHw"]},{"file":"/var/www/html/index.php","line":25,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":110,"Previous":{"Exception":"TypeError","Message":"OC\\PreviewManager::getPreview(): Argument #1 ($file) must be of type OCP\\Files\\File, OC\\Files\\Node\\Folder given, called in /var/www/html/apps/files_sharing/lib/Controller/PublicPreviewController.php on line 133","Code":0,"Trace":[{"file":"/var/www/html/apps/files_sharing/lib/Controller/PublicPreviewController.php","line":133,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[{"__class__":"OC\\Files\\Node\\Folder"},-1,384,false]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":165,"function":"getPreview","class":"OCA\\Files_Sharing\\Controller\\PublicPreviewController","type":"->","args":["roL68HA6983KtHw",{"__class__":"OC\\Files\\Node\\Folder"},-1,384,true,false]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":78,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files_Sharing\\Controller\\PublicPreviewController"},"getPreview"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files_Sharing\\Controller\\PublicPreviewController"},"getPreview"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":324,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files_Sharing\\Controller\\PublicPreviewController","getPreview",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"files_sharing.publicpreview.getpreview","token":"roL68HA6983KtHw"}]},{"file":"/var/www/html/lib/base.php","line":1172,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/files_sharing/publicpreview/roL68HA6983KtHw"]},{"file":"/var/www/html/index.php","line":25,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/PreviewManager.php","Line":171},"message":"OC\\PreviewManager::getPreview(): Argument #1 ($file) must be of type OCP\\Files\\File, OC\\Files\\Node\\Folder given, called in /var/www/html/apps/files_sharing/lib/Controller/PublicPreviewController.php on line 133 in file '/var/www/html/lib/private/PreviewManager.php' line 171","exception":"{\"class\":\"Exception\",\"message\":\"OC\\PreviewManager::getPreview(): Argument #1 ($file) must be of type OCP\\Files\\File, OC\\Files\\Node\\Folder given, called in /var/www/html/apps/files_sharing/lib/Controller/PublicPreviewController.php on line 133 in file '/var/www/html/lib/private/PreviewManager.php' line 171\",\"code\":0,\"file\":\"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php:110\",\"trace\":\"#0 /var/www/html/lib/private/AppFramework/App.php(137): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Files_Sharing\\Controller\\PublicPreviewController), 'getPreview')\\n#1 /var/www/html/lib/private/Route/Router.php(324): OC\\AppFramework\\App::main('OCA\\\\Files_Shari...', 'getPreview', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\\n#2 /var/www/html/lib/base.php(1172): OC\\Route\\Router->match('/apps/files_sha...')\\n#3 /var/www/html/index.php(25): OC::handleRequest()\\n#4 {main}\",\"previous\":{\"class\":\"TypeError\",\"message\":\"OC\\PreviewManager::getPreview(): Argument #1 ($file) must be of type OCP\\Files\\File, OC\\Files\\Node\\Folder given, called in /var/www/html/apps/files_sharing/lib/Controller/PublicPreviewController.php on line 133\",\"code\":0,\"file\":\"/var/www/html/lib/private/PreviewManager.php:171\",\"trace\":\"#0 /var/www/html/apps/files_sharing/lib/Controller/PublicPreviewController.php(133): OC\\PreviewManager->getPreview(Object(OC\\Files\\Node\\Folder), -1, 384, false)\\n#1 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(165): OCA\\Files_Sharing\\Controller\\PublicPreviewController->getPreview('roL68HA6983KtHw', Object(OC\\Files\\Node\\Folder), -1, 384, true, false)\\n#2 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(78): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\Files_Sharing\\Controller\\PublicPreviewController), 'getPreview')\\n#3 /var/www/html/lib/private/AppFramework/App.php(137): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Files_Sharing\\Controller\\PublicPreviewController), 'getPreview')\\n#4 /var/www/html/lib/private/Route/Router.php(324): OC\\AppFramework\\App::main('OCA\\\\Files_Shari...', 'getPreview', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\\n#5 /var/www/html/lib/base.php(1172): OC\\Route\\Router->match('/apps/files_sha...')\\n#6 /var/www/html/index.php(25): OC::handleRequest()\\n#7 {main}\"}}","CustomMessage":"OC\\PreviewManager::getPreview(): Argument #1 ($file) must be of type OCP\\Files\\File, OC\\Files\\Node\\Folder given, called in /var/www/html/apps/files_sharing/lib/Controller/PublicPreviewController.php on line 133 in file '/var/www/html/lib/private/PreviewManager.php' line 171"}}

When using the alternative scenario:

Details ``` { "reqId": "8wj42mLCTFmiVKGVyd2d", "level": 3, "time": "2026-09-03 07:33:14", "remoteAddr": "192.168.193.165", "user": "--", "app": "index", "method": "GET", "url": "/apps/files_sharing/publicpreview/tRD7CooDggB9EYo?x=-1&y=384&a=1", "scriptName": "/index.php", "message": "An exception occurred while executing a query: SQLSTATE[42702]: Ambiguous column: 7 ERROR: column reference \"file_id\" is ambiguous\nLINE 1: ...rsions\" \"v\" ON \"p\".\"version_id\" = \"v\".\"id\" WHERE (\"file_id\" ...\n ^", "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36", "version": "34.0.3.2", "exception": { "Exception": "OC\\DB\\Exceptions\\DbalException", "Message": "An exception occurred while executing a query: SQLSTATE[42702]: Ambiguous column: 7 ERROR: column reference \"file_id\" is ambiguous\nLINE 1: ...rsions\" \"v\" ON \"p\".\"version_id\" = \"v\".\"id\" WHERE (\"file_id\" ...\n ^", "Code": 7, "Trace": [ { "file": "/var/www/html/lib/private/DB/ConnectionAdapter.php", "line": 60, "function": "wrap", "class": "OC\\DB\\Exceptions\\DbalException", "type": "::", "args": [ { "__class__": "Doctrine\\DBAL\\Exception\\NonUniqueFieldNameException" }, "", "SELECT `p`.*, `l`.`bucket_name`, `l`.`object_store_name`, `v`.`version` FROM `*PREFIX*previews` `p` LEFT JOIN `*PREFIX*preview_locations` `l` ON `p`.`location_id` = `l`.`id` LEFT JOIN `*PREFIX*preview_versions` `v` ON `p`.`version_id` = `v`.`id` WHERE (`file_id` = :dcValue1) AND (`width` = :dcValue2) AND (`height` = :dcValue3) AND (`mimetype_id` = :dcValue4) AND (`cropped` = :dcValue5) AND (`version_id` = :dcValue6)" ] }, { "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php", "line": 261, "function": "executeQuery", "class": "OC\\DB\\ConnectionAdapter", "type": "->", "args": [ "SELECT `p`.*, `l`.`bucket_name`, `l`.`object_store_name`, `v`.`version` FROM `*PREFIX*previews` `p` LEFT JOIN `*PREFIX*preview_locations` `l` ON `p`.`location_id` = `l`.`id` LEFT JOIN `*PREFIX*preview_versions` `v` ON `p`.`version_id` = `v`.`id` WHERE (`file_id` = :dcValue1) AND (`width` = :dcValue2) AND (`height` = :dcValue3) AND (`mimetype_id` = :dcValue4) AND (`cropped` = :dcValue5) AND (`version_id` = :dcValue6)", { "dcValue1": 137, "dcValue2": 1024, "dcValue3": 576, "dcValue4": 10, "dcValue5": false, "0": "And 1 more entries, set log level to debug to see all entries" }, { "dcValue1": 2, "dcValue2": 2, "dcValue3": 2, "dcValue4": 2, "dcValue5": 2, "0": "And 1 more entries, set log level to debug to see all entries" } ] }, (...) } ```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions