Skip to content

PHP Unlink and ImagickException #13416

@dabbill

Description

@dabbill

Steps to reproduce

  1. View logging under admin console

Expected behaviour

Not to see any errors

Actual behaviour

I have seeing lots of these errors with different image names.

[PHP] Error: unlink(/tmp/oc_tmp_YZ8APm-.png): No such file or directory at /srv/www/nextcloud/lib/private/Preview/Office.php#63

GET /core/preview?fileId=11550019&c=72f89b1176278571b6ed99452c521f4b&x=250&y=250&forceIcon=0
from 192.168.1.54 by dabbill at 2019-01-07T19:16:13+00:00

[core] Error: ImagickException: unable to open image `/tmp/oc_tmp_YZ8APm-.png': No such file or directory @ error/blob.c/OpenBlob/2761 at <>

  1. /srv/www/nextcloud/lib/private/Preview/Office.php line 59
    __construct("/tmp/oc_tmp_YZ8APm-.png[0]")
  2. /srv/www/nextcloud/lib/private/Preview/GeneratorHelper.php line 59
    getThumbnail("4-8 Expository Paper Checklist.docx", 4096, 4096, false, OC\Files\View {})
  3. /srv/www/nextcloud/lib/private/Preview/Generator.php line 194
    getThumbnail(OC\Preview\MSOffice2007 {}, OC\Files\Node\File {}, 4096, 4096)
  4. /srv/www/nextcloud/lib/private/Preview/Generator.php line 118
    getMaxPreview(OC\Files\SimpleFS\SimpleFolder {}, OC\Files\Node\File {}, "application/vnd ... t")
  5. /srv/www/nextcloud/lib/private/PreviewManager.php line 205
    getPreview(OC\Files\Node\File {}, 250, 250, true, "fill", "application/vnd ... t")
  6. /srv/www/nextcloud/core/Controller/PreviewController.php line 175
    getPreview(OC\Files\Node\File {}, 250, 250, true, "fill")
  7. /srv/www/nextcloud/core/Controller/PreviewController.php line 147
    fetchPreview(OC\Files\Node\File {}, 250, 250, false, false, "fill")
  8. /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 166
    getPreviewByFileId(11550019, 250, 250, false, false, "fill")
  9. /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 99
    executeController(OC\Core\Controller\PreviewController {}, "getPreviewByFileId")
  10. /srv/www/nextcloud/lib/private/AppFramework/App.php line 118
    dispatch(OC\Core\Controller\PreviewController {}, "getPreviewByFileId")
  11. /srv/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    main("OC\Core\Controller\PreviewController", "getPreviewByFileId", OC\AppFramework\ ... {}, {_route: "core.P ... "})
  12. <>
    __invoke({_route: "core.P ... "})
  13. /srv/www/nextcloud/lib/private/Route/Router.php line 297
    call_user_func(OC\AppFramework\ ... {}, {_route: "core.P ... "})
  14. /srv/www/nextcloud/lib/base.php line 987
    match("/core/preview")
  15. /srv/www/nextcloud/index.php line 42
    handleRequest()

GET /core/preview?fileId=11550019&c=72f89b1176278571b6ed99452c521f4b&x=250&y=250&forceIcon=0
from 192.168.1.54 by dabbill at 2019-01-07T19:16:13+00:00

Server configuration

Operating system:
Fedora release 28 (Twenty Eight)

Web server:
nginx-1.12.1-8.fc28.src.rpm

Database:
MariaDB 10.2

PHP version:
7.2.13

Nextcloud version: (see Nextcloud admin page)
15.0.1 RC1 (Same errors on 15.0)

Updated from an older Nextcloud/ownCloud or fresh install:
Updated from older version, tried fresh install of v15.0.

Where did you install Nextcloud from:
Main nextcloud website

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

Integrity checker has been disabled. Integrity cannot be verified.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
Enabled: - accessibility: 1.1.0 - activity: 2.8.2 - admin_audit: 1.5.0 - announcementcenter: 3.4.0 - apporder: 0.6.0 - bruteforcesettings: 1.3.0 - calendar: 1.6.4 - camerarawpreviews: 0.6.3 - cloud_federation_api: 0.1.0 - comments: 1.5.0 - contacts: 3.0.1 - dashboard: 6.0.0 - dav: 1.8.0 - drop_account: 0.0.13 - encryption: 2.3.0 - external: 3.2.0 - federatedfilesharing: 1.5.0 - federation: 1.5.0 - files: 1.10.0 - files_accesscontrol: 1.5.0 - files_automatedtagging: 1.5.0 - files_downloadactivity: 1.4.0 - files_external: 1.6.0 - files_fulltextsearch: 1.2.3 - files_markdown: 2.0.5 - files_pdfviewer: 1.4.0 - files_sharing: 1.7.0 - files_texteditor: 2.7.0 - files_trashbin: 1.5.0 - files_versions: 1.8.0 - files_videoplayer: 1.4.0 - firstrunwizard: 2.4.0 - fulltextsearch: 1.2.3 - gallery: 18.2.0 - groupfolders: 2.0.2 - logreader: 2.0.0 - lookup_server_connector: 1.3.0 - metadata: 0.8.0 - music: 0.9.3 - news: 13.0.3 - nextcloud_announcements: 1.4.0 - notes: 2.5.1 - notifications: 2.3.0 - oauth2: 1.3.0 - onlyoffice: 2.1.2 - ownbackup: 18.11.0 - password_policy: 1.5.0 - previewgenerator: 2.0.0 - provisioning_api: 1.5.0 - qownnotesapi: 18.11.0 - radio: 0.6.4 - rainloop: 6.0.2 - ransomware_protection: 1.3.0 - registration: 0.4.5 - serverinfo: 1.5.0 - sharebymail: 1.5.0 - social: 0.1.2 - spreed: 5.0.0 - support: 1.0.0 - survey_client: 1.3.0 - systemtags: 1.5.0 - tasks: 0.9.8 - telephoneprovider: 1.0.2 - theming: 1.6.0 - twofactor_backupcodes: 1.4.1 - updatenotification: 1.5.0 - workflowengine: 1.5.0 Disabled: - admin_notifications - bookmarks_fulltextsearch - caniupdate - checksum - drawio - files_clipboard - files_fulltextsearch_tesseract - files_rightclick - flowupload - nextant - ocdownloader - ocr - passman - socialsharing_facebook - templateeditor - user_external - user_ldap - user_saml - weather - workin2gether

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)
{ "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "15.0.1.0", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "logtimezone": "UTC", "appcodechecker": false, "updatechecker": false, "installed": true, "filesystem_check_changes": "1", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_domain": "***REMOVED SENSITIVE VALUE***", "enable_avatars": true, "allow_user_to_change_display_name": true, "has_internet_connection": true, "check_for_working_htaccess": true, "enable_previews": true, "preview_libreoffice_path": "\/bin\/libreoffice", "filelocking.enabled": 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\\MSOffice2003", "OC\\Preview\\MSOffice2007", "OC\\Preview\\MSOfficeDoc", "OC\\Preview\\OpenDocument", "OC\\Preview\\PDF", "OC\\Preview\\CR2", "OC\\Preview\\TIFF", "OC\\Preview\\RAW", "OC\\Preview\\SVG" ], "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "mail_smtpsecure": "ssl", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "loglevel": 0, "debug": false, "trashbin_retention_obligation": "auto", "theme": "", "maintenance": false, "updater.release.channel": "beta", "memcache.local": "\\OC\\Memcache\\APCu", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 6379 }, "integrity.check.disabled": true, "overwrite.cli.url": "https:\/\/nextcloud.dabbill.com", "mysql.utf8mb4": true, "mail_sendmailmode": "smtp" } }

Are you using external storage, if yes which one: local/smb/sftp/...
SFTP

Are you using encryption: yes/no
No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions