Skip to content

[Bug]: Original file version of Word .docx file corrupt after restoring it from file version history; file versions disappear #49125

Open
@hitWebLux

Description

⚠️ This issue respects the following points: ⚠️

Bug description

When the original version of a .docx file is restored from version history, downloaded and opened in MS Word, there is an error about the file being corrupted. It can then be restored easily in MS Word.

Further Investigation:

I created a few additional versions of the original file by slightly modifying the content and uploading it using the same name an location again. I randomly restored different versions, downloaded them and compared their hashes.

Observations:

  • When restoring the original file the first and second time, it has a different hash than the original file
  • When restoring the original file the third time, it has its original hash again. For this file, MS Word also doesn't complain anymore
  • When restoring different versions and downloading them, sometimes MS Edge reports that these files cannot be downloaded. They are however stored in my "Downloads" folder with a .crdownload file extension AND have their expected file hashes.
Get-FileHash * | sort -Property Path

Algorithm Hash                                                              Path
--------- ----                                                              ----
SHA256    7A0325585A963A3CE9DFA400EB99E3E917AEF05B0FDE27CA23E3E67520F2245A  .\original.docx
SHA256    DFDCF4C6B9DF4A2970221B82A74E7B90CDA7503F6E21781E83A38B85E9494F2B  .\originalRestored.docx
SHA256    DFDCF4C6B9DF4A2970221B82A74E7B90CDA7503F6E21781E83A38B85E9494F2B  .\originalRestoredAgain.docx
SHA256    7A0325585A963A3CE9DFA400EB99E3E917AEF05B0FDE27CA23E3E67520F2245A  .\originalRestoredAgainAgain.docx
																		    
SHA256    084FF1136744E5C87AD79B505099168DF9C63CF2D5DF250EE1C4E49709086A16  .\v1.docx
SHA256    084FF1136744E5C87AD79B505099168DF9C63CF2D5DF250EE1C4E49709086A16  .\v1Restored.crdownload
SHA256    084FF1136744E5C87AD79B505099168DF9C63CF2D5DF250EE1C4E49709086A16  .\v1Restored.docx
																		    
SHA256    6BF6829680E47037CD1C3A33C3CCBD54751A92874EC3EB5A48959B263EE7D227  .\v2.docx
SHA256    6BF6829680E47037CD1C3A33C3CCBD54751A92874EC3EB5A48959B263EE7D227  .\v2Restored.crdownload
																		    
SHA256    55B9713EC14B045E246E8EDEBE550C04768ECCA160FC087F27AEF31186AA7118  .\v3.docx
SHA256    55B9713EC14B045E246E8EDEBE550C04768ECCA160FC087F27AEF31186AA7118  .\v3Restored.crdownload

I repeated the procedure for a new word file created with Word 2016 to check if my original file was causing the issues:

  • I uploaded the file and replaced it consecutively with different versions without restoring or touching it otherwise in between the uploads
  • After having created 4 versions including the original, I tried to restore the original version
  • It failed with an nextcloud error reading like "File version could not be restored" (was german)
  • While restoring different versions of the file, some versions just disappeared from the file version history

Steps to reproduce

  1. Upload a .docx file
  2. Edit the file locally with MS Word
  3. Upload the edited file again using the same name and location
  4. Choose to keep the new file, which creates a new version of the file
  5. Restore the original file from the versions tab
  6. Download the restored original file
  7. Open the file locally with MS Word and/or compare its hash with the local original file

Expected behavior

The original version of the file can be opened in MS Word without errors.
The restored version has the same file hash as the original version.

Nextcloud Server version

30

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?

Encryption is Enabled

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

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions