nextcloud / integration_whiteboard

✏ A whiteboard for Nextcloud, using Spacedeck
https://apps.nextcloud.com/apps/integration_whiteboard
GNU Affero General Public License v3.0
54 stars 7 forks source link

App is not functional in Nextcloud docker #11

Open seele05 opened 3 years ago

seele05 commented 3 years ago

Setup: Nextcloud21 with docker-compose on debian 64bit with upstream reverse proxy on a different server

Steps to reproduce: App installed from store without errors

What happened ? App is unable to use

Creation of New Whiteboards is possible (using the "+" in data view) but trying to open results in:

_whiteboard Spacedeck request connection error : cURL error 7: Failed to connect to localhost port 9666: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:9666/api/spaces

In App Config (connected accounts?) this is shown image

is there a need to expose the spacedeck ports in the compose file? or other steps to be done?

julien-nc commented 3 years ago

The webserver needs to be able to connect to the bundled Spacedeck server that should be running on the same container.

Could you check if the Spacedeck binary is running on the webserver container? ps aux | grep spacedeck If not, there might be some error in /.../data/appdata_XXXXXX/spacedeck/spacedeck.log.

seele05 commented 3 years ago

Binary is not running in the app container nor web container spacedesk.log contains only:

nice: can't execute './spacedeck.nexe.bin': No such file or directory

You said:

The webserver needs to be able to connect to the bundled Spacedeck server that should be running on the same container.

which one? the webserver in the compose stack is able to communicate with the spacedesk server if running on app container the reverse proxy should not be able to connect to the nextcloud app container directly and on web container only on the webui port?

Weltherrscher commented 3 years ago

Its not only from within Docker. I run a Nextcloud 21 instance in ESXi VM under Debian 10 with nginx (and a nginx reverse proxy located within opnSense). The Storage Space is located in a SMB share, from there, the spacedeck.nexe.bin is not executable. (bash: keine Berechtigung.) Thus, I'm getting the same error. If I run the executable from within /var/www.... it starts, but I'm getting the same HTTP400 error from #12

//edit: After changing the fstab entry the executable works now. but I'm getting a database locked error.

julien-nc commented 3 years ago

@seele05

which one?

Spacedeck has to run on the same container as the webserver. No problem on that side, this is the webserver that launches the binary. The webserver (Php in fact) makes the requests to http://localhost:9666, not the reverse proxy.

nice: can't execute './spacedeck.nexe.bin': No such file or directory

Can you check if /.../data/appdata_XXXXXX/spacedeck/spacedeck.nexe.bin exists? And its permissions?

@Weltherrscher Which database? The Nextcloud one or the Spacedeck one? Where do you see the locked error?

Weltherrscher commented 3 years ago

spacedeck.log

directly in /media/services/NextCloud/appdata_ocu70rbh8ksw/spacedeck/spacedeck.log on the nextcloud storage space

seele05 commented 3 years ago

Hi @eneiluj

in the given path the file spacedeck.nexe.bin exists with the following permissions:

# ls -la spacedeck.nexe.bin
-rwx------   1 82 82 58701811 Feb 23 14:27 spacedeck.nexe.bin
Weltherrscher commented 3 years ago

spacedeck.log

updated file, the above was from the manual deletion of the database.sqlite in nextcloud/appdata.... //edit: This seems not to be in connection with access rights, neither 777, nor 776 or 770 helps.

julien-nc commented 3 years ago

@seele05 Can you run it manually? Something like sudo -u www-data ./spacedeck.nexe.bin . If this works then it probably means the app tries to find the binary in the wrong place. I will tell you how to get debug information then.

@Weltherrscher Let's clean the app data and try again. Just delete /.../data/appdata_XXXXXX/spacedeck directory, disable the app and enable it again. It will copy the initial database (which is not empty like the one Spacedeck creates when there is none).

seele05 commented 3 years ago

Hi @eneiluj

from within app container

web container has no www-data user:

as root within web container:

$ ls -la spacedeck.nexe.bin

$ -rw-r--r-- 1 82 www-data 58701811 Feb 25 08:01 spacedeck.nexe.bin

$ ./spacedeck.nexe.bin

sh: ./spacedeck.nexe.bin: Permission denied

whoami

$ root

Weltherrscher commented 3 years ago

grafik Immediately after activating the app these errors pop up. Activation fails. After that following log entries appear in the nextcloud.log: grafik

Trying to open a whiteboard in this state fails with the following: grafik Output in spacedeck.log is the same as above (locked sqlite database).

julien-nc commented 3 years ago

@seele05 I'm not aware of which docker container has access to appdata in your context. I just know that the webserver (not the reverse proxy) serving Nextcloud tries to execute the binary that is in appdata (not in the app/integration_whiteboard/data/spacedeck directory, this one is copied in appdata_xxxx/spacedeck, that's where it's executed). If this binary is not executable because of mount options like it was for @Weltherrscher, then there is your problem.

@Weltherrscher Could you find the line corresponding to call to a member function getContainer() on null in nextcloud.log? It seems the repair steps are called twice. The second time they are called, something goes wrong. Anyway if the data is copied and the binary is launched, the getContainer() call crash is not your problem. Could you run fuser /.../data/appdata_XXXXXX/spacedeck/database.sqlite? It will show you which process is using the DB. I think all this might come from manual actions. Could you delete appdata_xxxx/spacedeck, then remove and delete the Whiteboard integration app in Nextcloud settings, then restart your containers, then reinstall the app and try to use it again. If this does not solve your problem, I'm clueless.

Weltherrscher commented 3 years ago

' fuser database.sqlite /media/services/NextCloud/appdata_ocu70rbh8ksw/spacedeck/database.sqlite: 28520

ps 28520 PID TTY STAT TIME COMMAND 28520 ? SNl 0:01 ./spacedeck.nexe.bin'

seele05 commented 3 years ago

Hi @eneiluj ,

the image with the content of /var/www/html is available for both containers (app & web) I am not questioning that the web container can execute the binary -> but for me I assume that the server seems to be ran in App container. BTW -> if this is the "same binary" as the standalone spacedeck container, its against the idea of docker (one server per container)

maybe I should have given in my previous answer the full paths. I checked the correct binary.

here is my compose file for maybe more insight: likely the same as: https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/insecure/mariadb-cron-redis/fpm/docker-compose.yml

`version: '3'

services: db: image: mariadb command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW restart: always volumes:

volumes: db: nextcloud: `

the volumes are on a iscsi drive mounted on docker host. The mount points are fine. This is production like setup no testing or fun ...

If the questions comes up: nextcloud is not used for data storage or sharing -> in my setup seafile is used for this case. the users access their seafile data through webdav in nextcloud.

Weltherrscher commented 3 years ago

Attached the line containing Call to a member function getContainer() on null: (But there are many more containing this string after this first line) {"reqId":"5g9RMr2pbdQjiF1yqQEZ","level":3,"time":"2021-02-25T13:53:37+01:00","remoteAddr":"172.16.11.199","user":"Admin","app":"no app in context","method":"POST","url":"/settings/apps/enable","message":{"Exception":"Error","Message":"Call to a member function getContainer() on null","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":143,"function":"delegateContainerRegistrations","class":"OC\\AppFramework\\Bootstrap\\RegistrationContext","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":86,"function":"registerApps","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Installer.php","line":146,"function":"runLazyRegistration","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/AppSettingsController.php","line":448,"function":"installApp","class":"OC\\Installer","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"enableApps","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php","Line":405,"CustomMessage":"Error during service alias registration of comments: Call to a member function getContainer() on null"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0","version":"21.0.0.18"}

//edit:

nextcloud_whiteboard_install.log attached the relevant logs from installing the integration_whiteboard app after deleting the spacedeck, removing the app, rebooting the VM and installing the app again. It shows itself as activated.

spacedeck.log attached log after creating a new whiteboard. same error... =( maybe its because the cifs-share sets the user:group to "www-data:root"? Ok, its not working with www-data:www-data neither...

I just set up a quick'n'dirty Test-VM. In there, its working, seems like I should reinstall my Nextcloud...again... :-/ Haven't had done this since Nextcloud 10 or so...

szaimen commented 3 years ago

https://github.com/nextcloud/server/issues/24711

markuman commented 3 years ago

The webserver needs to be able to connect to the bundled Spacedeck server that should be running on the same container.

Could you check if the Spacedeck binary is running on the webserver container? ps aux | grep spacedeck If not, there might be some error in /.../data/appdata_XXXXXX/spacedeck/spacedeck.log.

That's strange here

root@1b90ba9af9c8:/var/www/html# ps aux | grep spacedeck
www-data    1688  0.0  0.5 923456 92144 ?        SNl  07:33   0:03 ./spacedeck.nexe.bin
root        4744  0.0  0.0   3212   872 pts/0    S+   08:38   0:00 grep spacedeck
root@1b90ba9af9c8:/var/www/html# lsof -i :9666 
root@1b90ba9af9c8:/var/www/html# 

I see the same error as posted first only once. I've no idea if it's running correctly now or not.

Weltherrscher commented 3 years ago

nextcloud/server#24711

Confirm that the call errors in nextcloud.log are gone after applying that patch. Nevertheless, the Wihteboard still doesnt run because of database locked error.

joergmschulz commented 3 years ago

back to to original error msg: while the spacedeck.nexe.bin does exist, it is not executable. Poking around a bit, I installed node, npm and started the .js file but that failed because of lack of the sqlite driver and issued the same error msg: does not exist. Possibly, the .bin isn't complete in all cases?

joergmschulz commented 3 years ago

maybe: doesn't work on alpine because a different glibc is used here?

seele05 commented 3 years ago

After some rough experiments in my dev stage, i got the feeling that under normal circumstances the whiteboard is not able to run. @joergmschulz alpine is used in spacedeck standalone and for nextcloud that should not be the problem.

Maybe someone have some time to frankenstein the spacedeck.nexe.bin in the standalone server and see what happends.

joergmschulz commented 3 years ago

see here https://help.nextcloud.com/t/nextcloud-21-whiteboard-error/109165/5 : really, library prerequisites???

seele05 commented 3 years ago

no words ... okay following this I will uninstall this plugin and wait till stable release

szaimen commented 3 years ago

Possibly you should just close this issue for this reason.

This attitude doesn't help anyone! It neither helps you getting closer to the bugs resolution nor helps the maintainer/developer figure out what the problem is.

TheTimeWalker commented 3 years ago

I disagree closing this issue for the warning. The warning mentions it can break on custom Nextcloud installation, however the whiteboard does not work with an unmodified official Nextcloud container, so this is still a valid issue.

joergmschulz commented 3 years ago

This attitude doesn't help anyone! I disagree closing this issue for the warning.

ok I apologize and draw back my comment.

seele05 commented 3 years ago

keep focused ;)

while waiting for sth. more stable for my production world, I was more playing around in my dev stage. running standalone server and then using the plugin only for integration seems possible with not too much magic.

But I wish for more participation here or at least any feedback. I would love to have a rockstable whiteboard tool.

If there were a possibility to choose between "running binary from nextcloud" and "connect to exisiting server" not docker and docker users could happily live on

docker is one way to get ultimatively rid of all dependencies (/the missing ones) when used corretcly.

szaimen commented 3 years ago

Does anyone of you use a 32-bit OS or an ARM PC? This could be one problem why the connection to spacedeck cannot get established as discovered here: https://help.nextcloud.com/t/nc-21-whiteboard-integration-error/109462/2

seele05 commented 3 years ago

No x64 os on x64cpu using 64bit docker. Root cause is definitely on Nextcloud / spacedeck side

sutidor commented 3 years ago

Did anyone get this working yet ?

seele05 commented 3 years ago

unfortunately not.

sutidor commented 3 years ago

I made some progress.

When I create a whiteboard the spacedeck logs look fine. On the frontend though, I get the spacedeck login page without styles. Without using nextcloud, spacedeck on its own subdomain works fine with reverse proxy.

Stand by. Happy tinkering

Edit: I tried to manually fix style.css according to /data/getSpacedeck.sh - did not resolve the issue. This error from browser console log seems to be related: https://your.nextcloud.instance/apps/dashboard/” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff) as https://your.nextcloud.instance/index.php/apps/integration_whiteboard/proxy will not load correctly

sutidor commented 3 years ago

No commit since 2 months. Seems to be abandoned :( Update: 8 months, waiting patiently