Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whiteboard contents are not saved #238

Open
1 of 5 tasks
l3ochan opened this issue Oct 21, 2024 · 22 comments
Open
1 of 5 tasks

whiteboard contents are not saved #238

l3ochan opened this issue Oct 21, 2024 · 22 comments
Labels
2. developing bug Something isn't working high

Comments

@l3ochan
Copy link

l3ochan commented Oct 21, 2024

Original report:

I was able to setup the server and have my nextcloud instance connect to it. I can create new whiteboards but whatever I draw in them is not saved. If I close the whiteboard, when I go to reopen it, It's empty.

Subtasks

@sbe-arg
Copy link

sbe-arg commented Oct 21, 2024

same

@sbe-arg
Copy link

sbe-arg commented Oct 21, 2024

@l3ochan just as fyi whiteboard requires a backend... but in my case does not work with the backend XD
just checking whats your backend setup

@l3ochan
Copy link
Author

l3ochan commented Oct 21, 2024

I have the backend, all setup and working. The docker container. I use apache as reverse proxy to access it over the internet and I have cloudflare's proxy to hide my public IP. I have the green checkmark in my administrator settings. I can write stuff on the whiteboards. Only weird thing is that when I close them, then reopen them, they are empty.
The not so funny thing is that I learned that after having layed out my new home network organization... I lost quite some time there 🥲

@manumitted
Copy link

manumitted commented Oct 23, 2024

When I first set up, I noticed if the backend isn't working properly, it would time out very quickly.

I was just testing the whiteboard with a few colleagues and ... after a while it stopped saving. I noticed it blank out, then go back to an old version of the drawing, then go to the latest version of the drawing, but I can very well see from the file app that the size and date hasn't changed for over a half hour. (Maybe it will update when we all exit the editing session?) There's no indication other than the above that it isn't working, but I'm assuming it's not saving our recent edits. I was able to copy via clipboard to a new file, though.

@hweihwang
Copy link
Contributor

@l3ochan Could you check your whiteboard backend logs for any errors? It seems there might be issues with API calls between the whiteboard backend and Nextcloud when saving - possibly the whiteboard backend can't reach the Nextcloud backend, or an API communication issues. Checking the logs should help identify the specific problem.

Quick note on how saving works: Changes are kept in memory and only saved to Nextcloud when either everyone leaves the whiteboard or when the Node.js server shuts down properly. This helps reduce network traffic and disk I/O.

@EricMeallier
Copy link
Contributor

the http://nextcloud.domain/settings/admin/whiteboard will tell you if the configuration is working.
For me:
URL http://nextcloud.domain/whiteboard/

PS: I config a nginx reverse proxy to handle this, on the same host/server than nextcloud main server

@manumitted
Copy link

manumitted commented Oct 24, 2024

Now I see that it will only save when everyone leaves, as stated above.

Today I was editing one solo and at some point it didn't save. I left and returned to check if it saved. A number of my last edits hadn't been saved, although many/most of what was done had been saved. I wonder if the trouble began when I added a frame around a portion of the diagram. (edit: or maybe there's some race condition between leaving and re-editing?)

I'll have to look into how to get a log from the whiteboard server (in docker).

@mvvvmd
Copy link

mvvvmd commented Oct 25, 2024

@manumitted docker logs whiteboard-docker-nextcloud-whiteboard-server-1

For me it turned out to be DNS issues in docker.

@Markus87
Copy link

Just had the same issue, of course I did not install the backend. (its just an app! 🤦‍♂)

For the user of the "App" there is no indication that there is something wrong.
It would be great if the App would at least inform the user that any work will be lost.
Or if the app just could save the file that was created anyway in nextcloud? (Standalone mode / without backend?)
I could live without any collab features that would require the backend.

@l3ochan
Copy link
Author

l3ochan commented Oct 25, 2024

@hweihwang Hi,
I can confirm my whiteboard backend has access to my nextcloud instance. There's no log reporting an issue accessing my nextcloud.

@seblveb
Copy link

seblveb commented Nov 13, 2024

Hello,

I'm experiencing the same issue when using the whiteboard in collaborative multi-user mode: all browser sessions need to be closed for the document to save. This is quite risky, especially since we use Excalidraw for sensitive meetings, and losing notes would be a real problem.

For now, I’m testing a workaround by restarting the Nginx service every 5 minutes using a cron job, but this solution is far from ideal. I understand that my setup is functioning as intended, but I believe it would be safer to have an alternative, like a manual save button.

in /etc/crontab of docker Whiteboard VM
*/15 * * * * root service nginx restart

@MaryEaston
Copy link

I am encountering an issue where the Whiteboard data is not being saved in Nextcloud. The Collaborate server is running, and it shows the message Whiteboard backend server is configured and connected under settings/admin/whiteboard. However, when attempting to edit the Whiteboard, the following log is got in Whiteboard backend server:

Logs when entering the Whiteboard editing screen on browser:

[46782] NOTF4uRDQf1E9hrkAAAv has joined 46782
[46782] Syncing room data
[46782] No data provided or existing, fetching from server...
FetchError: request to http://localhost:8082/index.php/apps/whiteboard/46782 failed, reason:
[46782] Fetched data from server:
null
    at ClientRequest.<anonymous> (file:///app/node_modules/node-fetch/src/index.js:108:11)
    at ClientRequest.emit (node:events:519:28)
    at emitErrorEvent (node:_http_client:103:11)
    at Socket.socketErrorListener (node:_http_client:506:5)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
[46782] Room data synced. Users: 1, Last edited by: null, files: 0
erroredSysCall: undefined
}
[46782] Fetched data from server:
null

Logs when exiting the Whiteboard editing screen on browser:

[46782] Syncing room data
[46782] Room data synced. Users: 1, Last edited by: mary, files: 0
[socket:9tsjS-WnB5kXx4NRAAA1] Disposing room
[46782] Mary has disconnected
socket rooms [ '46782' ]
[46782] Mary has left 46782
[46782] Syncing room data
[46782] Room data synced. Users: 0, Last edited by: mary, files: 0
[46782] Disposing room
[46782] Saving room data to server: 1 elements, 0 files
[46782] Room is empty, removed from cache
FetchError: request to http://localhost:8082/index.php/apps/whiteboard/46782 failed, reason:
    at ClientRequest.<anonymous> (file:///app/node_modules/node-fetch/src/index.js:108:11)
    at ClientRequest.emit (node:events:531:35)
    at emitErrorEvent (node:_http_client:103:11)
    at Socket.socketErrorListener (node:_http_client:506:5)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  erroredSysCall: undefined
}

@zeitkunst
Copy link

zeitkunst commented Nov 17, 2024

I'm also having the issue that nothing is saved. I'm the only user of the whiteboard. I'm on a self-hosted Nextcloud, version 29.0.9, and am using Whiteboard v1.0.4. When I leave I get the following error in the whiteboard server logs:

[487808] Room data synced. Users: 1, Last edited by: asknouf, files: 0
[socket:81rJ4rKViYnFJwdPAAAD] Disposing room
[487808] Adriana Knouf has disconnected
socket rooms [ '487808' ]
[487808] Adriana Knouf has left 487808
[487808] Syncing room data
[487808] Room data synced. Users: 0, Last edited by: asknouf, files: 0
[487808] Disposing room
[487808] Saving room data to server: 3 elements, 0 files
[487808] Room is empty, removed from cache
Error: HTTP error! status: 405: <html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx</center>
</body>
</html>

    at ApiService.fetchData (file:///mnt/nextcloud/whiteboard/websocket_server/ApiService.js:43:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async LRUCache.dispose (file:///mnt/nextcloud/whiteboard/websocket_server/LRUCacheStrategy.js:25:7)

I want to note that on the admin settings I have "Whiteboard backend server is configured and connected." and I am able to add items to the whiteboard while using it without any errors in the browser or in the logs; it's only on leaving and trying to save that I get this error. I'm using a nginx reverse proxy setup using the info in the README.

@Timbio
Copy link

Timbio commented Nov 20, 2024

Hello,
to me it saves stuff sometimes, but most times it does not save. When I close and open it will still keep the change. But after a while nothing get saved. I thinking that maybe Redis chaches it, but then it does not get saved to disked.

I also noticed if you make a change and then click on download. You will also not get the newest changes that you made.

(Running: Nexcloud 30; with redis, )

@seblveb
Copy link

seblveb commented Nov 20, 2024

2024-11-20T12:00:07.771983451Z Token expired
2024-11-20T12:00:07.856463643Z Error: HTTP error! status: 500: {"message":"\"OPS_semper-connect_manuel\/GROUPE\\/RESEAUX CSU.whiteboard\" is locked"}
2024-11-20T12:00:07.856543916Z     at ApiService.fetchData (file:///app/websocket_server/ApiService.js:43:11)
2024-11-20T12:00:07.856555722Z     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
2024-11-20T12:00:07.856564226Z     at async RedisStrategy.delete (file:///app/websocket_server/RedisStrategy.js:71:5)
2024-11-20T12:00:07.856572352Z     at async StorageManager.delete (file:///app/websocket_server/StorageManager.js:35:3)
2024-11-20T12:00:07.856580444Z     at async RoomDataManager.syncRoomData (file:///app/websocket_server/RoomDataManager.js:43:4)
2024-11-20T12:00:07.856588340Z     at async SocketManager.disconnectingHandler (file:///app/websocket_server/SocketManager.js:297:4)
2024-11-20T12:00:07.857791667Z Error: HTTP error! status: 500: {"message":"\"OPS_semper-connect_manuel\/GROUPE/Documentation_\/RESEAUX CSU.whiteboard\" is locked"}
2024-11-20T12:00:07.857817128Z     at ApiService.fetchData (file:///app/websocket_server/ApiService.js:43:11)
2024-11-20T12:00:07.857826893Z     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
2024-11-20T12:00:07.857835617Z     at async RedisStrategy.delete (file:///app/websocket_server/RedisStrategy.js:71:5)
2024-11-20T12:00:07.857844071Z     at async StorageManager.delete (file:///app/websocket_server/StorageManager.js:35:3)
2024-11-20T12:00:07.857852402Z     at async RoomDataManager.syncRoomData (file:///app/websocket_server/RoomDataManager.js:43:4)
2024-11-20T12:00:07.857860714Z     at async SocketManager.disconnectingHandler (file:///app/websocket_server/SocketManager.js:297:4)
2024-11-20T12:00:07.859662049Z [1078596] Room is empty, removed from cache

I think we have a problem of persistante KEY....

@juliusknorr
Copy link
Member

juliusknorr commented Nov 21, 2024

Some ideas for approaching:

  • Get Data management improvements #259 merged
  • When saving and testing the connectivity in the Nextcloud admin settings we could also perform a check on the whiteboard backend and verify that it can connect to Nextcloud
  • If file is locked we should retry (in case we don't already)
    • We should check why a 500 is returned 409 Conflict, which could indicate the reason to the whiteboard backend server

Added to the first post

@juliusknorr juliusknorr added bug Something isn't working high labels Nov 21, 2024
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Office team Nov 21, 2024
@juliusknorr juliusknorr moved this from 🧭 Planning evaluation (don't pick) to 📄 To do (~10 entries) in 📝 Office team Nov 21, 2024
@RTechSn
Copy link

RTechSn commented Nov 29, 2024

Just spent last 3 hours describing an important process. When i closed and opened the whiteboard again, it was a version from 2 hours ago...

@seblveb
Copy link

seblveb commented Dec 3, 2024

I've made good progress by addressing network and service type issues. In summary:

When using a Redis server, I don't get any relevant logs, and image files are frequently lost.
However, when setting STORAGE_STRATEGY=lru, I achieve better results, and I get relevant logs when images disappear:

[1088836] Room data synced. Users: 0, Last edited by: admin, files: 6
[1088836] Disposing room
[1088836] Saving room data to server: 99 elements, 6 files
[1088836] Room is empty, removed from cache
decodedData {
  userid: 'admin',
  fileId: 1088836,
  isFileReadOnly: false,
  user: { id: 'admin', name: 'Sébastien COURATIN' },
  iat: 1733215585,
  exp: 1733216485
}
[1088836] nUHyAOETHuvZ-G0WAAF3 has joined 1088836
[1088836] Syncing room data
[1088836] No data provided or existing, fetching from server...
[1088836] Fetched data from server: 
 null
Error: HTTP error! status: 401: {"message":"Unauthorized"}
    at ApiService.fetchData (file:///app/websocket_server/ApiService.js:43:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async RoomDataManager.fetchRoomDataFromServer (file:///app/websocket_server/RoomDataManager.js:54:19)
    at async RoomDataManager.syncRoomData (file:///app/websocket_server/RoomDataManager.js:28:11)
    at async SocketManager.joinRoomHandler (file:///app/websocket_server/SocketManager.js:173:16)
[1088836] Room data synced. Users: 1, Last edited by: null, files: 0

I'm continuing to investigate the logs with the LRU strategy and checking Nextcloud and the web servers to see if I can find anything helpful. I'll look into Redis later.

@joergmschulz
Copy link

in my case, just the NEXTCLOUD_URL was wrong. Pointed to the wrong server.

@seblveb
Copy link

seblveb commented Dec 10, 2024

Possible Database Issue Preventing Image Files from Saving in Whiteboard

Hello,

I’m encountering an issue with image files not being saved correctly in the Whiteboard app on my Nextcloud instance. After reviewing the logs, I found the following error related to a “dirty table read”:
dirty table reads: SELECT fileidFROMPREFIXfilecache WHERE (storage = :dcValue1) AND (path_hash = :dcValue2)
This error suggests that a database query failed due to a “dirty table read,” which may indicate that the database was accessed in an inconsistent state. This could be caused by issues related to locking or data synchronization, especially when dealing with files in the Whiteboard app.

Given that this issue appears to be tied to file handling and the database state, I suspect that it could be the reason why image files are not being saved properly in the Whiteboard app.

Has anyone else experienced similar issues or found a solution for this kind of problem? I would appreciate any insights or advice on how to resolve this, especially regarding database consistency or potential locking issues.

Thanks in advance!

@matrixes
Copy link

I'm adding this in case it may help anyone else. It is by no means a solution for every potential issue with saving whiteboard contents.

I had issues with saving whiteboards back in November (along with mimetype issues). I got 404:s in my logs when the Whiteboard file was opened/requested, and all whiteboard files were consistently 0B no matter what I tried.

These were resolved yesterday by updating to the latest version of Whiteboard.
I did not change my Whiteboard or Nginx reverse proxy configuration from back in November, I only updated to the last version of Whiteboard. I suspect a key piece of the puzzle is #259 that contains data management improvements.

I'm using a Docker (Compose) based Nextcloud image, build 30, along with Docker based Whiteboard. I have Nginx running as the reverse proxy to Nextcloud and Whiteboard.

@MurphyWants
Copy link

Based off of matrixes's comment, I updated my containers. I also have an nginx config and a docker-compose setup. On the 'docker-compose up' output, I saw this error:

nextcloud_whiteboard    | FetchError: request to https://nextcloud.domain.com/index.php/apps/whiteboard/682 failed, reason: unable to verify the first certificate
nextcloud_whiteboard    |     at ClientRequest.<anonymous> (file:///app/node_modules/node-fetch/src/index.js:108:11)
nextcloud_whiteboard    |     at ClientRequest.emit (node:events:519:28)
nextcloud_whiteboard    |     at emitErrorEvent (node:_http_client:103:11)
nextcloud_whiteboard    |     at TLSSocket.socketErrorListener (node:_http_client:506:5)
nextcloud_whiteboard    |     at TLSSocket.emit (node:events:519:28)
nextcloud_whiteboard    |     at emitErrorNT (node:internal/streams/destroy:170:8)
nextcloud_whiteboard    |     at emitErrorCloseNT (node:internal/streams/destroy:129:3)
nextcloud_whiteboard    |     at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
nextcloud_whiteboard    |   type: 'system',
nextcloud_whiteboard    |   errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
nextcloud_whiteboard    |   code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
nextcloud_whiteboard    |   erroredSysCall: undefined
nextcloud_whiteboard    | }

My nextcloud instance has a lets encrypt cert and it appears that whiteboard is failing to validate it
I added this environment variable to my whiteboard env vars to disable cert validation:
NODE_TLS_REJECT_UNAUTHORIZED=0
And now my whiteboard saves.

MurphyWants added a commit to MurphyWants/murphywants-ansible-role-application-nextcloud that referenced this issue Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing bug Something isn't working high
Projects
Status: 📄 To do (~10 entries)
Development

No branches or pull requests