nextcloud / notify_push

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

Setup successfullly, but users not receiving notifications #50

Open whisperdancer opened 3 years ago

whisperdancer commented 3 years ago

Nextcloud Server: Nextcloud version (eg, 20.0.5): 21 Operating system and version (eg, Ubuntu 20.04): Raspbian GNU/Linux 10 (buster) Apache or nginx version (eg, Apache 2.4.25): nginx/1.14.2 PHP version (eg, 7.4): v7.4.15

Nginx Reverse Proxy ( on a separate physical server ):

Note, I have not added a location block to the nginx reverse proxy as I'm unsure the correct way to do that. I surmise that may be the issue of why it isn't working.

On the nextcloud server: I setup the notify_push service successfully. As least according to the setup wizard.

push server seems to be functioning correctly reverse proxy seems to be setup already reverse proxy seems to be setup correctly configuration saved.

I tested the service with sudo service notify_push status and it's active and running so all good there

I then tested with 2 users using Nextcloud Talk. User #1 initiates a conversation with User #2. User #2 does not receive a notification. User #1 mentions User #2 and User #2 does not receive a notification.

I checked the logs within nextcloud and no errors reported.

In your docs, you mention something about Metrics as a way to troubleshoot, but do not provide instructions for how to do that. Perhaps that would help troubleshoot. In addition, what do you suggest in terms of troubleshooting the issue.

Metrics The push server can expose some basic metrics about the number of connected clients and the traffic flowing through the server by setting the METRICS_PORT environment variable. Once set the metrics are available in a prometheus compatible format at /metrics on the configured port.

Thank you.

icewind1991 commented 3 years ago

You can run occ notify_push:self-test to re-do the setup tests to be sure.

You can download the test_client from https://github.com/nextcloud/notify_push/actions/runs/606033251 and run it as

test_client https://cloud.example.com username password

which will print a message every time a push notification is received. (If you have 2fa or a non-standard login you'll have to use an app password)

whisperdancer commented 3 years ago

I'd love to do this, but unsure how. Can you please provide instructions for how to install the test_client on my server?

Also, I ran the test you suggested and all passed

sudo -u www-data php 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

But users still not receiving notifications on Talk test

szaimen commented 3 years ago

The test client instructions were just updated: https://github.com/nextcloud/notify_push#test-client

whisperdancer commented 3 years ago

Please note: the Test client only works on x86_64 Linux currently.

Unfortunately, I don't have a server that can run the test client. Any other ideas on how I can troubleshoot this issue. Notifications are currently broken for all users.

Thanks

szaimen commented 3 years ago

It doesn't have to be a server it also can be any other PC or VM with x86_64 Linux. The important thing is that it can reach your server via https.

whisperdancer commented 3 years ago

The only Linux servers I have are Rasp Pi's. They are not x86_64. They are Arm7

szaimen commented 3 years ago

Yes, but the test_client doesn't need to get installed on your server!

whisperdancer commented 3 years ago

Would it work on a RaspPi4?

szaimen commented 3 years ago

Would it work on a RaspPi4?

No

So you have not even one PC with x86_64 architecture at hand? (you could e.g. also spin up a Linux VM on a x86_64 Windows PC)

whisperdancer commented 3 years ago

Yes, I have an intel I7 laptop running Win 10, but it's not Linux. All Linux stuff is done on the Pi's

szaimen commented 3 years ago

Okay, so in this case, just spin up a 64-bit Linux VM on the laptop and run the test_client there! Or you could also boot up 64-bit Linux from a USB-stick on that laptop and run the binary there.

whisperdancer commented 3 years ago

What do you suggest is the best way to spin up a 64 bit Linux VM on a Win 10 machine?

alerque commented 3 years ago

VirtualBox is an easy open source way. Running a LiveCD from an ISO image is pretty straight forward including a graphical UI. Docker is another way if you happen to use it for something else and have it already set up and keeps things simpler with just a shell interface. If you do this kind of stuff from Windows a lot you probably want to setup WSL, which would let you run this "natively" in your Windows environment.

whisperdancer commented 3 years ago

I currently don't have VirtualBox installed on my laptop, but can install it. How about Windows subsystem for Linux as on option?

szaimen commented 3 years ago

Yes, this should work, too. Here is an example guide: https://maurogiusti.medium.com/running-ubuntu-on-windows-10-with-wsl2-c4f06b3c353 (didn't test it myself)

alerque commented 3 years ago

How about Windows subsystem for Linux as on option?

I offered three possible solutions. WSL was one of them.

whisperdancer commented 3 years ago

I have another idea which I didn't initially think of. Can I spin up an Ubuntu 20.04 LTS instance on AWS Lightsail and use that to run the test client?

szaimen commented 3 years ago

That should theoretically work, too. But at least I have no experience in that.

whisperdancer commented 3 years ago

Good news! uname -mrs Linux 5.4.0-1030-aws x86_64

This should work, correct?

szaimen commented 3 years ago

If sudo uname -p returns x86_64 you are safe to go 👍

whisperdancer commented 3 years ago

Yay! sudo uname -p x86_64

whisperdancer commented 3 years ago

Ok, instance setup and verified x86_64. I ran into an issue. I tried to download the test client wget https://github.com/nextcloud/notify_push/suites/2162868561/artifacts/44388618

Resolving github.com (github.com)... 192.30.255.113 Connecting to github.com (github.com)|192.30.255.113|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2021-03-03 20:22:26 ERROR 404: Not Found.

Note, I'm not a rust developer so may need a bit of guidance on how to get this test-client setup and running. Thanks in advance!

szaimen commented 3 years ago

It seems like you need to be logged in to github to be able to download the file. So a simple wget won't work. Since that seems to be the case, I guess a Linux VM or e.g. WSL with GUI will be the better option.

whisperdancer commented 3 years ago

Can I download it to my windows laptop, then file transfer it to the instance?

szaimen commented 3 years ago

Yes, should also be possible via ssh. But I've myself never done that.

szaimen commented 3 years ago

Alternatively you could upload the file to your nextcloud, share it vial link (without password protection) and download the file using the public download link...

whisperdancer commented 3 years ago

I solved it. I used WinSCP and now have the file on my ubuntu server. Do I just run it like this: sudo ./test_client https://cloud.example.com username password or do I need to install any dependencies first?

szaimen commented 3 years ago

or do I need to install any dependencies first?

No

sudo ./test_client https://cloud.example.com username password

Yes, this should work. (though probably you need to use an app-password as password.)

whisperdancer commented 3 years ago

I created a test account on the server for just this purpose. No 2FA for this user. Do I need to first make test_client executable?

szaimen commented 3 years ago

Do I need to first make test_client executable?

Maybe. I actually haven't tried it myself, yet.

whisperdancer commented 3 years ago

Error: 0: notify_push app not enabled, invalid credentials or invalid capabilities response

Location: src/main.rs:66

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets.

Does this mean the notify_push is not reachable?

whisperdancer commented 3 years ago

Also wondering if the password should be surrounded with single quotes? Though I don't think so

szaimen commented 3 years ago

Maybe try the same again but like this? RUST_BACKTRACE=1 ./test_client https://cloud.example.com username password

whisperdancer commented 3 years ago

Hold on, I am trying to login with the new user and it's not letting me. I should have done that first

whisperdancer commented 3 years ago

This is super bizarre, I created a new user, but I can't log in with the new user.

szaimen commented 3 years ago

Did you try to login in a Browser?

whisperdancer commented 3 years ago

Did you try to login in a Browser?

Yes, and now it's throttling me We have detected multiple invalid login attempts from your IP. Therefore your next login is throttled up to 30 seconds.

whisperdancer commented 3 years ago

Bizarre, but something seems broken in NC 21 create user. The password entered does not work. I needed to reset password via email. Now I can login

szaimen commented 3 years ago

Could be incompatible apps...

whisperdancer commented 3 years ago

Could be incompatible apps...

Creating a new user is not an app. It's built in to nextcloud.

szaimen commented 3 years ago

But incompatible apps could theoretically break the login procedure

szaimen commented 3 years ago

Whatever, did you try this?

RUST_BACKTRACE=1 ./test_client https://cloud.example.com username password

whisperdancer commented 3 years ago

Yes, this is the output:

Error: 0: notify_push app not enabled, invalid credentials or invalid capabilities response

Location: src/main.rs:66

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⋮ 2 frames hidden ⋮
3: test_client::main::hf8775f5c792bc291 at : 4: std::sys_common::backtrace::__rust_begin_short_backtrace::h7af70a3509ccef1f at : 5: std::rt::lang_start::{{closure}}::hcf067eff17d7195d at : 6: core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h65b80f039f95d6c0 at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/ops/function.rs:259 7: std::panicking::try::do_call::hf8763061518851a7 at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:379 8: std::panicking::try::h3f18edcb296fdee2 at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:343 9: std::panic::catch_unwind::h2cebbafb152e18eb at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panic.rs:396 10: std::rt::lang_start_internal::h3f12d410dc128dff at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/rt.rs:51 11: main at :

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering. Run with RUST_BACKTRACE=full to include source snippets.

szaimen commented 3 years ago

And do you still get this?

Error: 0: notify_push app not enabled, invalid credentials or invalid capabilities response

whisperdancer commented 3 years ago

But incompatible apps could theoretically break the login procedure

good point as I noticed guest login with 2fa is broken in NC 21

whisperdancer commented 3 years ago

And do you still get this?

Error: 0: notify_push app not enabled, invalid credentials or invalid capabilities response

Yes, just updated previous output

szaimen commented 3 years ago

Hm... maybe try this next? RUST_BACKTRACE=full ./test_client https://cloud.example.com username password

szaimen commented 3 years ago

BTW: could you please share some more infos about your setup? I have the feeling that something else is broken here. I need the output of occ config:list system and occ app:list

whisperdancer commented 3 years ago

Ok, so this gets more interesting. I'm currently logged into browser with same user as running test. After running the output of the full backtrace a dialog popped in the browser asking for authorization. I can't see how to attach it so you can see it so I'll describe it. And nextcloud disabled the user.

https://ncdomain.com is requesting your username and password. The site says: “Authorisation Required” and has a textbox to enter username and textbox to enter password

Error: 0: notify_push app not enabled, invalid credentials or invalid capabilities r esponse

Location: src/main.rs:66

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━ ⋮ 2 frames hidden ⋮
3: test_client::main::hf8775f5c792bc291 at : 4: std::sys_common::backtrace::__rust_begin_short_backtrace::h7af70a3509ccef1 f at : 5: std::rt::lang_start::{{closure}}::hcf067eff17d7195d at : 6: core::ops::function::impls::<impl core::ops::function::FnOnce for &F>:: call_once::h65b80f039f95d6c0 at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/ops/fu nction.rs:259 7: std::panicking::try::do_call::hf8763061518851a7 at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicki ng.rs:379 8: std::panicking::try::h3f18edcb296fdee2 at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicki ng.rs:343 9: std::panic::catch_unwind::h2cebbafb152e18eb at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panic.r s:396 10: std::rt::lang_start_internal::h3f12d410dc128dff at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/rt.rs:5 1 11: main at :

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

szaimen commented 3 years ago

BTW: could you please share some more infos about your setup? I have the feeling that something else is broken here. I need the output of occ config:list system and occ app:list