nextcloud / nextcloud/workflow_pdf_converter

PDF file not created

Open
#106 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs info
Dominant language
JavaScript
Stars
26
Forks
8
Avg merge
10h 30m
Merged PRs (30d)
31

Description

My system fails to generate a PDF file when uploading an Office document.

Steps to reproduce

  1. Add and enable Automated PDF conversion app
  2. In Nextcloud, add flow (Add File and Mimetype equals Office Documents =>
    PDF conversion = keep original, keep existing PDF's)
  3. Upload a .docx file
Expected behaviour

A PDF file is created and two files exist (document.docx and document.pdf)

Actual behaviour

A PDF file is not created.

Error message in nextcloud.log:
{"reqId":"ySR0SbbTnS3J44Slpjql","level":3,"time":"2020-04-24T14:00:00+01:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"/cron.php","message":"fopen(/var/www/nextcloud/tmp/oc_tmp_yiz0a1-.pdf): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/View.php#1042","userAgent":"--","version":"18.0.4.2"}

File /var/www/nextcloud/tmp/oc_tmp_yiz0a1-.pdf does not exist
File /var/www/nextcloud/tmp/oc_tmp_yiz0a1-.png exists. Preview works.

PDF Converter app

PDF Converter app version: 1.3.1

Server configuration

Operating system: Debian 10.3

Web server: Apache/2.4.38 (Debian)

Database: MariaDB 10.4.12

PHP version: PHP 7.4.5

Nextcloud Version: Nextcloud 18.0.4

**Where did you install Nextcloud from: Downloaded server package from Nextcloud

Signing status:
md5sum --c nextcloud-18.0.4.tar.bz2.md5
nextcloud-18.0.4.tar.bz2: OK

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

No errors have been found.

List of activated apps:

``` If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your server installation folder Enabled: - accessibility: 1.4.0 - activity: 2.11.0 - admin_audit: 1.8.0 - apporder: 0.9.0 - bookmarks: 2.3.4 - bruteforcesettings: 1.6.0 - calendar: 2.0.3 - cloud_federation_api: 1.1.0 - comments: 1.8.0 - contacts: 3.3.0 - dav: 1.14.0 - documentserver_community: 0.1.5 - drawio: 0.9.5 - federatedfilesharing: 1.8.0 - federation: 1.8.0 - files: 1.13.1 - files_antivirus: 2.3.0 - files_downloadactivity: 1.7.0 - files_pdfviewer: 1.7.0 - files_rightclick: 0.15.2 - files_sharing: 1.10.1 - files_trashbin: 1.8.0 - files_versions: 1.11.0 - files_videoplayer: 1.7.0 - firstrunwizard: 2.7.0 - impersonate: 1.5.0 - logreader: 2.3.0 - lookup_server_connector: 1.6.0 - mail: 1.3.3 - nextbackup: 20.4.0 - nextcloud_announcements: 1.7.0 - notifications: 2.6.0 - oauth2: 1.6.0 - onlyoffice: 4.1.4 - password_policy: 1.8.0 - photos: 1.0.0 - previewgenerator: 2.3.0 - privacy: 1.2.0 - provisioning_api: 1.8.0 - recommendations: 0.6.0 - serverinfo: 1.8.0 - settings: 1.0.0 - sharebymail: 1.8.0 - support: 1.1.0 - survey_client: 1.6.0 - systemtags: 1.8.0 - tasks: 0.12.1 - text: 2.0.0 - theming: 1.9.0 - twofactor_backupcodes: 1.7.0 - unsplash: 1.1.5 - updatenotification: 1.8.0 - user_ldap: 1.8.0 - viewer: 1.2.0 - workflow_pdf_converter: 1.3.1 - workflowengine: 2.0.0 ```

Nextcloud configuration:

``` 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
"system": {
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "***REMOVED SENSITIVE VALUE***",
       "***REMOVED SENSITIVE VALUE***"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "18.0.4.2",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "3306",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "defaultapp": "files",
    "knowledgebaseenabled": true,
    "allow_user_to_change_display_name": true,
    "remember_login_cookie_lifetime": 1296000,
    "session_lifetime": 86400,
    "session_keepalive": true,
    "token_auth_enforced": false,
    "auth.bruteforce.protection.enabled": true,
    "skeletondirectory": "",
    "activity_expire_days": 365,
    "overwritehost": "",
    "overwriteprotocol": "https",
    "overwritewebroot": "\/",
    "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
    "htaccess.RewriteBase": "\/",
    "trashbin_retention_obligation": "auto, 180",
    "versions_retention_obligation": "auto, 365",
    "appcodechecker": true,
    "updatechecker": true,
    "updater.server.url": "https:\/\/updates.nextcloud.com\/updater_server\/",
    "updater.release.channel": "stable",
    "has_internet_connection": true,
    "check_for_working_wellknown_setup": true,
    "check_for_working_htaccess": true,
    "check_data_directory_permissions": true,
    "config_is_read_only": false,
    "log_type": "file",
    "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
    "logfilemode": 416,
    "loglevel": 2,
    "logdateformat": "Y-m-d\\TH:i:sP",
    "logtimezone": "***REMOVED SENSITIVE VALUE***",
    "log_query": false,
    "log_rotate_size": 104857600,
    "appstoreenabled": true,
    "apps_paths": [
        {
            "path": "\/var\/www\/nextcloud\/apps",
            "url": "\/apps",
            "writable": true
        }
    ],
    "enable_previews": true,
    "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
    "preview_office_cl_parameters": " --headless --nologo --nofirststartwizard --invisible --norestore --convert-to png --outdir ",
    "enabledPreviewProviders": [
        "OC\\Preview\\BMP",
        "OC\\Preview\\GIF",
        "OC\\Preview\\HEIC",
        "OC\\Preview\\JPEG",
        "OC\\Preview\\MarkDown",
        "OC\\Preview\\MP3",
        "OC\\Preview\\PNG",
        "OC\\Preview\\TXT",
        "OC\\Preview\\XBitmap",
        "OC\\Preview\\Illustrator",
        "OC\\Preview\\Movie",
        "OC\\Preview\\MSOffice2003",
        "OC\\Preview\\MSOffice2007",
        "OC\\Preview\\MSOfficeDoc",
        "OC\\Preview\\OpenDocument",
        "OC\\Preview\\PDF",
        "OC\\Preview\\Photoshop",
        "OC\\Preview\\Postscript",
        "OC\\Preview\\StarOffice",
        "OC\\Preview\\SVG",
        "OC\\Preview\\TIFF",
        "OC\\Preview\\Font"
    ],
    "ldapUserCleanupInterval": 360,
    "sort_groups_by_name": false,
    "ldapIgnoreNamingRules": false,
    "maintenance": false,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "memcache.distributed": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379,
        "timeout": 0,
        "password": "***REMOVED SENSITIVE VALUE***",
        "dbindex": 1
    },
    "cache_chunk_gc_ttl": 86400,
    "tempdirectory": "\/nextcloud\/tmp",
    "share_folder": "\/",
    "theme": "",
    "cipher": "AES-256-CFB",
    "filesystem_check_changes": 1,
    "part_file_in_storage": true,
    "mount_file": "\/nextcloud\/data\/mount.json",
    "filesystem_cache_readonly": false,
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "forwarded_for_headers": [
        "HTTP_X_FORWARDED_FOR"
    ],
    "max_filesize_animated_gifs_public_sharing": 10,
    "filelocking.enabled": true,
    "filelocking.ttl": 3600,
    "filelocking.debug": false,
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "upgrade.disable-web": false,
    "debug": false,
    "data-fingerprint": "",
    "simpleSignUpLink.shown": false,
    "login_form_autocomplete": false,
    "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory"
}

Are you using external storage, if yes which one: nfs

Are you using encryption: no

Server log (data/nextcloud.log)
``` {"reqId":"ySR0SbbTnS3J44Slpjql","level":3,"time":"2020-04-24T14:00:00+01:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"/cron.php","message":"fopen(/var/www/nextcloud/tmp/oc_tmp_yiz0a1-.pdf): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/View.php#1042","userAgent":"--","version":"18.0.4.2"} ```

Libreoffice is installed:
dpkg-query -l | grep -i libreoffice

ii libreoffice 1:6.1.5-3+deb10u5 amd64 office productivity suite (metapackage)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the flow with a .docx upload and inspect the cron.php path around the reported failure in lib/private/Files/View.php#1042. Compare the PDF conversion app's handling of the missing oc_tmp_*.pdf with the existing preview output. Done means the workflow creates both the original document and a PDF without the logged fopen error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.