Viewing file history does not work in nextcloud

Could not view file history in editor. When selection a file version from history Onlyoffice says “Download failed” and request to document server (https://ooffice.test/7.3.3-49/downloadfile/2105255733 ends with 500 Internal Server Error.

There is nothing in documentserver logs.

Nextcloud log shows:
{“reqId”:“CHkKPmrddr0UxRMRRZ4V”,“level”:3,“time”:“2023-06-08T12:09:45+00:00”,“remoteAddr”:“192.168.??.??”,“user”:“test”,“app”:“index”,“method”:“GET”,“url”:"/nextcloud/index.php/apps/onlyoffice/download?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJkb3dubG9hZCIsImZpbGVJZCI6MjY1NDY3LCJ1c2VySWQiOiJtYXkiLCJ2ZXJzaW9uIjozLCJjaGFuZ2VzIjp0cnVlfQ.y6CHjCpiItSG5G6kD82ROJBlEt7e2093siccxm3wxSs",“message”:“The view passed to the node should not have any fake root set”,“userAgent”:“Node.js/6.13”,“version”:“25.0.7.1”,“exception”:{“Exception”:“OCP\PreConditionNotMetException”,“Message”:“The view passed to the node should not have any fake root set”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/apps/onlyoffice/lib/fileversions.php",“line”:233,“function”:"__construct",“class”:“OC\Files\Node\Node”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/onlyoffice/controller/callbackcontroller.php",“line”:304,“function”:“getChangesFile”,“class”:“OCA\Onlyoffice\FileVersions”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:225,“function”:“download”,“class”:“OCA\Onlyoffice\Controller\CallbackController”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:133,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/AppFramework/App.php",“line”:172,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->"},{“file”:"/var/www/nextcloud/lib/private/Route/Router.php",“line”:298,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::"},{“file”:"/var/www/nextcloud/lib/base.php",“line”:1048,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->"},{“file”:"/var/www/nextcloud/index.php",“line”:36,“function”:“handleRequest”,“class”:“OC”,“type”:"::"}],“File”:"/var/www/nextcloud/lib/private/Files/Node/Node.php",“Line”:78,“CustomMessage”:"–"}}

Document Server version: 7.3.3.49
Connector version: 7.8.0
DMS (platform) version: 25.0.7
OS: Linux
Browser version: Firefox
Attach logs if possible.

Yeah, same here.

After debugging found out this commit related to this issue

What you need to do:
Log-in to nextcloud server, edit /var/www/nextcloud/lib/private/Files/Node/Node.php (you need to adjust path accordingly to your installation):

public function __construct($root, $view, $path, $fileInfo = null, ?Node $parent = null) {
            if (Filesystem::normalizePath($view->getRoot()) !== '/') {
                        throw new PreConditionNotMetException('The view passed to the node should not have any fake root set');
                }
                $this->view = $view;
                $this->root = $root;
                $this->path = $path;
                $this->fileInfo = $fileInfo;
                $this->parent = $parent;
        }

Comment out

public function __construct($root, $view, $path, $fileInfo = null, ?Node $parent = null) {
        /*      if (Filesystem::normalizePath($view->getRoot()) !== '/') {
                        throw new PreConditionNotMetException('The view passed to the node should not have any fake root set');
                }*/
                $this->view = $view;
                $this->root = $root;
                $this->path = $path;
                $this->fileInfo = $fileInfo;
                $this->parent = $parent;
        }

After saving file all is working again.

Thank you, thascalos. It works.