CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.79k stars 681 forks source link

File not reopening after rename failed #7886

Closed juliushaertl closed 8 months ago

juliushaertl commented 9 months ago

Describe the Bug

When the rename of a file within Collabora fails because the storage reports an error the Collabora server no longer opens that file

Steps to Reproduce

Within Nextcloud

  1. Create a file test1.odt
  2. Create a file test2.odt
  3. Open test2.odt
  4. Try to rename it to test1.odt
  5. See an error because the storage doesn't allow the WOPI operation as there is already an existing file with the same name (expected)
  6. Close the file and try to reopen it

Expected Behavior

The file reopens fine

Actual Behavior

The file fails to load, as far as i see from the logs there seems to be a left over docbroker that is not loading properly then

Found DocumentBroker with docKey

Reported in production and were able to reproduce with the above steps locally

After restarting the coolwsd process the file opens fine again

Screenshots

Logs:

nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107482 +0000 [ websrv_poll ] INF  #18: URL [https://nextcloud.local//index.php/apps/richdocuments/wopi/files/532_ocvtc39rll6f?access_token=Hl98MxzrrYxonszd9KdoNHrrJZZ3JK73&access_token_ttl=0&permission=edit] is writable| wsd/COOLWSD.cpp:5278
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107487 +0000 [ websrv_poll ] INF  Find or create DocBroker for docKey [https%3A%2F%2Fnextcloud.local%3A443%2F%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F532_ocvtc39rll6f] for session [a3f] on url [https://nextcloud.local//index.php/apps/richdocuments/wopi/files/532_ocvtc39rll6f?access_token=Hl98MxzrrYxonszd9KdoNHrrJZZ3JK73&access_token_ttl=0&permission=edit]| wsd/COOLWSD.cpp:3593
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107491 +0000 [ websrv_poll ] DBG  Found DocumentBroker with docKey [https%3A%2F%2Fnextcloud.local%3A443%2F%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F532_ocvtc39rll6f]| wsd/COOLWSD.cpp:3623
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107500 +0000 [ websrv_poll ] WRN  DocBroker [https%3A%2F%2Fnextcloud.local%3A443%2F%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F532_ocvtc39rll6f] is unloading. Rejecting client request to load session [a3f]| wsd/COOLWSD.cpp:3629
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107505 +0000 [ websrv_poll ] TRC  #18: WebSocketHandler: Writing 33 bytes to #18 in addition to 23 bytes buffered| net/WebSocketHandler.hpp:775
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107508 +0000 [ websrv_poll ] TRC  #18: Shutdown: Closing Connection| net/WebSocketHandler.hpp:251
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107514 +0000 [ websrv_poll ] TRC  #18: Shutdown websocket, code: 1001, message: error: cmd=load kind=docunloading| net/WebSocketHandler.hpp:209
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107521 +0000 [ websrv_poll ] TRC  #18: WebSocketHandler: Writing 35 bytes to #18 in addition to 58 bytes buffered| net/WebSocketHandler.hpp:775
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107578 +0000 [ websrv_poll ] TRC  #18: Wrote 95 bytes of 95 buffered data| net/Socket.hpp:1453
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107588 +0000 [ websrv_poll ] TRC  #18: Socket shutdown RDWR.| net/Socket.hpp:182
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107608 +0000 [ websrv_poll ] TRC  #18: Ignore further input on socket.| net/Socket.hpp:364
nextcloud-collabora-1  | wsd-00001-00031 2023-12-21 21:27:30.107638 +0000 [ websrv_poll ] ERR  #18: Error while handling Client WS Request: Failed to create DocBroker with docKey [https%3A%2F%2Fnextcloud.local%3A443%2F%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F532_ocvtc39rll6f].| wsd/COOLWSD.cpp:5360

Desktop

timur-g commented 8 months ago

When I try to rename test2.odt to test1.odt from Online 23.05.6. that runs in Nextcloud 7.1.5, it gets name test1 (2).odt.

juliushaertl commented 8 months ago

Thanks for testing, I figured out this is related to the https://github.com/nextcloud/files_lock app that I had enabled, so will close this here.