Skip to content

onFailure: 401 error until manual reload

I didn't get a couple notifications that I was supposed to today so I took a look at logcat and saw a couple onFailure: 401 entries. I did a manual reload and it reconnected and I got the notifications.

I, then, took a look at the nginx log and realised that this failure started a couple days ago.

I don't think that it's connected to #7 (closed) as I haven't done any of the hacks mentioned in that issue and my network has been fine. Besides, the alarm manager should have forced a reconnect after a few failures.

I can't remember what and if I did anything at the time of start of the failures. I do remember updating my Nextcloud (minor update via docker) in the last week. Maybe that caused something ?

I do remember on a previous Nextcloud update, the ssepush app directory was removed (I probably force recreated the containers so my fault) but this time I checked post-update whether the app was installed and enabled and it was.

logcat (not much info)

[06-01 12:03:40.037 26549:26549 D/NC-EventReceiver]
Running onReceive

[06-01 12:03:40.054 25544:25544 D/NC-NotificationService]
Running onStartCommand

[06-01 12:03:40.055 25544:25544 D/NC-NotificationService]
REFRESH, pingtime: 1622328695696, currentTime: 1622541820055

[06-01 12:03:41.095 25544:31185 D/NC-NotificationService]
onFailure: 401

[06-01 12:18:40.114 26549:26549 D/NC-EventReceiver]
Running onReceive

[06-01 12:18:40.125 25544:25544 D/NC-NotificationService]
Running onStartCommand

[06-01 12:18:40.125 25544:25544 D/NC-NotificationService]
REFRESH, pingtime: 1622328695696, currentTime: 1622542720125

[06-01 12:18:41.374 25544:32723 D/NC-NotificationService]
onFailure: 401

## manual reload here ##
## got notifications ##

complete nginx log

172.20.0.6 - - [25/May/2021:20:17:29 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 502 157 "-" "okhttp/4.9.1" "XXX.XXX.128.246"
172.20.0.6 - - [26/May/2021:11:05:21 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 200 5519 "-" "okhttp/4.9.1" "XXX.XXX.128.246"
172.20.0.6 - - [26/May/2021:11:11:13 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 200 63 "-" "okhttp/4.9.1" "XXX.XXX.128.246"
172.20.0.6 - user [27/May/2021:04:53:17 +0200] "POST /ocs/v2.php/apps/notifications/api/v2/push?devicePublicKey=-----BEGIN+PUBLIC+KEY---- 201 1027 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.16.0" "XXX.XXX.129.46"
172.20.0.6 - admin [27/May/2021:04:53:18 +0200] "POST /ocs/v2.php/apps/notifications/api/v2/push?devicePublicKey=-----BEGIN+PUBLIC+KEY---- 201 1027 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.16.0" "XXX.XXX.129.46"
172.20.0.6 - admin [27/May/2021:04:53:18 +0200] "POST /index.php/apps/ssepush/authorize 200 36 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.16.0" "XXX.XXX.129.46"
172.20.0.6 - - [27/May/2021:04:53:18 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 200 6905 "-" "okhttp/4.9.1" "XXX.XXX.128.246"
172.20.0.6 - - [27/May/2021:09:48:18 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 200 1830 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.6 - - [27/May/2021:09:55:06 +0200] "POST /index.php/apps/ssepush/notifications HTTP/1.1" 200 28 "-" "Nextcloud Server Crawler" "172.20.0.1"
172.20.0.6 - - [27/May/2021:09:58:55 +0200] "POST /index.php/apps/ssepush/notifications HTTP/1.1" 200 28 "-" "Nextcloud Server Crawler" "172.20.0.1"
172.20.0.6 - - [28/May/2021:10:00:40 +0200] "POST /index.php/apps/ssepush/notifications HTTP/1.1" 200 28 "-" "Nextcloud Server Crawler" "172.20.0.1"
172.20.0.6 - - [28/May/2021:10:01:09 +0200] "POST /index.php/apps/ssepush/notifications HTTP/1.1" 200 28 "-" "Nextcloud Server Crawler" "172.20.0.1"
172.20.0.6 - - [30/May/2021:00:53:51 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 200 27633 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [30/May/2021:01:13:40 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [30/May/2021:01:28:41 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [30/May/2021:01:43:40 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"

## same thing repeated

172.20.0.4 - - [31/May/2021:08:28:39 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [31/May/2021:08:43:39 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [31/May/2021:08:58:39 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [31/May/2021:09:00:02 +0200] "POST /index.php/apps/ssepush/notifications HTTP/1.1" 200 118 "-" "Nextcloud Server Crawler" "172.20.0.1"
172.20.0.4 - - [31/May/2021:09:13:39 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [31/May/2021:09:28:39 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [31/May/2021:09:43:39 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"

## same thing repeated

172.20.0.4 - - [01/Jun/2021:11:33:39 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [01/Jun/2021:11:48:37 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [01/Jun/2021:12:03:37 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"
172.20.0.4 - - [01/Jun/2021:12:18:38 +0200] "POST /index.php/apps/ssepush/sse HTTP/1.1" 401 17 "-" "okhttp/4.9.1" "XXX.XXX.129.46"


## manual reload here; notifications start

(feel free to merge this with #7 (closed) if you think it's the same)