nextcloud / notify_push

Update notifications for nextcloud clients
GNU Affero General Public License v3.0
228 stars 42 forks source link

App Broken after 0.6.4 upgrade #355

Closed AndyXheli closed 1 year ago

AndyXheli commented 1 year ago

I'm running NC 27.1.3 all was working after i upgraded this app to version 0.6.4 from 0.6.3 app is not working

× notify_push.service - Push daemon for Nextcloud clients Loaded: loaded (/etc/systemd/system/notify_push.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2023-11-08 00:30:37 UTC; 7s ago Process: 6221 ExecStart=/var/www/nextcloud/apps/notify_push/bin/x86_64/notify_push /var/www/nextcloud/config/config.php (code=exited, status=203/EXEC) Main PID: 6221 (code=exited, status=203/EXEC) CPU: 2ms

Nov 08 00:30:37 nextcloud systemd[1]: Started Push daemon for Nextcloud clients. Nov 08 00:30:37 nextcloud systemd[6221]: notify_push.service: Failed to locate executable /var/www/nextcloud/apps/notify_push/bin/x86_64/notify_push: Permission denied Nov 08 00:30:37 nextcloud systemd[6221]: notify_push.service: Failed at step EXEC spawning /var/www/nextcloud/apps/notify_push/bin/x86_64/notify_push: Permission denied Nov 08 00:30:37 nextcloud systemd[1]: notify_push.service: Main process exited, code=exited, status=203/EXEC Nov 08 00:30:37 nextcloud systemd[1]: notify_push.service: Failed with result 'exit-code'.

root@nextcloud:~# sudo -u www-data php /var/www/nextcloud/occ notify_push:setup 🗴 bundled binaries are not available. If you're trying to setup the app from git, you can find build instruction in the README: https://github.com/nextcloud/notify_push And pre-built binaries for x86_64, armv7, aarch64 and freebsd (amd64) in the github actions. Once you have a notify_push binary it should be placed in /var/www/nextcloud/apps/notify_push/bin/fbsd_x86_64

root@nextcloud:~# sudo -u www-data php /var/www/nextcloud/occ notify_push:self-test ✓ redis is configured 🗴 can't connect to push server: Server error: GET https://cloud.server.org/push/test/cookie resulted in a 503 Service Unavailable response: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

503 Service Unavailable

AndyXheli commented 1 year ago

I downgraded to 0.6.3 and all seems to work now

root@nextcloud:~# sudo -u www-data php /var/www/nextcloud/occ notify_push:self-test ✓ redis is configured ✓ push server is receiving redis messages ✓ push server can load mount info from database ✓ push server can connect to the Nextcloud server ✓ push server is a trusted proxy ✓ push server is running the same version as the app

JoshuaPettus commented 1 year ago

I noticed this too. If you go into /var/www/nextcloud/apps/notify_push/bin you will find that there is a new binary for x86 that has a random letter name. Don't know if this was intentional but It meant I had to start from scratch with the setup...

ottsimon commented 1 year ago

I noticed that the permissions were wrong, so a chmod -cR 755 /var/www/nextcloud/apps/notify_push and a service restart after that fixed it.

Dennis1993 commented 1 year ago

Same problem here. After chmod the service is starting. If I type „service notify_push status“ I can see the following warning after successful start:

WARN src/connection.rs:94: Invalid credentials

but the push is working

ottsimon commented 1 year ago

@Dennis1993 I've had this issue on 1 out of 4 machines too. A server restart fixed it.

Furthermore, I noticed that the setup command is not working correctly. When I do a sudo -u www-data php /var/www/nextcloud/occ notify_push:setup I get the following message:

bundled binaries are not available.
If you're trying to setup the app from git, you can find build instruction in the README: https://github.com/nextcloud/notify_push
And pre-built binaries for x86_64, armv7, aarch64 and freebsd (amd64) in the github actions.
Once you have a notify_push binary it should be placed in /var/www/nextcloud/apps/notify_push/bin/fbsd_x86_64

It seems to search for FreeBSD binaries on an Ubuntu 22.04 machine. So I created the fbsd_x86_64 folder, copied the binaries from the x86_64 folder over to it, and tried it again. After that, the setup command works.

AndyXheli commented 1 year ago

Hopefully dev has a solution for this. My server OS is Ubuntu 22.04

JoshuaPettus commented 1 year ago

DerFranke is %100 correct. That was my experience as well though I had resolved it quite a few hours before and forgot how. I did need to change the launching command in the systemd service file too.

Lol i didn't recognize fbsd was freebsd and assumed it was a randomly generated name!

Nordlead75 commented 1 year ago

@AndyXheli Can you tell me how to downgrade to 0.6.3 with occ command ? regards

ernolf commented 1 year ago

For me the update to 0.6.4 was normal but after the update to 0.6.5 apps/notify_push/bin/x86_64/notify_push got these permissions: -rw-rw-r--

Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-88-generic x86_64), PHP-FPM, Version 8.2.12
JoseRamirezMoreno commented 11 months ago

Solved it as follows:

  1. sudo docker exec -it nextcloud-aio-nextcloud /bin/bash
  2. cd /var/www/html/custom_apps/notify_push/bin/x86_64
  3. chmod +x notify_push