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

PDF file not created #106

Open
Frigbog opened this issue Apr 26, 2020 · 6 comments
Open

PDF file not created #106

Frigbog opened this issue Apr 26, 2020 · 6 comments

Comments

@Frigbog
Copy link

Frigbog commented Apr 26, 2020

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)

@blizzz
Copy link
Member

blizzz commented Apr 30, 2020

Why /var/www/nextcloud/tmp, this looks very unusual?

@Frigbog
Copy link
Author

Frigbog commented May 5, 2020

I don't see why that should matter provided the Apache user has sufficient permissions of that folder?
Anyway, this path was the result of some testing. Originally the Nextcloud tempdir was placed on nfs storage (/nfsdir/tmp) and I was just testing to see whether the nfs connection was the cause and it wasn't since it also didn't work on local storage.
PHP is also configured to store temp files on nfs (/nfsdir/upload)
The only reason for the error I can think of is that the pfd file actually is not created. Can this be traced?

@blizzz
Copy link
Member

blizzz commented May 6, 2020

In modern systemd-based distributions, /tmp is jailed in /tmp/systemd-private-7494c9c8c3fb4ab4vaa248b04267ec377-httpd.service-Q9VuQi/

That makes a huge difference if one process is within the service with the jailed temp, and the other goes not (cron). /dev/shm can be taken as alternative.

@Frigbog
Copy link
Author

Frigbog commented May 8, 2020

Nextcloud is not configured to use /tmp for temporary storage. It uses an nfs mount point (/nfsdir/tmp) which works well. I see Nextcloud using it all the time, i.e. when previews are being generated the directory is used for temporary storing .png files. When I upload an Office document into Nextcloud not a single file is put there, so it seems the error is correct. I see LibreOffice being used for generating the preview file but not for the pdf document. Why is that? How can this be troubleshooted?

@Frigbog
Copy link
Author

Frigbog commented Jun 5, 2020

Apparently I'm not the only one with the problem that this app doesn't work. Upgrading to version 1.3.2 did not solve the problem. It's been over a month since there was any response at all. Is this issue considered valid or should I just uninstall the app?

@Nils160988
Copy link

Is this still valid?

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

No branches or pull requests

3 participants