ERROR: file stalls at "connecting" when trying to open it

Hello,

When working on Collabora online, I sometimes have an issue saving files and opening them. I noticed it first occurs when, for some reason I dont understand, it cannot save the file automatically because it tells me I dont have the rights (even if I am the owner of the file, and that usually saving the file works well). Trying to save the file manually doesnt work either. The state of the file gets stuck at “saving”. Trying to close the window does not respond. And reloading the page makes the file stall at connecting (see the image below).

Our organisation uses CanTrust to host our nextcloud instance. But I was wondering if any of you here had the same issue as what I described.

EDIT: it seems to happen when I have more than one tab of the same file opened at the same time (possibly with with a public access link). Usually, having multiple tabs of the same file is not a problem. But after some idle time, like when I come back the next morning to work on the file, and for some reason I re-open the other tab of the same file, it can cause an error connecting with the wrong permissions, preventing me to access the file at all.

Thanks for any inputs!

Hi @julienrobi3 :waving_hand: That EDIT is the key detail, thanks!

This looks like an expired WOPI access token on the overnight tab. Nextcloud issues a time-limited token per view; the stale tab’s token dies quietly, then when you re-focus it and it rejoins the document session, the save goes out with a token Nextcloud no longer honours → you get “no rights” even though you own the file. :sweat_smile: Unsaved changes then keep the document from unloading, so the reload lands on a wedged session → “Connecting” forever. The public link makes it worse, since that view is a different identity with its own permissions.

To get unstuck: close all tabs of the file (including the public-link one), wait a few minutes for the doc to unload server-side, then reopen from Nextcloud. Check the file’s Versions tab if content is missing. :crossed_fingers:

To avoid it: don’t leave a tab parked overnight on a doc you’re editing, and don’t mix an authenticated tab with a public-link tab on the same file.

Since CanTrust hosts your instance, worth asking them to check the PutFile status in coolwsd.log, the richdocuments token TTL vs Nextcloud’s session_lifetime, and any stale locks in oc_file_locks.

Thanks for your reply!
I will be careful in the future to avoid this behavior. But I was still curious whether its an issue that will be worked on by Collabora team? I think its a generally good thing to change our way to work by avoiding having plenty of tabs open at the same time. But I feel a lot of people work this way, so it could be frustrating for future users, especially if its not easy to know what is happening and if the files are unnaccessible for the next few hours.

And maybe its worth also mentioning that this morning, after following @darshan advices (closing all tabs at the end of the day, and opening just one tab the next day), it still didnt work. I was able to open the file, and edit it. But when I tried to save the file, nothing happened. And reloading the file got me back to the never ending “connecting” loop, even if I had opened only one tab.
We are in contact with CanTrust, so they will be able to see the content of the log files, but I thought it was worth mentioning this problem to the Collabora community!

@julienrobi3 can you share the logs here so i can check what is the main cause here ?