server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: OnlyOffice Documentserver causes Nextcloud to Crash (500 Internal Server Error)

Open manumeter opened this issue 3 years ago • 4 comments

⚠️ This issue respects the following points: ⚠️

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

Bug description

Nextcloud crashes with an internal server error (see logs) when the (external) OnlyOffice Documentserver tries to write back a file that was modified. This only happens in the scenario described in "Steps to reproduce".

Steps to reproduce

  1. Create a group folder and give user A write access to it. Make sure user B has no access.
  2. User A shares a folder inside that group folder with user B (write access).
  3. User B edits a document inside the shared folder with OnlyOffice.
  4. The changes will never be written back to the file in Nextcloud.

Expected behavior

OnlyOffice should be able to write the file, as user B clearly has write access. (User B is able to write the file, but not with OnlyOffice.)

Installation method

Manual installation

Operating system

RHEL/CentOS

PHP engine version

PHP 7.4

Web server

Apache (supported)

Database engine version

MariaDB

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?

  • [ ] Default user-backend (database)
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [X] Other

Configuration report

{
    "system": {
        "dbtype": "mysql",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cloud.inf.ethz.ch",
        "htaccess.RewriteBase": "\/",
        "trusted_domains": [
            "cloud.inf.ethz.ch",
            "nextcloud.inf.ethz.ch",
            "idvm-infk-isg61.inf.ethz.ch"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "filelocking.enabled": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0
        },
        "lost_password_link": "https:\/\/passwort.ethz.ch\/",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "version": "24.0.2.1",
        "mysql.utf8mb4": true,
        "installed": true,
        "maintenance": false,
        "mail_smtpmode": "sendmail",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "skeletondirectory": "",
        "default_locale": "de_CH",
        "user_dinfk.ldap_user": "cn=inf_main_proxy,ou=admins,ou=inf,ou=auth,o=ethz,c=ch",
        "user_dinfk.ldap_password": "***REMOVED SENSITIVE VALUE***",
        "user_dinfk.ldap_quota_field": "nextcloud_quota",
        "user_dinfk.default_quota": 10,
        "user_dinfk.local_users": [
            "root"
        ],
        "theme": "",
        "loglevel": 2,
        "user_dinfk.cache_ttl": 900,
        "user_dinfk.expire_shares_on_disable": 3,
        "user_dinfk.delete_after_disabled": 120,
        "updater.release.channel": "stable",
        "app_install_overwrite": [
            "keeweb",
            "groupfolders",
            "spreed",
            "twofactor_u2f"
        ],
        "default_phone_region": "CH"
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - announcementcenter: 6.3.1
  - apporder: 0.15.0
  - audioplayer: 3.3.0
  - bruteforcesettings: 2.4.0
  - calendar: 3.4.0
  - circles: 24.0.0
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contacts: 4.1.1
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - deck: 1.7.1
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_pdfviewer: 2.5.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - firstrunwizard: 2.13.0
  - groupfolders: 12.0.0
  - impersonate: 1.11.0
  - keeweb: 0.6.9
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - music: 1.5.2
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.0
  - oauth2: 1.12.0
  - onlyoffice: 7.5.2
  - password_policy: 1.14.0
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - quota_warning: 1.14.0
  - recommendations: 1.3.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - spreed: 14.0.2
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - tasks: 0.14.4
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - twofactor_totp: 6.4.0
  - twofactor_u2f: 6.3.1
  - updatenotification: 1.14.0
  - user_dinfk: 0.5
  - user_status: 1.4.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - admin_audit
  - documentserver_community: 0.1.12
  - encryption
  - files_external
  - files_mindmap: 0.0.26
  - officeonline: 1.1.3
  - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

[index] Error: Exception: Call to a member function getId() on bool in file '/var/www/nextcloud/apps/files_versions/lib/Storage.php' line 197 at <<closure>>

0. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch()
1. /var/www/nextcloud/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main()
2. /var/www/nextcloud/lib/base.php line 1023
   OC\Route\Router->match()
3. /var/www/nextcloud/index.php line 36
   OC::handleRequest()

POST /apps/onlyoffice/track?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOiJtYW1hbnVlbCIsIm93bmVySWQiOiJiYXVtYW5tbyIsImZpbGVJZCI6Mjg2NTU5MSwiZmlsZVBhdGgiOiJcL3dyaXRhYmxlIGZvciBtYW51ZWxcL3Rlc3QyLmRvY3giLCJzaGFyZVRva2VuIjpudWxsLCJhY3Rpb24iOiJ0cmFjayJ9.lr7l3t4Aq59s-tMvDxsJSJf3a04AUYlNceum8EC3VMY
from 129.132.216.40 by mamanuel at 2022-06-22T08:45:26+00:00

Additional info

No response

manumeter avatar Jun 22 '22 09:06 manumeter

Here a bit more complete stack trace:

Exception: Call to a member function getId() on bool in file '/var/www/nextcloud/apps/files_versions/lib/Storage.php' line 197

    /var/www/nextcloud/lib/private/AppFramework/App.php - line 172:
    OC\AppFramework\Http\Dispatcher->dispatch()
    /var/www/nextcloud/lib/private/Route/Router.php - line 298:
    OC\AppFramework\App::main()
    /var/www/nextcloud/lib/base.php - line 1023:
    OC\Route\Router->match()
    /var/www/nextcloud/index.php - line 36:
    OC::handleRequest()

Caused by Error: Call to a member function getId() on bool

    /var/www/nextcloud/apps/files_versions/lib/Hooks.php - line 56:
    OCA\Files_Versions\Storage::store()
    /var/www/nextcloud/lib/private/legacy/OC_Hook.php - line 106:
    OCA\Files_Versions\Hooks::write_hook()
    /var/www/nextcloud/lib/private/Files/View.php - line 1290:
    OC_Hook::emit()
    /var/www/nextcloud/lib/private/Files/View.php - line 1160:
    OC\Files\View->runHooks()
    /var/www/nextcloud/lib/private/Files/View.php - line 711:
    OC\Files\View->basicOperation()
    /var/www/nextcloud/lib/private/Files/Node/File.php - line 71:
    OC\Files\View->file_put_contents()
    /var/www/nextcloud/apps/onlyoffice/controller/callbackcontroller.php - line 543:
    OC\Files\Node\File->putContent()
    /var/www/nextcloud/apps/onlyoffice/controller/callbackcontroller.php - line 771:
    OCA\Onlyoffice\Controller\CallbackController->OCA\Onlyoffice\Controller\{closure}("*** sensiti ... *")
    /var/www/nextcloud/apps/onlyoffice/controller/callbackcontroller.php - line 544:
    OCA\Onlyoffice\Controller\CallbackController->retryOperation()
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 225:
    OCA\Onlyoffice\Controller\CallbackController->track()
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 133:
    OC\AppFramework\Http\Dispatcher->executeController()
    /var/www/nextcloud/lib/private/AppFramework/App.php - line 172:
    OC\AppFramework\Http\Dispatcher->dispatch()
    /var/www/nextcloud/lib/private/Route/Router.php - line 298:
    OC\AppFramework\App::main()
    /var/www/nextcloud/lib/base.php - line 1023:
    OC\Route\Router->match()
    /var/www/nextcloud/index.php - line 36:
    OC::handleRequest()

manumeter avatar Jun 22 '22 10:06 manumeter

Hi I have the same issue on my server. Nextcloud 23.0.6 groupfolders: 11.1.5 onlyoffice: 7.4.2

It happened after the upgrade of my instance and the two apps. I have tried to revert to the previous version of apps with no changes.

tarradmac avatar Jun 29 '22 15:06 tarradmac

Hi there,

in our case - the Versions App (version 1.17.0) was the culprit. After disabling the app, it works as normal again. Nextcloud version 24.0.2 Versions App - 1.17.0

luethbas avatar Jul 21 '22 08:07 luethbas

Hi, has an update been released for the issue?

ermanseneren avatar Aug 04 '22 09:08 ermanseneren

Hi,

any update or ETA on the versions app causing issues?

luethbas avatar Sep 09 '22 10:09 luethbas

Hi, please report thos to https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues

szaimen avatar Sep 09 '22 10:09 szaimen