Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: PDF previews aren't generated, and Nextcloud office doesn't work #32170

Closed
5 of 8 tasks
JVT038 opened this issue Apr 26, 2022 · 1 comment
Closed
5 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@JVT038
Copy link

JVT038 commented Apr 26, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

I've noticed that PDF files don't have a preview generated. It just shows a PDF icon.
Besides that, I wanted to use Nextcloud as a replacement for Office 365, however I can't edit docx, pptx, and xls files in the browser either.
I'm mentioning these errors in the same issue, because I think they're caused by the same problem, which is ImageMagick.

In general, there are 2 different errors, which are below in the 'log' section.
One is basically an error, saying ImageMagick failed to read the file (which is a really common one) and a more rare error is ImageMagick saying they're unable to open the delegates.xml file.

Now I have zero knowledge about ImageMagick, so I don't know what any of this really means, or how to fix this.

I think a possible solution would be to completely get rid of Imagick, as was discussed in #13099, but I don't know how difficult it is, since I'm not very knowledgeable about the Nextcloud codebase.

Steps to reproduce

  1. Upload a PDF
  2. Generate a preview
  3. See error

Expected behavior

I expected Nextcloud to generate PDFs and to open office documents like it's supposed to

Installation method

Manual installation

Operating system

Other

PHP engine version

PHP 7.4

Web server

Apache (supported)

Database engine version

MySQL

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

No response

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": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "NL",
        "overwritehost": "nextcloud.domain.com",
        "overwriteprotocol": "https",
        "overwrite.cli.url": "https:\/\/nextcloud.domain.com",
        "htaccess.RewriteBase": "\/",
        "allow_local_remote_servers": true,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.domain.com"
        ],
        "enable_previews": true,
        "enabledPreviewProviders": {
            "0": "OC\\Preview\\TXT",
            "1": "OC\\Preview\\MarkDown",
            "2": "OC\\Preview\\OpenDocument",
            "3": "OC\\Preview\\PDF",
            "4": "OC\\Preview\\MSOffice2003",
            "5": "OC\\Preview\\MSOfficeDoc",
            "7": "OC\\Preview\\Image",
            "8": "OC\\Preview\\Photoshop",
            "9": "OC\\Preview\\TIFF",
            "10": "OC\\Preview\\SVG",
            "11": "OC\\Preview\\Font",
            "12": "OC\\Preview\\MP3",
            "13": "OC\\Preview\\Movie",
            "14": "OC\\Preview\\MKV",
            "15": "OC\\Preview\\MP4",
            "16": "OC\\Preview\\AVI",
            "17": "OC\\Preview\\PNG",
            "18": "OC\\Preview\\JPEG",
            "19": "OC\\Preview\\GIF",
            "20": "OC\\Preview\\BMP",
            "21": "OC\\Preview\\XBitmap"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "23.0.4.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "filelocking.enabled": true,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "maintenance": false,
        "updater.secret": "***REMOVED SENSITIVE VALUE***",
        "loglevel": 2
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.9.0
  - activity: 2.15.0
  - apporder: 0.15.0
  - audioplayer: 3.3.0
  - bruteforcesettings: 2.4.0
  - calendar: 3.2.2
  - circles: 23.1.1
  - cloud_federation_api: 1.6.0
  - comments: 1.13.0
  - contacts: 4.1.0
  - contactsinteraction: 1.4.0
  - dashboard: 7.3.0
  - dav: 1.21.0
  - duplicatefinder: 0.0.13
  - extract: 1.3.3
  - federatedfilesharing: 1.13.0
  - federation: 1.13.0
  - files: 1.18.0
  - files_pdfviewer: 2.4.0
  - files_rightclick: 1.2.0
  - files_sharing: 1.15.0
  - files_trashbin: 1.13.0
  - files_versions: 1.16.0
  - files_videoplayer: 1.12.0
  - firstrunwizard: 2.12.0
  - integration_github: 1.0.2
  - integration_onedrive: 1.1.2
  - logreader: 2.8.0
  - lookup_server_connector: 1.11.0
  - mail: 1.11.7
  - maps: 0.1.10
  - news: 18.0.1
  - nextcloud_announcements: 1.12.0
  - notes: 4.3.1
  - notifications: 2.11.1
  - oauth2: 1.11.0
  - onlyoffice: 7.3.2
  - password_policy: 1.13.0
  - phonetrack: 0.7.0
  - photos: 1.5.0
  - previewgenerator: 4.0.0
  - privacy: 1.7.0
  - provisioning_api: 1.13.0
  - recognize: 1.11.0
  - recommendations: 1.2.0
  - richdocuments: 5.0.3
  - serverinfo: 1.13.0
  - settings: 1.5.0
  - sharebymail: 1.13.0
  - support: 1.6.0
  - survey_client: 1.11.0
  - systemtags: 1.13.0
  - tasks: 0.14.4
  - text: 3.4.1
  - theming: 1.14.0
  - twofactor_backupcodes: 1.12.0
  - twofactor_gateway: 0.19.0
  - twofactor_totp: 6.2.0
  - updatenotification: 1.13.0
  - user_status: 1.3.1
  - video_converter: 1.0.4
  - viewer: 1.7.0
  - weather_status: 1.3.0
  - workflow_media_converter: 1.3.6
  - workflowengine: 2.5.0
Disabled:
  - admin_audit
  - encryption
  - facerecognition
  - files_external
  - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

The 'Imagick can't read the file' error:
{"reqId":"HKjgGQGb4E1nKPv4K2JI","level":3,"time":"2022-04-26T19:43:43+00:00","remoteAddr":"xx.xx.xx.xxx","user":"JVT038","app":"core","method":"GET","url":"/core/preview?fileId=8&c=4df36753a5660db347d2e3de74ff9667&x=250&y=250&forceIcon=0&a=0","message":"File: /JVT038/files/Documents/Nextcloud flyer.pdf Imagick says:","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0","version":"23.0.4.1","exception":{"Exception":"ImagickException","Message":"Failed to read the file","Code":1,"Trace":[{"file":"/volume1/web/nextcloud/lib/private/Preview/Bitmap.php","line":86,"function":"readimage","class":"Imagick","type":"->","args":["/volume1/Streaming/Nextcloud/JVT038/files/Documents/Nextcloud flyer.pdf[0]"]},{"file":"/volume1/web/nextcloud/lib/private/Preview/Bitmap.php","line":49,"function":"getResizedPreview","class":"OC\\Preview\\Bitmap","type":"->","args":["/volume1/Streaming/Nextcloud/JVT038/files/Documents/Nextcloud flyer.pdf",4096,4096]},{"file":"/volume1/web/nextcloud/lib/private/Preview/GeneratorHelper.php","line":62,"function":"getThumbnail","class":"OC\\Preview\\Bitmap","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},4096,4096]},{"file":"/volume1/web/nextcloud/lib/private/Preview/Generator.php","line":245,"function":"getThumbnail","class":"OC\\Preview\\GeneratorHelper","type":"->","args":[{"__class__":"OC\\Preview\\PDF"},{"__class__":"OC\\Files\\Node\\File"},4096,4096]},{"file":"/volume1/web/nextcloud/lib/private/Preview/Generator.php","line":140,"function":"getMaxPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\SimpleFS\\SimpleFolder"},{"__class__":"OC\\Files\\Node\\File"},"application/pdf",""]},{"file":"/volume1/web/nextcloud/lib/private/Preview/Generator.php","line":109,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},[{"width":250,"height":250,"crop":true,"mode":"fill"}],"application/pdf"]},{"file":"/volume1/web/nextcloud/lib/private/PreviewManager.php","line":212,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,true,"fill",null]},{"file":"/volume1/web/nextcloud/core/Controller/PreviewController.php","line":169,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,true,"fill"]},{"file":"/volume1/web/nextcloud/core/Controller/PreviewController.php","line":142,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,false,false,"fill"]},{"file":"/volume1/web/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[8,250,250,false,false,"fill"]},{"file":"/volume1/web/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/volume1/web/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/volume1/web/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\PreviewController","getPreviewByFileId",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"core.Preview.getPreviewByFileId"}]},{"file":"/volume1/web/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/core/preview"]},{"file":"/volume1/web/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/volume1/web/nextcloud/lib/private/Preview/Bitmap.php","Line":86,"CustomMessage":"File: /JVT038/files/Documents/Nextcloud flyer.pdf Imagick says:"},"id":"62684c2838b99"}

The delegates error:
{"reqId":"dXuf1ugFGhpc9Eqzqk6T","level":3,"time":"2022-04-26T19:34:13+00:00","remoteAddr":"xx.xx.xx.xxx","user":"JVT038","app":"core","method":"GET","url":"/core/preview?fileId=139124&c=93465a86a84498b74a77123920bd4e57&x=250&y=250&forceIcon=0&a=0","message":"File: /JVT038/files/Documents/pdffile.pdf Imagick says:","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0","version":"23.0.4.1","exception":{"Exception":"ImagickException","Message":"UnableToOpenConfigureFile `delegates.xml' @ warning/configure.c/GetConfigureOptions/681","Code":395,"Trace":[{"file":"/volume1/web/nextcloud/lib/private/Preview/Bitmap.php","line":86,"function":"readimage","class":"Imagick","type":"->","args":["/volume1/Streaming/Nextcloud/JVT038/files/Documents/pdffile.pdf[0]"]},{"file":"/volume1/web/nextcloud/lib/private/Preview/Bitmap.php","line":49,"function":"getResizedPreview","class":"OC\\Preview\\Bitmap","type":"->","args":["/volume1/Streaming/Nextcloud/JVT038/files/Documents/pdffile.pdf",4096,4096]},{"file":"/volume1/web/nextcloud/lib/private/Preview/GeneratorHelper.php","line":62,"function":"getThumbnail","class":"OC\\Preview\\Bitmap","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},4096,4096]},{"file":"/volume1/web/nextcloud/lib/private/Preview/Generator.php","line":245,"function":"getThumbnail","class":"OC\\Preview\\GeneratorHelper","type":"->","args":[{"__class__":"OC\\Preview\\PDF"},{"__class__":"OC\\Files\\Node\\File"},4096,4096]},{"file":"/volume1/web/nextcloud/lib/private/Preview/Generator.php","line":140,"function":"getMaxPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\SimpleFS\\SimpleFolder"},{"__class__":"OC\\Files\\Node\\File"},"application/pdf",""]},{"file":"/volume1/web/nextcloud/lib/private/Preview/Generator.php","line":109,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},[{"width":250,"height":250,"crop":true,"mode":"fill"}],"application/pdf"]},{"file":"/volume1/web/nextcloud/lib/private/PreviewManager.php","line":212,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,true,"fill",null]},{"file":"/volume1/web/nextcloud/core/Controller/PreviewController.php","line":169,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,true,"fill"]},{"file":"/volume1/web/nextcloud/core/Controller/PreviewController.php","line":142,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[{"__class__":"OC\\Files\\Node\\File"},250,250,false,false,"fill"]},{"file":"/volume1/web/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[139124,250,250,false,false,"fill"]},{"file":"/volume1/web/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/volume1/web/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Core\\Controller\\PreviewController"},"getPreviewByFileId"]},{"file":"/volume1/web/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\PreviewController","getPreviewByFileId",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"core.Preview.getPreviewByFileId"}]},{"file":"/volume1/web/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/core/preview"]},{"file":"/volume1/web/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/volume1/web/nextcloud/lib/private/Preview/Bitmap.php","Line":86,"CustomMessage":"File: /JVT038/files/Documents/pdffile.pdf Imagick says:"},"id":"62684c2839511"}

Additional info

I'm using Nextcloud on my Synology NAS (DS918+) and I've manually installed it by extracting a zip file into the web folder and to set up a virtual host in the web station app of Synology.
It uses Apache 2.4, and redis, apcu, imagemagick and everything required is enabled.

I access my Nextcloud instance through a reverse proxy, and for this I'm using the NGINX Proxy Manager. If it's necessary, I can supply the NGINX information as well.

@JVT038 JVT038 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 26, 2022
@szaimen
Copy link
Contributor

szaimen commented Apr 26, 2022

Thank you for taking the time to report a bug! 👍

As this seems to be a setup issue I would like to ask you to raise your question in the forums: https://help.nextcloud.com
If you wish support with setup issues from Nextcloud GmbH we offer this as part of the Nextcloud subscription. Learn more about this at https://nextcloud.com/enterprise/

@szaimen szaimen closed this as completed Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

2 participants