server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: File Version Restore is Not Working

Open alperozturk96 opened this issue 1 year ago • 4 comments

⚠️ This issue respects the following points: ⚠️

Bug description

When file shared with other users with full permissions initial version of file cannot restored.

Example

https://github.com/nextcloud/server/assets/67455295/72855892-d149-4582-97db-74c2fa0da19f

Steps to reproduce

  1. Share a file with multiple user that have full permission and try to restore initial version of file

Expected behavior

Initial version of file must be restored without any problem.

Installation method

None

Nextcloud Server version

28

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

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

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

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

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

alperozturk96 avatar Feb 01 '24 15:02 alperozturk96

Nothing in the logs? ALso, open the browser console and see what happens.

solracsf avatar Feb 01 '24 16:02 solracsf

I am experiencing this issue in 27.1.6. The only error in the log is below.

Restoring/Downloading any intermediate Version works as expected, this issue is only with the Initial Version.

I have also attached the browser console log. console-export-2024-2-1_12-2-51.txt

`[webdav] Error: Error: Call to a member function getEncryptedVersion() on bool at <>

  1. /var/www/html/apps/files_versions/lib/Versions/LegacyVersionsBackend.php line 177 OCA\Files_Versions\Storage::rollback("/myfile.ods", 1706804806, ["OC\User\User"])
  2. /var/www/html/apps/files_versions/lib/Versions/VersionManager.php line 103 OCA\Files_Versions\Versions\LegacyVersionsBackend->rollback(["OCA\Files_Ver ... "])
  3. /var/www/html/apps/files_versions/lib/Versions/VersionManager.php line 185 OCA\Files_Versions\Versions\VersionManager->OCA\Files_Versions\Versions{closure}("*** sensitive parameters replaced ***")
  4. /var/www/html/apps/files_versions/lib/Versions/VersionManager.php line 103 OCA\Files_Versions\Versions\VersionManager::handleAppLocks(["Closure"])
  5. /var/www/html/apps/files_versions/lib/Sabre/VersionFile.php line 118 OCA\Files_Versions\Versions\VersionManager->rollback(["OCA\Files_Ver ... "])
  6. /var/www/html/apps/files_versions/lib/Sabre/RestoreFolder.php line 76 OCA\Files_Versions\Sabre\VersionFile->rollBack()
  7. /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php line 160 OCA\Files_Versions\Sabre\RestoreFolder->moveInto("target", "versions/0jsg/versions/162/1706804806", ["OCA\Files_Ver ... "])
  8. /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 612 Sabre\DAV\Tree->move("versions/0jsg/versions/162/1706804806", "versions/0jsg/restore/target")
  9. /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89 Sabre\DAV\CorePlugin->httpMove(["Sabre\HTTP\Request"], ["Sabre\HTTP\Response"])
  10. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 472 Sabre\DAV\Server->emit("method:MOVE", [["Sabre\HTTP\ ... ]])
  11. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 253 Sabre\DAV\Server->invokeMethod(["Sabre\HTTP\Request"], ["Sabre\HTTP\Response"])
  12. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 321 Sabre\DAV\Server->start()
  13. /var/www/html/apps/dav/lib/Server.php line 365 Sabre\DAV\Server->exec()
  14. /var/www/html/apps/dav/appinfo/v2/remote.php line 35 OCA\DAV\Server->exec()
  15. /var/www/html/remote.php line 172 require_once("/var/www/html/a ... p")

MOVE /remote.php/dav/versions/0jsg/versions/162/1706804806 from 172.16.0.1 by 0jsg at 2024-02-01T16:34:14+00:00`

0jsg avatar Feb 01 '24 17:02 0jsg

Are you both using encryption?

solracsf avatar Feb 01 '24 22:02 solracsf

In my case, Administration > Security > Server-side encryption is turned off. I have attached the output of occ config:list. occ_config_list.txt

0jsg avatar Feb 02 '24 00:02 0jsg

Are you both using encryption?

Encryption is off.

From Log I saw this error.

Error Call to a member function getEncryptedVersion() on bool

Log

nextcloud_log.log

alperozturk96 avatar Feb 06 '24 10:02 alperozturk96

Hello, could you confirm that the issue is not with shared files, but files that are initially empty when created?

artonge avatar Feb 28 '24 14:02 artonge

This does appear to be the case in my testing.

0jsg avatar Mar 15 '24 20:03 0jsg