nextcloud / whiteboard

Create & collaborate on an infinite canvas!
https://apps.nextcloud.com/apps/whiteboard
GNU Affero General Public License v3.0
59 stars 8 forks source link

bug: uploading big images fails #270

Open paskal007r opened 1 week ago

paskal007r commented 1 week ago

I'm facing a very odd issue with whiteboard, depending on image size it won't sync the images or store them in the file. Here are some logs from the backend, at the beginning what happens when I paste a small image, the file gets uploaded with no issue and the log only says "added image". After that what happens when trying to paste a big image.

nextcloud-whiteboard-server-1 | [9929] Syncing room data nextcloud-whiteboard-server-1 | [9929] Room data synced. Users: 1, Last edited by: [USER], files: 1 nextcloud-whiteboard-server-1 | [9929] roAnAi9dKQUtudk_AAAP added image d3a4bf5be442a9252949352dc0a60ef3f23d6ac4 nextcloud-whiteboard-server-1 | [9929] Syncing room data nextcloud-whiteboard-server-1 | [9929] Room data synced. Users: 1, Last edited by: [USER], files: 2 nextcloud-whiteboard-server-1 | [9929] Syncing room data nextcloud-whiteboard-server-1 | [9929] Room data synced. Users: 1, Last edited by: [USER], files: 2 nextcloud-whiteboard-server-1 | [socket:roAnAi9dKQUtudk_AAAP] Disposing room nextcloud-whiteboard-server-1 | [9929] [USER] has disconnected nextcloud-whiteboard-server-1 | socket rooms [ '9929' ] nextcloud-whiteboard-server-1 | [9929] [USER] has left 9929 nextcloud-whiteboard-server-1 | [9929] Syncing room data nextcloud-whiteboard-server-1 | [9929] Room data synced. Users: 0, Last edited by: [USER], files: 2 nextcloud-whiteboard-server-1 | [9929] Disposing room nextcloud-whiteboard-server-1 | [9929] Saving room data to server: 11 elements, 2 files nextcloud-whiteboard-server-1 | [9929] Room is empty, removed from cache nextcloud-whiteboard-server-1 | decodedData { nextcloud-whiteboard-server-1 | userid: '[USER]', nextcloud-whiteboard-server-1 | fileId: 9929, nextcloud-whiteboard-server-1 | isFileReadOnly: false, nextcloud-whiteboard-server-1 | user: { nextcloud-whiteboard-server-1 | id: '[USER]', nextcloud-whiteboard-server-1 | name: '[USER]' nextcloud-whiteboard-server-1 | }, nextcloud-whiteboard-server-1 | iat: 1731406027, nextcloud-whiteboard-server-1 | exp: 1731406927 nextcloud-whiteboard-server-1 | } nextcloud-whiteboard-server-1 | [9929] qDVEl6VuM_dXDy99AAAR has joined 9929 nextcloud-whiteboard-server-1 | [9929] Syncing room data nextcloud-whiteboard-server-1 | [9929] No data provided or existing, fetching from server... nextcloud-whiteboard-server-1 | [9929] Fetched data from server: nextcloud-whiteboard-server-1 | { nextcloud-whiteboard-server-1 | data: { nextcloud-whiteboard-server-1 | elements: [ nextcloud-whiteboard-server-1 | [Object], [Object], nextcloud-whiteboard-server-1 | [Object], [Object], nextcloud-whiteboard-server-1 | [Object], [Object], nextcloud-whiteboard-server-1 | [Object], [Object], nextcloud-whiteboard-server-1 | [Object], [Object], nextcloud-whiteboard-server-1 | [Object] nextcloud-whiteboard-server-1 | ], nextcloud-whiteboard-server-1 | files: { nextcloud-whiteboard-server-1 | '3e09d77fda06353c26a8df38ecb02ba42119eca7': [Object], nextcloud-whiteboard-server-1 | d3a4bf5be442a9252949352dc0a60ef3f23d6ac4: [Object] nextcloud-whiteboard-server-1 | } nextcloud-whiteboard-server-1 | } nextcloud-whiteboard-server-1 | } nextcloud-whiteboard-server-1 | [9929] Room data synced. Users: 1, Last edited by: null, files: 2

All the [Object] elements in the room are missing images, excluded 2. An odd behaviour is that visually the image is shown in the screen of thw user, but not synced. When opening the whiteboard again, if one pastes the same image again the old instances will show the image again.

juliusknorr commented 1 week ago

Thanks for reporting. Could you share a few more insights on this so we can try to reproduce the issue:

juliusknorr commented 1 week ago

Just tried and could reproduce with a 18MB JPEG file - needs some further debugging.

paskal007r commented 1 week ago

What whiteboard app version are you using?

the log comes from ghcr.io/nextcloud-releases/whiteboard docker image on nextcloud IIRC there was a 1.0.4 whiteboard version.

What image sizes are failing? Are small images working fine? Is there any size limit that you can tell where it starts failing?

i didn't actually drag&drop images, I used copy-pasted screenshots, my bad for not specifying

Can you also check the browser console for any javascript errors reported?

I didn't find any

seblveb commented 2 days ago

I’m encountering intermittent issues with file loss (especially images) in Whiteboard, particularly during data synchronization. The logs sometimes show the following:

csharp Copier le code [1076683] Syncing room data
[1076683] No data provided or existing, fetching from server...
[1076683] files: []
My tests: I conducted several tests by restarting the Redis service and the Whiteboard web server during an editing session, while monitoring the logs.

Scenario with 1 active user:

I added 7 files one by one. Between each addition, I caused Redis and the web server (NGINX) to go down. Each time, the files were saved successfully. Scenario with 2 active users:

I added the first 7 files: no issues, everything was saved. However, when I added the 8th file, without even causing any outage, I noticed abnormal behavior. The logs mentioned a new object, but still 7 files remained. This seems to point to a specific issue with multi-user session handling or a limit in file synchronization.

Questions:

Has anyone else experienced this kind of issue? Are there specific settings for Redis or the web server that should be checked in a collaborative multi-user context? Is there a known limit in file or session handling that I might have missed? I’d appreciate any suggestions or feedback regarding this issue.

seblveb commented 2 days ago

I’ve noticed that everything works fine when I’m using the whiteboard alone. However, as soon as I share a link (either read-only or editable), the images disappear.

During my last test with a non-editable public link, all the images vanished. Here's the relevant log excerpt:

yaml Copier le code 2024-11-19T20:38:21.095841170Z [1078436] Sébastien COURATIN has disconnected
2024-11-19T20:38:21.095902412Z socket rooms [ '1078436' ]
2024-11-19T20:38:21.095915479Z [1078436] Sébastien COURATIN has left 1078436
2024-11-19T20:38:21.095926480Z [1078436] Syncing room data
2024-11-19T20:38:21.139221132Z [1078436] Room data synced. Users: 0, Last edited by: admin, files: 10
2024-11-19T20:38:21.182405201Z [1078436] Saving room data to server: 19 elements, 10 files
2024-11-19T20:38:22.830264600Z decodedData {
2024-11-19T20:38:22.830316688Z userid: 'admin',
2024-11-19T20:38:22.830328876Z fileId: 1078436,
2024-11-19T20:38:22.830338698Z isFileReadOnly: false,
2024-11-19T20:38:22.830348391Z user: { id: 'admin', name: 'Sébastien COURATIN' },
2024-11-19T20:38:22.830358825Z iat: 1732048616,
2024-11-19T20:38:22.830368331Z exp: 1732049516
2024-11-19T20:38:22.830377959Z }
2024-11-19T20:38:22.875270893Z [1078436] gc6oVQMykfCtBkXiAABr has joined 1078436
2024-11-19T20:38:22.876315616Z [1078436] Syncing room data
2024-11-19T20:38:22.914430137Z [1078436] Room data synced. Users: 1, Last edited by: admin, files: 10
2024-11-19T20:38:22.986161824Z [1078436] Room is empty, removed from cache
2024-11-19T20:38:29.260635145Z [1078436] Syncing room data
2024-11-19T20:38:29.262199392Z [1078436] Room data synced. Users: 1, Last edited by: admin, files: 0
The key moments seem to occur when the room cache is cleared and then synced again, but this time with files: 0.

Does this issue relate to sharing permissions, caching, or data synchronization? Let me know if you have any insights!

seblveb commented 2 days ago

2024-11-19T21:28:13.541826993Z Error: HTTP error! status: 401: {"message":"Unauthorized"} 2024-11-19T21:28:13.541864087Z at ApiService.fetchData (file:///app/websocket_server/ApiService.js:43:11) 2024-11-19T21:28:13.541873490Z at process.processTicksAndRejections (node:internal/process/task_queues:105:5) 2024-11-19T21:28:13.541882109Z at async RoomDataManager.fetchRoomDataFromServer (file:///app/websocket_server/RoomDataManager.js:54:19) 2024-11-19T21:28:13.541919090Z at async RoomDataManager.syncRoomData (file:///app/websocket_server/RoomDataManager.js:28:11) 2024-11-19T21:28:13.541928716Z at async SocketManager.disconnectingHandler (file:///app/websocket_server/SocketManager.js:297:4) 2024-11-19T21:28:13.542083743Z [1078463] Fetched data from server: