Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] no calling notfication when using own ntfy push server #17269

Open
warioishere opened this issue Jun 5, 2024 · 6 comments
Open

[bug] no calling notfication when using own ntfy push server #17269

warioishere opened this issue Jun 5, 2024 · 6 comments

Comments

@warioishere
Copy link

warioishere commented Jun 5, 2024

Description

Hey, since a year I am having an issue that calling notifications dont work when using a own ntfy push server with our own matrix synapse server instance. Message notifications do work generally but as know by others not really reliable and with huge delays sometimes
Using an matrix.org with our own ntfy server do work , both on messages and both on calls.
We use a own coturnserver, I just switched from letsencrypt certs to zerossl certs as somebody suggested.

Still, we dont get call notifications to work. With Letsencrypt certs. nothing happens. With zerossl certs, elements crashes after opening the phone after a not notified call. I have been searching for almost a year now and nobody can help. I checked ntfy docks, checked with the devs there, my ntfy server seems to work. Also because it works with matrix.org servers.

This is the logs from element-android:

type: crash
osVersion: google/husky/husky:14/AP1A.240505.005/2024053100:user/release-keys
package: im.vector.app:40106142
process: im.vector.app
processUptime: 55946 + 249 ms
installer: org.fdroid.fdroid

java.lang.RuntimeException: Unable to start service im.vector.app.core.services.CallAndroidService@b58b5ec with Intent { act=im.vector.app.core.services.CallService.ACTION_CALL_TERMINATED cmp=im.vector.app/.core.services.CallAndroidService (has extras) }: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service im.vector.app/.core.services.CallAndroidService
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5079)
	at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2397)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8532)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service im.vector.app/.core.services.CallAndroidService
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
	at android.os.Parcel.readParcelableInternal(Parcel.java:5035)
	at android.os.Parcel.readParcelable(Parcel.java:5017)
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3186)
	at android.os.Parcel.createException(Parcel.java:3175)
	at android.os.Parcel.readException(Parcel.java:3151)
	at android.os.Parcel.readException(Parcel.java:3093)
	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6876)
	at android.app.Service.startForeground(Service.java:878)
	at androidx.work.impl.foreground.SystemForegroundService$Api29Impl$$ExternalSyntheticApiModelOutline0.m(R8$$SyntheticClass:1)
	at im.vector.app.core.extensions.ServiceKt.startForegroundCompat(Service.kt:31)
	at im.vector.app.core.extensions.ServiceKt.startForegroundCompat$default(Service.kt:6)
	at im.vector.app.core.services.CallAndroidService.handleUnexpectedState(CallAndroidService.kt:55)
	at im.vector.app.core.services.CallAndroidService.handleCallTerminated(CallAndroidService.kt:89)
	at im.vector.app.core.services.CallAndroidService.onStartCommand(CallAndroidService.kt:98)
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5061)
	... 11 more

This is the issue I openend on element-android to see more details:

element-hq/element-android#8761

I would be sooo happy to get this to work after months and almost years of trying. I always hoped, gonna be fixed with new synapse Versions. But not, nothing fixes our issue.

We are on latest synapse version, and latest f-droid element version

Thanks in advance

Steps to reproduce

Calling on matrix.org account with own ntfy server works, we get call notification
Calling on our own matrix instance (matrix.yourdevice.ch) doesnt work, no notification

Homeserver

matrix.yourdevice.ch

Synapse Version

{"server_version":"1.108.0"}

Installation Method

Debian packages from packages.matrix.org

Database

PostgresSQL

Workers

Single process

Platform

Ubuntu Server 22.04 virtualized on proxmox 8.2.2

Configuration

no

Relevant log output

type: crash
osVersion: google/husky/husky:14/AP1A.240505.005/2024053100:user/release-keys
package: im.vector.app:40106142
process: im.vector.app
processUptime: 55946 + 249 ms
installer: org.fdroid.fdroid

java.lang.RuntimeException: Unable to start service im.vector.app.core.services.CallAndroidService@b58b5ec with Intent { act=im.vector.app.core.services.CallService.ACTION_CALL_TERMINATED cmp=im.vector.app/.core.services.CallAndroidService (has extras) }: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service im.vector.app/.core.services.CallAndroidService
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5079)
	at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2397)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8532)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service im.vector.app/.core.services.CallAndroidService
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
	at android.os.Parcel.readParcelableInternal(Parcel.java:5035)
	at android.os.Parcel.readParcelable(Parcel.java:5017)
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3186)
	at android.os.Parcel.createException(Parcel.java:3175)
	at android.os.Parcel.readException(Parcel.java:3151)
	at android.os.Parcel.readException(Parcel.java:3093)
	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6876)
	at android.app.Service.startForeground(Service.java:878)
	at androidx.work.impl.foreground.SystemForegroundService$Api29Impl$$ExternalSyntheticApiModelOutline0.m(R8$$SyntheticClass:1)
	at im.vector.app.core.extensions.ServiceKt.startForegroundCompat(Service.kt:31)
	at im.vector.app.core.extensions.ServiceKt.startForegroundCompat$default(Service.kt:6)
	at im.vector.app.core.services.CallAndroidService.handleUnexpectedState(CallAndroidService.kt:55)
	at im.vector.app.core.services.CallAndroidService.handleCallTerminated(CallAndroidService.kt:89)
	at im.vector.app.core.services.CallAndroidService.onStartCommand(CallAndroidService.kt:98)
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5061)
	... 11 more

Anything else that would be useful to know?

No response

@warioishere warioishere changed the title [help_request] no notfication when using own ntfy push server [help_request] no calling notfication when using own ntfy push server Jun 5, 2024
@warioishere
Copy link
Author

additional info, our coturn server should work without problems:

turnutils_uclient -p 5349 -W xyz -v -y coturn.mydomain.ch
0: : IPv4. Connected from: 192.168.1.84:39630
0: : IPv4. Connected from: 192.168.1.84:39630
0: : IPv4. Connected to: 82.165.65.57:5349
0: : allocate sent
0: : allocate response received: 
0: : allocate sent
0: : allocate response received: 
0: : success
0: : IPv4. Received relay addr: 82.165.65.57:56644
0: : clnet_allocate: rtv=14186039741895531052
0: : refresh sent
0: : refresh response received: 
0: : success
0: : IPv4. Connected from: 192.168.1.84:34058
0: : IPv4. Connected to: 82.165.65.57:5349
0: : IPv4. Connected from: 192.168.1.84:33738
0: : IPv4. Connected to: 82.165.65.57:5349
0: : IPv4. Connected from: 192.168.1.84:45996
0: : IPv4. Connected to: 82.165.65.57:5349
0: : IPv4. Connected from: 192.168.1.84:49300
0: : IPv4. Connected to: 82.165.65.57:5349
0: : allocate sent
0: : allocate response received: 
0: : allocate sent
0: : allocate response received: 
0: : success
0: : IPv4. Received relay addr: 82.165.65.57:56645
0: : clnet_allocate: rtv=0
0: : refresh sent
0: : refresh response received: 
0: : success
0: : allocate sent
0: : allocate response received: 
0: : allocate sent
0: : allocate response received: 
0: : success
0: : IPv4. Received relay addr: 82.165.65.57:55852
0: : clnet_allocate: rtv=6301046898216256877
0: : refresh sent
0: : refresh response received: 
0: : success
0: : allocate sent
0: : allocate response received: 
0: : allocate sent
0: : allocate response received: 
0: : success
0: : IPv4. Received relay addr: 82.165.65.57:55853
0: : clnet_allocate: rtv=0
0: : refresh sent
0: : refresh response received: 
0: : success
0: : allocate sent
0: : allocate response received: 
0: : allocate sent
0: : allocate response received: 
0: : success
0: : IPv4. Received relay addr: 82.165.65.57:58186
0: : clnet_allocate: rtv=5524863492269791289
0: : refresh sent
0: : refresh response received: 
0: : success
0: : channel bind sent
1: : cb response received: 
1: : success: 0x5b52
1: : channel bind sent
1: : cb response received: 
1: : success: 0x5a83
1: : channel bind sent
1: : cb response received: 
1: : success: 0x4cb1
1: : channel bind sent
1: : cb response received: 
1: : success: 0x7375
1: : Total connect time is 1
1: : start_mclient: msz=4, tot_send_msgs=0, tot_recv_msgs=0, tot_send_bytes ~ 0, tot_recv_bytes ~ 0
2: : start_mclient: msz=4, tot_send_msgs=0, tot_recv_msgs=0, tot_send_bytes ~ 0, tot_recv_bytes ~ 0
3: : start_mclient: msz=4, tot_send_msgs=0, tot_recv_msgs=0, tot_send_bytes ~ 0, tot_recv_bytes ~ 0
4: : start_mclient: msz=4, tot_send_msgs=10, tot_recv_msgs=10, tot_send_bytes ~ 1000, tot_recv_bytes ~ 1000
5: : start_mclient: msz=4, tot_send_msgs=10, tot_recv_msgs=10, tot_send_bytes ~ 1000, tot_recv_bytes ~ 1000
6: : start_mclient: msz=4, tot_send_msgs=15, tot_recv_msgs=15, tot_send_bytes ~ 1500, tot_recv_bytes ~ 1500
6: : done, connection 0x740d1c77d010 closed.
6: : done, connection 0x740d1c75c010 closed.
6: : done, connection 0x740d1c73b010 closed.
6: : done, connection 0x740d1c71a010 closed.
7: : start_mclient: tot_send_msgs=20, tot_recv_msgs=20
7: : start_mclient: tot_send_bytes ~ 2000, tot_recv_bytes ~ 2000
7: : Total transmit time is 6
7: : Total lost packets 0 (0.000000%), total send dropped 0 (0.000000%)
7: : Average round trip delay 35.700000 ms; min = 31 ms, max = 39 ms
7: : Average jitter 2.000000 ms; min = 0 ms, max = 5 ms

@warioishere
Copy link
Author

warioishere commented Jun 8, 2024

can someone of the devs maybe just give an answer on this issue, its been ages that this persists and noone is getting an answer. I was supporting matrix developtment with donations from time to time and my opinion ist hat the matrix-synapse is very important for a free and independent messaging communication system worldwide. I am just slowly pissed that this this important topic is not getting any attention anymore.

Why do you guys just leave every topic behind that is pointing at this thing. Why do you devs just keep low on that? Do you want us to use google's FCM so they know whom we are in contact with? Maybe you can give people a little hint on whats going on we are staying motivated. I slowly drop my interesst if this persists.

@warioishere warioishere changed the title [help_request] no calling notfication when using own ntfy push server [bug] no calling notfication when using own ntfy push server Jun 12, 2024
@warioishere
Copy link
Author

unbelieveable that still noone of the whole matrix team can leave a comment here. I will definitly stop my monthly donations and start looking to put my effort on a messenger system with working notifications

@S7evinK
Copy link
Contributor

S7evinK commented Jul 19, 2024

According https://developer.android.com/develop/background-work/services/foreground-services#background-start-restriction-exemptions, a background service is not allowed to start a foreground service. There may be workarounds, but that would need to be implemented in Element Android.

I'm surprised that it works when using a matrix.org server, can you double check it is indeed using your ntfy server?

Element Android is unfortunately in maintenance mode and only receiving security fixes. In the mean time, you can try using Element X Android. Unfortunately, that means setting up the Sliding Sync Proxy (at the time of writing), but Synapse is getting a native implementation soon as well.

@warioishere
Copy link
Author

According https://developer.android.com/develop/background-work/services/foreground-services#background-start-restriction-exemptions, a background service is not allowed to start a foreground service. There may be workarounds, but that would need to be implemented in Element Android.

I'm surprised that it works when using a matrix.org server, can you double check it is indeed using your ntfy server?

Element Android is unfortunately in maintenance mode and only receiving security fixes. In the mean time, you can try using Element X Android. Unfortunately, that means setting up the Sliding Sync Proxy (at the time of writing), but Synapse is getting a native implementation soon as well.

How should I try with element-x? It doesnt support calling yet.

@warioishere
Copy link
Author

warioishere commented Oct 6, 2024

again, push setup should work. But I dont get a calling notification and message notifications are heavily delayed, it aleast it message notfications used to work a while ago almost on time, but now, again 30min delay until notfications are received.

these are response I get on my matrix server when I receive a message, I see on the desktop app, that they arrive, but mobile chooses to stay quiet.

2024-10-06 10:09:07,417 - synapse.push.httppusher - 236 - INFO - httppush.process-8679 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upRfmKVtd7pBP9?up=1 starting at stream_ordering 1753670
2024-10-06 10:09:07,417 - synapse.push.httppusher - 236 - INFO - httppush.process-8680 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upOpna7Q1rvIi1?up=1 starting at stream_ordering 1753670
2024-10-06 10:09:07,419 - synapse.push.httppusher - 236 - INFO - httppush.process-8681 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upY7KEE1gg3Xgx?up=1 starting at stream_ordering 1753670
2024-10-06 10:09:07,419 - synapse.push.httppusher - 236 - INFO - httppush.process-8678 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upvnGFStGzxUfC?up=1 starting at stream_ordering 1753670
2024-10-06 10:09:07,443 - synapse.http.client - 428 - INFO - httppush.process-8681 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:09:07,448 - synapse.http.client - 428 - INFO - httppush.process-8679 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:09:07,451 - synapse.http.client - 428 - INFO - httppush.process-8678 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:09:07,462 - synapse.http.client - 428 - INFO - httppush.process-8680 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:09:39,233 - synapse.push.httppusher - 236 - INFO - httppush.process-8682 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upvnGFStGzxUfC?up=1 starting at stream_ordering 1753689
2024-10-06 10:09:39,235 - synapse.push.httppusher - 236 - INFO - httppush.process-8684 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upOpna7Q1rvIi1?up=1 starting at stream_ordering 1753689
2024-10-06 10:09:39,235 - synapse.push.httppusher - 236 - INFO - httppush.process-8683 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upRfmKVtd7pBP9?up=1 starting at stream_ordering 1753689
2024-10-06 10:09:39,235 - synapse.push.httppusher - 236 - INFO - httppush.process-8685 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upY7KEE1gg3Xgx?up=1 starting at stream_ordering 1753689
2024-10-06 10:11:17,573 - synapse.push.httppusher - 236 - INFO - httppush.process-8689 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upY7KEE1gg3Xgx?up=1 starting at stream_ordering 1753689
2024-10-06 10:11:17,574 - synapse.push.httppusher - 236 - INFO - httppush.process-8688 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upOpna7Q1rvIi1?up=1 starting at stream_ordering 1753689
2024-10-06 10:11:17,574 - synapse.push.httppusher - 236 - INFO - httppush.process-8687 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upRfmKVtd7pBP9?up=1 starting at stream_ordering 1753689
2024-10-06 10:11:17,574 - synapse.push.httppusher - 236 - INFO - httppush.process-8686 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upvnGFStGzxUfC?up=1 starting at stream_ordering 1753689
2024-10-06 10:11:17,608 - synapse.http.client - 428 - INFO - httppush.process-8686 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:17,611 - synapse.http.client - 428 - INFO - httppush.process-8688 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:17,615 - synapse.http.client - 428 - INFO - httppush.process-8687 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:17,627 - synapse.http.client - 428 - INFO - httppush.process-8689 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:18,056 - synapse.push.httppusher - 236 - INFO - httppush.process-8690 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upvnGFStGzxUfC?up=1 starting at stream_ordering 1753696
2024-10-06 10:11:18,058 - synapse.push.httppusher - 236 - INFO - httppush.process-8691 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upRfmKVtd7pBP9?up=1 starting at stream_ordering 1753696
2024-10-06 10:11:18,058 - synapse.push.httppusher - 236 - INFO - httppush.process-8693 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upY7KEE1gg3Xgx?up=1 starting at stream_ordering 1753696
2024-10-06 10:11:18,059 - synapse.push.httppusher - 236 - INFO - httppush.process-8692 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upOpna7Q1rvIi1?up=1 starting at stream_ordering 1753696
2024-10-06 10:11:18,071 - synapse.http.client - 428 - INFO - httppush.process-8690 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:18,074 - synapse.http.client - 428 - INFO - httppush.process-8691 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:18,079 - synapse.http.client - 428 - INFO - httppush.process-8692 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:18,090 - synapse.http.client - 428 - INFO - httppush.process-8693 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:18,293 - synapse.push.httppusher

Why does it work on time and without delay with google? With both apps, element and element-x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants