nextcloud / server

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

PDF Viewer can't open files depending on file name #27045

Closed muchachagrande closed 3 years ago

muchachagrande commented 3 years ago

How to use GitHub

Steps to reproduce

  1. Open Files App and locate some PDF file with spaces on the filename
  2. Click on the PDF file containing spaces on the filename
  3. The PDF Viewer shows up
  4. A red line appears on PDF Viewer telling "Missing PDF file"
  5. Close the PDF Viewer
  6. Rename the PDF file to some name without spaces
  7. Click on the PDF file
  8. The PDF Viewer shows up and opens the PDF file without problem
  9. (I didn't test with other characters other than a-z and spaces)
  10. (I tested with external SMB storage and with local)

Expected behaviour

The PDF Viewer should open and show the PDF file regardless of the file name

Actual behaviour

Whet the file name contain spaces a red line appears on PDF Viewer telling "Missing PDF file"

Server configuration

Operating system: Ubuntu 18.04 Web server: Apache 2 Database: Postgre 12 PHP version: 7.4 Nextcloud version: (see Nextcloud admin page) 21.0.2 Updated from an older Nextcloud/ownCloud or fresh install: 21.0.1 Where did you install Nextcloud from: Hannson IT VM Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:

App list ``` Enabled: - accessibility: 1.7.0 - activity: 2.14.3 - admin_audit: 1.11.0 - bookmarks: 4.2.1 - calendar: 2.2.1 - cloud_federation_api: 1.4.0 - comments: 1.11.0 - contacts: 3.5.1 - contactsinteraction: 1.2.0 - dashboard: 7.1.0 - dav: 1.17.1 - extract: 1.3.1 - federatedfilesharing: 1.11.0 - federation: 1.11.0 - files: 1.16.0 - files_external: 1.12.0 - files_pdfviewer: 2.1.0 - files_rightclick: 1.0.0 - files_sharing: 1.13.1 - files_trashbin: 1.11.0 - files_versions: 1.14.0 - files_videoplayer: 1.10.0 - integration_whiteboard: 0.0.14 - keeweb: 0.6.5 - logreader: 2.6.0 - lookup_server_connector: 1.9.0 - maps: 0.1.8 - metadata: 0.13.0 - nextcloud_announcements: 1.10.0 - notes: 4.0.4 - notifications: 2.9.0 - notify_push: 0.1.7 - oauth2: 1.9.0 - password_policy: 1.11.0 - phonetrack: 0.6.7 - photos: 1.3.0 - privacy: 1.5.0 - provisioning_api: 1.11.0 - qownnotesapi: 20.9.0 - richdocuments: 4.1.0 - serverinfo: 1.11.0 - settings: 1.3.0 - sharebymail: 1.11.0 - spreed: 11.2.1 - systemtags: 1.11.0 - tasks: 0.13.6 - text: 3.2.0 - theming: 1.12.0 - twofactor_backupcodes: 1.10.0 - twofactor_nextcloud_notification: 3.1.2 - updatenotification: 1.11.0 - user_status: 1.1.1 - viewer: 1.5.0 - weather_status: 1.1.0 - workflowengine: 2.3.0 Disabled: - encryption - firstrunwizard - recommendations - support - survey_client - user_ldap ```

Nextcloud configuration:

Config report ``` { "system": { "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "localhost", "192.168.2.4", "cloud.example.com", ], "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "pgsql", "version": "21.0.2.1", "overwrite.cli.url": "https:\/\/cloud.example.com\/", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "remember_login_cookie_lifetime": "1800", "log_rotate_size": "10485760", "memcache.local": "\\OC\\Memcache\\Redis", "filelocking.enabled": true, "memcache.distributed": "\\OC\\Memcache\\Redis", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "timeout": 0.5, "dbindex": 0, "password": "***REMOVED SENSITIVE VALUE***" }, "htaccess.RewriteBase": "\/", "loglevel": "2", "log_type": "file", "logfile": "\/var\/log\/nextcloud\/nextcloud.log", "logtimezone": "America\/Argentina\/Buenos_Aires", "default_language": "es_AR", "force_language": "es_AR", "default_locale": "es_AR", "force_locale": "es_AR", "log.condition": { "apps": [ "admin_audit" ] }, "maintenance": false, "mail_smtpsecure": "ssl", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "knowledgebaseenabled": false, "lost_password_link": "disabled", "enable_previews": true, "preview_max_x": 512, "preview_max_y": 512, "preview_max_filesize_image": -1, "enabledPreviewProviders": [ "OC\\Preview\\PNG", "OC\\Preview\\JPEG", "OC\\Preview\\GIF", "OC\\Preview\\HEIC", "OC\\Preview\\BMP", "OC\\Preview\\XBitmap", "OC\\Preview\\MP3", "OC\\Preview\\TXT", "OC\\Preview\\MarkDown", "OC\\Preview\\Krita", "OC\\Preview\\OpenDocument", "OC\\Preview\\PDF", "OC\\Preview\\MSOffice2003", "OC\\Preview\\MSOfficeDoc", "OC\\Preview\\MSOffice2007", "OC\\Preview\\StarOffice", "OC\\Preview\\SVG", "OC\\Preview\\TIFF", "OC\\Preview\\Font", "OC\\Preview\\Movie", "OC\\Preview\\MKV", "OC\\Preview\\MP4", "OC\\Preview\\AVI", "OC\\Preview\\Illustrator", "OC\\Preview\\Photoshop", "OC\\Preview\\Postscript", "OC\\Preview\\Epub" ], "twofactor_enforced": "false", "twofactor_enforced_groups": [], "twofactor_enforced_excluded_groups": [], "skeletondirectory": "", "theme": "", "default_phone_region": "se", "app_install_overwrite": [] }, "apps": { "accessibility": { "types": "", "enabled": "[\"admin\",\"users\"]", "installed_version": "1.7.0" }, "activity": { "types": "filesystem", "enabled": "yes", "installed_version": "2.14.3" }, "admin_audit": { "installed_version": "1.11.0", "types": "logging", "enabled": "yes" }, "appointments": { "hk": "7ad30d20184003996cc6979fcb74fc36878995ebd53ff1f8fa0d8162dcf1f868", "enabled": "no", "tiv": "0e81d4c1866a64df92e12b96c16208c4", "installed_version": "1.0.9", "types": "" }, "backgroundjob": { "lastjob": "3" }, "bookmarks": { "types": "", "privacy.enableScraping": "true", "previews.screenly.url": "http:\/\/192.168.2.4:4080\/api\/v1\/fullsize", "installed_version": "4.2.1", "enabled": "[\"admin\",\"users\"]", "previews.screenly.token": "", "previews.screenshotmachine.key": "", "previews.webshot.url": "", "performance.maxBookmarksperAccount": "" }, "calendar": { "types": "", "installed_version": "2.2.1", "enabled": "[\"admin\",\"users\"]" }, "cloud_federation_api": { "types": "filesystem", "enabled": "yes", "installed_version": "1.4.0" }, "comments": { "types": "logging", "enabled": "yes", "installed_version": "1.11.0" }, "contacts": { "types": "dav", "installed_version": "3.5.1", "enabled": "[\"admin\",\"users\"]" }, "contactsinteraction": { "installed_version": "1.2.0", "types": "dav", "enabled": "[\"admin\",\"users\"]" }, "core": { "installedat": "1556145584.2366", "vendor": "nextcloud", "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php", "public_files": "files_sharing\/public.php", "backgroundjobs_mode": "cron", "shareapi_default_expire_date": "yes", "moveavatarsdone": "yes", "previewsCleanedUp": "1", "shareapi_expire_after_n_days": "1", "shareapi_allow_public_upload": "yes", "scss.variables": "d41d8cd98f00b204e9800998ecf8427e", "shareapi_allow_share_dialog_user_enumeration": "no", "oc.integritycheck.checker": "[]", "enterpriseLogoChecked": "yes", "shareapi_allow_group_sharing": "yes", "shareapi_default_permission_candelete": "no", "newUser.sendEmail": "no", "shareapi_enable_link_password_by_default": "no", "shareapi_only_share_with_group_members": "no", "shareapi_default_permission_canupdate": "no", "shareapi_default_permission_cancreate": "no", "shareapi_exclude_groups": "yes", "lastupdatedat": "1621520186", "lastupdateResult": "[]", "shareapi_exclude_groups_list": "[\"Amigos\"]", "shareapi_default_permissions": "1", "shareapi_enabled": "yes", "theming.variables": "71af35aa6d188a9c0844781889a89893", "shareapi_default_permission_canshare": "no", "lastcron": "1621523701" }, "dashboard": { "types": "", "enabled": "[\"admin\",\"users\"]", "installed_version": "7.1.0" }, "dav": { "types": "filesystem", "enabled": "yes", "regeneratedBirthdayCalendarsForYearFix": "yes", "installed_version": "1.17.1", "buildCalendarSearchIndex": "yes", "chunks_migrated": "1", "buildCalendarReminderIndex": "yes", "sendEventRemindersPush": "yes" }, "deck": { "installed_version": "1.0.2", "types": "dav", "enabled": "no" }, "extract": { "types": "", "installed_version": "1.3.1", "enabled": "[\"admin\",\"users\"]" }, "federatedfilesharing": { "types": "", "enabled": "yes", "installed_version": "1.11.0" }, "federation": { "installed_version": "1.11.0", "types": "authentication", "enabled": "yes" }, "files": { "default_quota": "0 B", "types": "filesystem", "enabled": "yes", "cronjob_scan_files": "500", "installed_version": "1.16.0", "watermark_shareAll": "no", "watermark_shareRead": "no", "watermark_linkSecure": "no", "watermark_linkRead": "no", "watermark_linkAll": "no", "watermark_linkTags": "no", "watermark_linkTagsList": "", "watermark_allGroups": "no", "watermark_allGroupsList": "", "watermark_allTags": "no", "watermark_allTagsList": "", "watermark_text": "", "watermark_enabled": "no" }, "files_bpm": { "installed_version": "0.2.1", "types": "filesystem,dav", "enabled": "no" }, "files_external": { "types": "filesystem", "enabled": "yes", "installed_version": "1.12.0", "user_mounting_backends": "ftp,dav,owncloud,sftp,amazons3,swift,smb,\\OC\\Files\\Storage\\SFTP_Key,\\OC\\Files\\Storage\\SMB_OC", "allow_user_mounting": "no" }, "files_pdfviewer": { "types": "", "installed_version": "2.1.0", "enabled": "[\"admin\",\"users\"]" }, "files_rightclick": { "types": "", "installed_version": "1.0.0", "enabled": "[\"admin\",\"users\",\"rastreo\",\"Amigos\"]" }, "files_sharing": { "types": "filesystem", "enabled": "yes", "lookupServerUploadEnabled": "no", "installed_version": "1.13.1" }, "files_texteditor": { "installed_version": "2.8.0", "types": "", "enabled": "no" }, "files_trashbin": { "installed_version": "1.11.0", "types": "filesystem,dav", "enabled": "yes" }, "files_versions": { "types": "filesystem,dav", "enabled": "yes", "installed_version": "1.14.0" }, "files_videoplayer": { "types": "", "installed_version": "1.10.0", "enabled": "[\"admin\",\"users\",\"Amigos\"]" }, "firstrunwizard": { "installed_version": "2.5.0", "types": "logging", "enabled": "no" }, "gallery": { "types": "", "installed_version": "18.4.0", "enabled": "no" }, "integration_whiteboard": { "installed_version": "0.0.14", "types": "", "enabled": "[\"admin\",\"users\"]" }, "issuetemplate": { "installed_version": "0.5.0", "types": "", "enabled": "no" }, "keeweb": { "installed_version": "0.6.5", "types": "", "enabled": "[\"admin\",\"users\"]" }, "logreader": { "types": "", "enabled": "[\"admin\",\"users\"]", "installed_version": "2.6.0", "live": "1", "relativedates": "", "levels": "11111" }, "lookup_server_connector": { "types": "authentication", "enabled": "yes", "installed_version": "1.9.0" }, "maps": { "lastAddressLookup": "1615382639", "osrmBikeURL": "", "osrmCarURL": "", "enabled": "yes", "osrmDEMO": "on", "types": "filesystem", "installed_version": "0.1.8" }, "metadata": { "installed_version": "0.13.0", "types": "", "enabled": "[\"users\",\"admin\"]" }, "nextcloud_announcements": { "types": "logging", "installed_version": "1.10.0", "enabled": "yes", "pub_date": "Thu, 24 Oct 2019 00:00:00 +0200" }, "notes": { "types": "", "enabled": "[\"admin\",\"users\"]", "installed_version": "4.0.4" }, "notifications": { "types": "logging", "enabled": "yes", "installed_version": "2.9.0" }, "notify_push": { "types": "filesystem", "installed_version": "0.1.7", "enabled": "yes", "base_endpoint": "https:\/\/cloud.example.com\/push", "cookie": "229107128" }, "oauth2": { "types": "authentication", "enabled": "yes", "installed_version": "1.9.0" }, "password_policy": { "types": "authentication", "enabled": "yes", "installed_version": "1.11.0" }, "phonetrack": { "types": "", "installed_version": "0.6.7", "enabled": "[\"admin\",\"rastreo\",\"users\"]" }, "photos": { "installed_version": "1.3.0", "enabled": "[\"admin\",\"users\"]", "types": "" }, "previewgenerator": { "heighSizes": "512", "enabled": "no", "squareSizes": "512", "heightSizes": "256", "types": "filesystem", "installed_version": "3.1.0", "widthSizes": "512" }, "privacy": { "types": "", "installed_version": "1.5.0", "enabled": "[\"admin\",\"users\"]", "readableLocation": "ar" }, "provisioning_api": { "types": "prevent_group_restriction", "enabled": "yes", "installed_version": "1.11.0" }, "qownnotesapi": { "types": "", "enabled": "[\"admin\",\"users\"]", "installed_version": "20.9.0" }, "recommendations": { "types": "", "installed_version": "0.5.0", "enabled": "no" }, "richdocuments": { "doc_format": "", "canonical_webroot": "", "use_groups": "admin|users", "types": "filesystem,dav,prevent_group_restriction", "edit_groups": "", "installed_version": "4.1.0", "public_wopi_url": "https:\/\/cloud.example.com\/wopi", "enabled": "yes", "external_apps": "", "wopi_url": "https:\/\/cloud.example.com\/wopi", "disable_certificate_verification": "" }, "richdocumentscode": { "enabled": "no", "installed_version": "6.4.704", "types": "" }, "serverinfo": { "types": "", "enabled": "[\"admin\",\"users\"]", "installed_version": "1.11.0" }, "settings": { "installed_version": "1.3.0", "enabled": "yes", "types": "" }, "sharebymail": { "types": "filesystem", "enabled": "yes", "installed_version": "1.11.0" }, "spreed": { "has_reference_id": "yes", "start_conversations": "[\"admin\",\"users\"]", "sip_bridge_groups": "[\"admin\"]", "hide_signaling_warning": "yes", "signaling_ticket_secret": "***REMOVED SENSITIVE VALUE***", "project_access_invalidated": "1", "stun_servers": "***REMOVED SENSITIVE VALUE***", "enabled": "yes", "types": "dav,prevent_group_restriction", "turn_servers": "***REMOVED SENSITIVE VALUE***", "signaling_servers": "***REMOVED SENSITIVE VALUE***", "sip_bridge_dialin_info": "+54 11 2201-1744", "sip_bridge_shared_secret": "1sLkdU862hKAWOMs3329", "allowed_groups": "[\"admin\",\"Amigos\",\"users\"]", "installed_version": "11.2.1" }, "support": { "installed_version": "1.0.0", "types": "", "enabled": "no" }, "survey_client": { "installed_version": "1.4.0", "types": "", "enabled": "no" }, "systemtags": { "types": "logging", "enabled": "yes", "installed_version": "1.11.0" }, "tasks": { "types": "", "enabled": "[\"admin\",\"users\"]", "installed_version": "0.13.6" }, "text": { "types": "dav", "installed_version": "3.2.0", "enabled": "[\"admin\",\"users\"]" }, "theming": { "types": "logging", "enabled": "yes", "logoMime": "image\/png", "installed_version": "1.12.0", "name": "MyName", "url": "***REMOVED SENSITIVE VALUE***", "slogan": "***REMOVED SENSITIVE VALUE***", "color": "#DADADA", "backgroundMime": "backgroundColor", "cachebuster": "8" }, "twofactor_backupcodes": { "types": "", "enabled": "yes", "installed_version": "1.10.0" }, "twofactor_nextcloud_notification": { "ijm_enabled": "1", "types": "", "fjm_enabled": "1", "installed_version": "3.1.2", "enabled": "[\"admin\",\"users\"]" }, "updatenotification": { "extract": "1.2.4", "enabled": "[\"admin\"]", "keeweb": "0.6.5", "types": "", "installed_version": "1.11.0", "qownnotesapi": "20.9.0", "richdocuments": "4.1.0", "spreed": "11.1.2", "notify_push": "0.1.7", "user_external": "0.8.0", "update_check_errors": "0", "files_rightclick": "0.15.0", "contacts": "3.5.1", "phonetrack": "0.6.7", "tasks": "0.13.6", "twofactor_nextcloud_notification": "3.1.0", "appointments": "1.1.5", "maps": "0.1.6", "notes": "4.0.2", "bookmarks": "4.2.1", "previewgenerator": "3.1.0", "richdocumentscode": "6.4.703", "core": "21.0.2.1", "calendar": "2.2.0" }, "user_external": { "types": "prelogin,authentication", "enabled": "no", "installed_version": "0.8.0" }, "user_status": { "installed_version": "1.1.1", "enabled": "[\"admin\",\"Amigos\",\"users\"]", "types": "" }, "viewer": { "types": "", "installed_version": "1.5.0", "enabled": "[\"admin\",\"users\"]" }, "weather_status": { "types": "", "enabled": "[\"admin\",\"users\"]", "installed_version": "1.1.0" }, "workflowengine": { "types": "filesystem", "enabled": "yes", "installed_version": "2.3.0" } } } ```

Are you using external storage, if yes which one: local/smb/sftp/... local and SMB Are you using encryption: yes/no no Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... no

Client configuration

Browser: Firefox 88.0.1 and Bave 1.24.85 Chromium: 90.0.4430.212 (Official Build) (64-bit) Operating system: Windows 8.1

Logs

Web server error log

Web server error log ``` cloud.example.com:443 192.168.2.1 - - [20/May/2021:12:30:00 -0300] "PROPFIND /remote.php/dav/files/admin/data/Documentos/Mapa%20Vecinal.pdf HTTP/1.1" 207 5147 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0" cloud.example.com:443 192.168.2.1 - - [20/May/2021:12:30:00 -0300] "PROPFIND /remote.php/dav/files/fjm/ HTTP/1.1" 207 5336 "-" "Mozilla/5.0 (Windows) mirall/3.1.3stable-Win64 (build 20210218) (Nextcloud)" cloud.example.com:443 192.168.2.1 - - [20/May/2021:12:30:00 -0300] "GET /apps/files_pdfviewer/?file=https%3A%2F%2Fcloud.example.com%2Fremote.php%2Fdav%2Ffiles%2Fadmin%2Fdata%2FDocumentos%2FMapa%252520Vecinal.pdf HTTP/1.1" 200 9508 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0" cloud.example.com:443 192.168.2.1 - - [20/May/2021:12:30:01 -0300] "GET /apps/files_pdfviewer/js/files_pdfviewer-workersrc.js?v=2.1.0 HTTP/1.1" 200 6257 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0" cloud.example.com:443 192.168.2.1 - - [20/May/2021:12:30:01 -0300] "GET /apps/files_pdfviewer/js/pdfjs/build/pdf.js?v=2.1.0 HTTP/1.1" 200 159614 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0" cloud.example.com:443 192.168.2.1 - - [20/May/2021:12:30:01 -0300] "GET /apps/files_pdfviewer/js/pdfjs/web/viewer.js?v=2.1.0 HTTP/1.1" 200 99277 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0" cloud.example.com:443 192.168.2.1 - - [20/May/2021:12:30:01 -0300] "PROPFIND /remote.php/dav/files/fjm/data HTTP/1.1" 207 5464 "-" "Mozilla/5.0 (Windows) mirall/3.1.3stable-Win64 (build 20210218) (Nextcloud)" cloud.example.com:443 192.168.2.1 - - [20/May/2021:12:30:01 -0300] "GET /apps/files_pdfviewer/js/pdfjs/web/locale/locale.properties?v=2.1.0 HTTP/1.1" 302 4714 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0" cloud.example.com:443 192.168.2.1 - - [20/May/2021:12:30:01 -0300] "GET /apps/dashboard/ HTTP/1.1" 200 16910 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0" cloud.example.com:443 192.168.2.1 - - [20/May/2021:12:30:01 -0300] "GET /remote.php/dav/files/admin/data/Documentos/Mapa%2520Vecinal.pdf HTTP/1.1" 404 21820 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0" ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` No Nextcloud Log entries ```

Browser log

Browser log ``` Firefox log shows this when trying to open "Mapa Vecinal.pdf" : XHR GET https://cloud.example.com/remote.php/dav/files/admin/data/Documentos/Mapa%2520Vecinal.pdf [HTTP/2 404 Not Found 89ms] ```
kesselb commented 3 years ago

https://github.com/nextcloud/files_pdfviewer/issues/254

muchachagrande commented 3 years ago

This is not the same error, but I see I opened the bug report in the wrong place. Sorry for that.

Someone opened it already there: https://github.com/nextcloud/files_pdfviewer/issues/381

Thank you