jangxx/SchubsiGo

A permanent error occurred. You need to relogin after the application is closed

Closed this issue · 4 comments

The program worked perfectly for a while, then it started to spam me with "A permanent error occurred. You need to re-login after the application is closed" messages.

Here is what I see in the terminal:

(SchubsiGo:601832): Gtk-CRITICAL **: 15:22:20.276: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
2020/05/07 15:22:20 Successfully restored Pushover login & device registration
2020/05/07 15:22:20 Server is listening on localhost:33322
2020/05/08 04:53:12 websocket: close 1001 (going away): CloudFlare WebSocket proxy restarting
2020/05/08 04:53:12 Error was not network related, but we are registered; retry in 15 seconds
2020/05/08 04:53:27 Retrying connection
2020/05/08 06:43:30 websocket: close 1006 (abnormal closure): unexpected EOF
2020/05/08 06:43:30 Error was not network related, but we are registered; retry in 15 seconds
2020/05/08 06:43:45 Retrying connection
2020/05/08 10:43:21 read tcp 192.168.0.101:44032->104.20.125.71:443: read: connection reset by peer
2020/05/08 10:43:21 Error was network related, retry in 15 seconds
2020/05/08 10:43:36 Retrying connection
2020/05/08 10:45:07 read tcp 192.168.0.101:47458->104.20.125.71:443: read: connection reset by peer
2020/05/08 10:45:07 Error was network related, retry in 15 seconds
2020/05/08 10:45:22 Retrying connection
2020/05/08 10:50:09 read tcp 192.168.0.101:55060->104.20.124.71:443: read: connection reset by peer
2020/05/08 10:50:09 Error was network related, retry in 15 seconds
2020/05/08 10:50:24 Retrying connection
2020/05/08 10:50:24 Received error frame
2020/05/08 10:50:24 Error was not network related, but we are registered; retry in 15 seconds
2020/05/08 10:50:39 Retrying connection
2020/05/08 10:50:40 Received error frame
2020/05/08 10:50:40 Error was not network related, but we are registered; retry in 15 seconds
2020/05/08 10:50:55 Retrying connection
2020/05/08 10:50:56 Received error frame
2020/05/08 10:50:56 Error was not network related, but we are registered; retry in 15 seconds

So I've closed the app. Visited http://localhost:33322/ logged out and tried to login again. It accepted my login / password, but when I tried to register a device nothing happened. In the network panel I see a pending request to http://localhost:33322/api/register I waited for a few minutes but it's still pending. Though I see in pushover console that the new device is actually registered.

And that's what I see in the terminal after I restarted the app:

(SchubsiGo:625300): Gtk-CRITICAL **: 10:59:31.176: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
2020/05/08 10:59:31 Successfully restored Pushover login & device registration
2020/05/08 10:59:31 Server is listening on localhost:33322
2020/05/08 10:59:33 Received error frame
2020/05/08 10:59:33 Error was not network related, but we are registered; retry in 15 seconds
2020/05/08 10:59:48 Retrying connection
2020/05/08 11:00:04 read tcp 192.168.0.101:47870->104.20.125.71:443: use of closed network connection
2020/05/08 11:00:04 Error was network related, retry in 15 seconds
2020/05/08 11:00:19 Retrying connection
2020/05/08 11:03:20 read tcp 192.168.0.101:55440->104.20.124.71:443: read: connection reset by peer
2020/05/08 11:03:20 Error was network related, retry in 15 seconds
2020/05/08 11:03:35 Retrying connection
2020/05/08 11:05:21 read tcp 192.168.0.101:55930->104.20.124.71:443: read: connection reset by peer
2020/05/08 11:05:21 Error was network related, retry in 15 seconds
2020/05/08 11:05:36 Retrying connection
2020/05/08 11:05:37 Received error frame
2020/05/08 11:05:37 Error was not network related, but we are registered; retry in 15 seconds
2020/05/08 11:05:52 Retrying connection
2020/05/08 11:05:53 Received error frame
2020/05/08 11:05:53 Error was not network related, but we are registered; retry in 15 seconds
2020/05/08 11:06:08 Retrying connection

And after a while, I started seeing more "A permanent error occurred. You need to re-login after the application is closed" notifications.

Looks like I handled the error frame incorrectly. It should automatically reset the settings and quit the program instead of trying to reconnect. I'm not actually sure how you got the pushover server to send you and error frame however - I've never encountered one, which is the reason why this functionality does not work properly. As a workaround you can probably remove the device on the pushover website, delete the settings.json and start over fresh until I find time to finish the update, but I'm still curious what you did to get the error frame in the first place.

Edit: I guess I misread your post - The registration adds a new device already. I have absolutely no idea how a request to the /api/register could ever hang though. All it does is sending a request to the pushover server and setting some stuff up. Even if the pushover server would not answer the request, it should timeout after a while instead of hanging indefinitely.

But where is the settings.json file located?

As for the possible reason - frankly, no idea. Launched the app, sent a few notifications to make sure it works and forgot about it till the next morning. Perhaps it has something to do with my PC going into sleep mode?

The settings.json is located in your user config directory and then in /literalchaos/schubsigo/. On Linux this should be in ~/.config, so ~/.config/literalchaos/schubsigo/settings.json should be the full path.

I don't think the error has something to do with your PC going into sleep mode. The error frame should only be sent if a permanent, server-side error occurs. From the specification:

E - Error; a permanent problem occured and you should not automatically re-connect. Prompt the user to login again or re-enable the device.

Maybe there is a limit on how many clients you can register or maybe the pushover server didn't like you for some other reason, but your PC going into sleep mode is probably not the cause for the error frame.

Version 1.2.0 should improve the handling of the error frame (i.e. it actually logs you out properly), but that still does not explain why the error frames are sent in the first place. If the problem persists, you might want to contact the pushover support or something, since the "problem" seems to be on their end.