notify_push
notify_push copied to clipboard
How do I verify that the desktop client is using the new client push capabilities?
After installing the push capabilities, it would be good to have instructions how to verify that the nextcloud desktop client is indeed using the new client push mechanism.
I agree that sth. like a connection type icon would be great, but this is an issue which I guess would be better placed at https://github.com/nextcloud/desktop
What I did to verify a successful push connection:
-
Load the metrics page, start the client and reload the metrics page. If your client is connected via push, the connection count increases.
-
The other method is to start the client, go to your NC webinterface and upload a file. Right after upload your client should start the sync process without nearly any delay when it's connected via push. Although there might be a chance that the polling would have been triggered at same time. So maybe double check this :smile:
I used another possibility to at least check that the server sends something:
- Start the server with
LOG=notify_push=trace
and observe the log; in my case the server was started via systemd and I usedjournalctl -f --unit=notify_push
Now it would be helpful to have a simple possibility to check if the client (browser login) and/or nextcloud app on android gets / uses the messages ...
Edit: a notification would also helpful in the android app
I agree that sth. like a connection type icon would be great, but this is an issue which I guess would be better placed at https://github.com/nextcloud/desktop
What I did to verify a successful push connection:
1. Load the metrics page, start the client and reload the metrics page. If your client is connected via push, the connection count increases. 2. The other method is to start the client, go to your NC webinterface and upload a file. Right after upload your client should start the sync process without nearly any delay when it's connected via push. Although there might be a chance that the polling would have been triggered at same time. So maybe double check this 😄
What is the metrics page?
It is a website with some stats.
https://github.com/nextcloud/notify_push#metrics
Yes, I see that, but unsure how to set it up. If you have the time to provide detailed instructions on how you did it I would greatly appreciate it. Thanks!
The easiest way from an admin's perspective would have the nextcloud app display the monitoring information instead of this being handled by a separate server.
Yes, I see that, but unsure how to set it up. If you have the time to provide detailed instructions on how you did it I would greatly appreciate it. Thanks!
You have to add METRICS_PORT
to your service configuration, e.g.:
[Unit]
Description = Push daemon for Nextcloud clients
[Service]
Environment = PORT=7867 METRICS_PORT=7868
ExecStart = /path/to/push/binary/notify_push /path/to/nextcloud/config/config.php
User=www-data
[Install]
WantedBy = multi-user.target
Restart your service and you should be able to see some stats at <your_nc_domain>:7868/metrics
Yes, I see that, but unsure how to set it up. If you have the time to provide detailed instructions on how you did it I would greatly appreciate it. Thanks!
You have to add
METRICS_PORT
to your service configuration, e.g.:[Unit] Description = Push daemon for Nextcloud clients [Service] Environment = PORT=7867 METRICS_PORT=7868 ExecStart = /path/to/push/binary/notify_push /path/to/nextcloud/config/config.php User=www-data [Install] WantedBy = multi-user.target
Restart your service and you should be able to see some stats at
<your_nc_domain>:7868/metrics
Thank you for this! Appreciate it.
Thanks!
Yes, I see that, but unsure how to set it up. If you have the time to provide detailed instructions on how you did it I would greatly appreciate it. Thanks!
You have to add
METRICS_PORT
to your service configuration, e.g.:[Unit] Description = Push daemon for Nextcloud clients [Service] Environment = PORT=7867 METRICS_PORT=7868 ExecStart = /path/to/push/binary/notify_push /path/to/nextcloud/config/config.php User=www-data [Install] WantedBy = multi-user.target
Restart your service and you should be able to see some stats at
<your_nc_domain>:7868/metrics
I tried this and page times out. Perhaps that's why the notify_push service is not working. I thought maybe it's the port so opened it sudo ufw allow 7868/tcp
. Tried again, but page times out. My nc server sits behind a reverse proxy so perhaps that's the issue. I surmise I may have to add a location block to the reverse proxy, but unsure what the correct block would be.
You can on the server itself run e.g.
curl http://localhost:7868/metrics
which should return those stats without having to proxy them...
You can on the server itself run e.g.
curl http://localhost:7868/metrics
which should return those stats without having to proxy them...
Thanks. That works and output this:
active_connection_count 0 total_connection_count 0 mapping_query_count 6 event_count_total 240 message_count_total 0
This certainly confirms why it's not working. No active connections.
I tried a few things. Added this location block to my reverse proxy:
location /push/ { proxy_pass http://192.xxx.xxx.xx:7867/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }
Then opened the port on the nc server sudo ufw allow 7867/tcp
restarted the service sudo service notify_push restart
checked again and looking better:
curl http://localhost:7868/metrics
active_connection_count 3
total_connection_count 3
mapping_query_count 1
event_count_total 4
message_count_total 0
Though running the test_client still results in this output: Error: 0: capabilities response doesn't contain expect items, credentials are probably invalid
Quoting per s644 comment above: What I did to verify a successful push connection: Load the metrics page, start the client and reload the metrics page. If your client is connected via push, the connection count increases.
I checked metrics and had active_connection_count 3
Then logged in with new user on a different browser, then checked again and: active_connection_count 4
Logged off the new user and tested again and dropped back to 3 active_connection_count 3
self test fine:
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
So all tests pass. Everything appears to be working. I see the connections. Yet...
Then did a test with the 2 users using Talk. Neither receives notifications when sending chat messages to one another. Both using browsers, not mobile.
I set log level to debug: occ notify_push:log debug then, share files and initiate Talk chats. Checked log with sudo journalctl -eu notify_push
The log appears to show it's working, but users continue to not receive notifications. Is anyone else having this issue where the setup appears to be good, yet users not receiving notifications?
Did you try any other notification than talk notifications? Maybe it is an issue with the talk app if all other work...
Did you try any other notification than talk notifications? Maybe it is an issue with the talk app if all other work...
Yes, also with file share. And once again, seeing log activity, but no notifications.
This may be a larger issue as I noticed a new issue $62 opened up. It appears the same issue happening with landryb, who has done extensive testing on setup.