nextcloud / documentserver_community

Document server for onlyoffice
https://apps.nextcloud.com/apps/documentserver_community
133 stars 29 forks source link

[Bug]: Exception: Im Dokumentenservice ist ein Fehler aufgetreten: Error while downloading the document file to be converted. #289

Open chrissi55 opened 1 year ago

chrissi55 commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

Steps to reproduce:

Nextcloud Server 25.0.x (Error exist since Update from 24.0.x to 25.0.x) PHP 8.1 PostgreSQL 15.1 ubuntu server 22.04.1 (as VM under vSphere 7)

My system integrated external storage via NFS Share as "local". (on a fileserver a nfs-server delivers space to nextcloud, that is mounted as nfs share to a local folder on the nextcloud server and offers this share as "local" external storage to NC Server)

Everytime i upload a PDF file to an external storage i get 4 errors in seconds

3 times Fatal onlyoffice Download without access right followed by 1 time Error onlyoffice Exception: Im Dokumentenservice ist ein Fehler aufgetreten: Error while downloading the document file to be converted.

My ONLYOFFICE Server is running as docker image on the same server, that hosts my NC Server. ONLYOFFICE is reachable under port 443 mapped to 8443 Settings for onlyoffice in NC Admin pages delivers a "green" feedback when saving my settings. pdf files are not tagged as supported filetype in onlyoffice settings!

The behaviour is reproducable. It concerned every allowed user and groupmember in my little cloud instance. (not more than 35 users at the moment)

ONLYOFFICE itself seems to work without failures. Users can create, edit office files. Users can check the status of the onlyoffice server by https://domain.onlyoffice.net

Steps to reproduce

  1. see above

Expected behavior

Uploading pdf files to an external space / storage mounted (local, via smb ) should not cause onlyoffice to produce fatals or errors.

Installation method

Other Community project

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Nginx

Database engine version

PostgreSQL

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

Updated from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.55.16",
            "mycloud.domain.net",
            "myoffice.domain.net"
        ],
        "activity_expire_days": 14,
        "auth.bruteforce.protection.enabled": true,
        "blacklisted_files": [
            ".htaccess",
            "Thumbs.db",
            "thumbs.db"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "overwritehost": "mycloud.domain.net",
        "overwriteconaddr": "^192\\.168\\.55\\.90$",
        "overwriteprotocol": "https",
        "forward_for_headers": [
            "X_FORWARDED_FOR",
            "HTTP_X_FORWARDED_FOR"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/mycloud.domain.net",
        "dbtype": "pgsql",
        "version": "25.0.3.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "logtimezone": "Europe\/Berlin",
        "default_phone_region": "DE",
        "logfile": "\/media\/cloud\/data\/nextcloud.log",
        "log_rotate_size": 10485760,
        "cron_log": true,
        "installed": true,
        "filesystem_check_changes": 0,
        "quota_include_external_storage": false,
        "skeletondirectory": "",
        "share_folder": "\/Freigaben",
        "knowledgebaseenabled": false,
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "ldapUserCleanupInterval": 20,
        "bulkupload.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "dbindex": 0,
            "timeout": 1.5
        },
        "mail_smtpmode": "sendmail",
        "mail_smtpsecure": "ssl",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "maintenance": false,
        "integrity.check.disabled": false,
        "updater.release.channel": "stable",
        "enable_previews": true,
        "preview_Movie_path": "\/usr\/bin\/ffmpeg",
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\MSOffice2003",
            "OC\\Preview\\MSOfficeDoc",
            "OC\\Preview\\Image",
            "OC\\Preview\\Photoshop",
            "OC\\Preview\\SVG",
            "OC\\Preview\\Font",
            "OC\\Preview\\MKV",
            "OC\\Preview\\MP4",
            "OC\\Preview\\AVI"
        ],
        "preview_max_x": 1024,
        "preview_max_y": 768,
        "preview_max_scale_factor": 1,
        "trashbin_retention_obligation": "auto, 2",
        "loglevel": 3,
        "mail_sendmailmode": "smtp",
        "data-fingerprint": "db31f3894c4bbacbe53f95d3e3b01d86",
        "onlyoffice": {
            "verify_peer_off": true,
            "jwt_header": "AuthorizationJwt",
            "jwt_secret": "PASS"
        },
        "encryption.legacy_format_support": false,
        "encryption.key_storage_migrated": false,
        "defaultapp": "dashboard",
        "theme": "",
        "allow_local_remote_servers": true,
        "files_external_allow_create_new_local": false
    }
}

List of activated Apps

Enabled:
  - activity: 2.17.0
  - admin_audit: 1.15.0
  - bruteforcesettings: 2.5.0
  - calendar: 4.2.1
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contacts: 5.0.2
  - contactsinteraction: 1.6.0
  - dashboard: 7.5.0
  - dav: 1.24.0
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.1
  - files_accesscontrol: 1.15.1
  - files_automatedtagging: 1.15.0
  - files_downloadactivity: 1.15.0
  - files_external: 1.17.0
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_versions: 1.18.0
  - gpxpod: 5.0.4
  - groupfolders: 13.1.0
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - nextcloud_announcements: 1.14.0
  - notes: 4.6.0
  - notifications: 2.13.1
  - notify_push: 0.5.0
  - oauth2: 1.13.0
  - onlyoffice: 7.6.8
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - related_resources: 1.0.4
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - support: 1.8.0
  - suspicious_login: 4.3.0
  - systemtags: 1.15.0
  - tasks: 0.14.5
  - text: 3.6.0
  - theming: 2.0.1
  - theming_customcss: 1.12.0
  - twofactor_backupcodes: 1.14.0
  - twofactor_totp: 7.0.0
  - updatenotification: 1.15.0
  - user_ldap: 1.15.0
  - user_status: 1.5.0
  - viewer: 1.9.0
  - weather_status: 1.5.0
  - workflowengine: 2.7.0
Disabled:
  - encryption: 2.3.0
  - files_trashbin: 1.14.0
  - firstrunwizard: 2.3.0
  - recommendations: 1.3.0
  - survey_client: 1.2.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Fehler  onlyoffice  Exception: Im Dokumentenservice ist ein Fehler aufgetreten: Error while downloading the document file to be converted.      vor 19 Minuten
Fatal   onlyoffice  Download without access right       vor 19 Minuten
Fatal   onlyoffice  Download without access right       vor 19 Minuten
Fatal   onlyoffice  Download without access right       vor 19 Minuten
Fehler  onlyoffice  Exception: Im Dokumentenservice ist ein Fehler aufgetreten: Error while downloading the document file to be converted.      vor 23 Minuten
Fatal   onlyoffice  Download without access right       vor 23 Minuten
Fatal   onlyoffice  Download without access right       vor 23 Minuten
Fatal   onlyoffice  Download without access right       vor 23 Minuten
Fehler  PHP Error: exif_read_data(): File not supported at /var/www/nextcloud/lib/private/Metadata/Provider/ExifProvider.php#59     vor einer Stunde
Fehler  onlyoffice  Exception: Im Dokumentenservice ist ein Fehler aufgetreten: Error while downloading the document file to be converted.      vor einer Stunde
Fatal   onlyoffice  Download without access right       vor einer Stunde
Fatal   onlyoffice  Download without access right       vor einer Stunde
Fatal   onlyoffice  Download without access right       vor einer Stunde
Fehler  PHP Error: exif_read_data(): File not supported at /var/www/nextcloud/lib/private/Metadata/Provider/ExifProvider.php#59     vor einem Tag

I uploaded pdf files to groupfolders -> without causing the errors / fatals I uploaded to my nextcloud space (internal storage) -> without causing the errors / fatals I uploaded to any external storage (in my case mounted storage as NFS share from fileserver) -> errors /fatals occur

In every storage saving / uploading / editing office files (saving / uploading pdf files) is possible without obviously errors for the clients.

Additional info

Uploading a pdf file via webdav (under linux i have used double commander to copy from local to remote dir) does not affect the error log! First time i open the uploaded file with the browser (webui of nextcloud) i see the error log filling with errors and fatals. There are no errors / restrictions on client side(!) - clients can open those pdf files correctly. But the server side logs errors / fatals every first time of opening the file after upload. Why this concerned "onlyoffice" - don't know?!

I haven't tested it yet, but i suppose that it will be the same behaviour when uploading a pdf via nfs / samba first and later opening the file via WebUI in a browser.

chrissi55 commented 1 year ago

The error log in NC is as follows:

[onlyoffice] Fehler: Exception: Im Dokumentenservice ist ein Fehler aufgetreten: Error while downloading the document file to be converted. at <<closure>>

 0. /var/www/nextcloud/apps/onlyoffice/lib/documentservice.php line 95
    OCA\Onlyoffice\DocumentService->ProcessConvServResponceError()
 1. /var/www/nextcloud/apps/onlyoffice/lib/preview.php line 269
    OCA\Onlyoffice\DocumentService->GetConvertedUri()
 2. /var/www/nextcloud/lib/private/Preview/ProviderV1Adapter.php line 53
    OCA\Onlyoffice\Preview->getThumbnail()
 3. /var/www/nextcloud/lib/private/Preview/GeneratorHelper.php line 65
    OC\Preview\ProviderV1Adapter->getThumbnail()
 4. /var/www/nextcloud/lib/private/Preview/Generator.php line 343
    OC\Preview\GeneratorHelper->getThumbnail()
 5. /var/www/nextcloud/lib/private/Preview/Generator.php line 162
    OC\Preview\Generator->getMaxPreview()
 6. /var/www/nextcloud/lib/private/Preview/Generator.php line 114
    OC\Preview\Generator->generatePreviews()
 7. /var/www/nextcloud/lib/private/PreviewManager.php line 185
    OC\Preview\Generator->getPreview()
 8. /var/www/nextcloud/core/Controller/PreviewController.php line 144
    OC\PreviewManager->getPreview()
 9. /var/www/nextcloud/core/Controller/PreviewController.php line 113
    OC\Core\Controller\PreviewController->fetchPreview()
10. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OC\Core\Controller\PreviewController->getPreviewByFileId()
11. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
12. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
13. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
14. /var/www/nextcloud/lib/base.php line 1047
    OC\Route\Router->match()
15. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

GET /core/preview?fileId=6666619&c=a9c0574a4acdaf999665169dab9c8499&x=250&y=250&forceIcon=0&a=0
from CLIENT-IP by username at 2023-01-19T08:32:26+01:00

The fatals deliver the following details:

[onlyoffice] Fatal: Download without access right

GET /apps/onlyoffice/download?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJkb3dubG9hZCIsImZpbGVJZCI6NjY2NjYxOSwidXNlcklkIjoiY2hyaXN0aWFuIn0.wYK2bQQofIEAg5Qihcv1epz9KgU4O0aR-4pUv4Uri2M
from 172.17.0.2 by username at 2023-01-19T08:32:24+01:00
webdesign7 commented 9 months ago

I got same problem ..