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

Error when opening app #65

Open
macjeff opened this issue Jul 11, 2022 · 24 comments
Open

Error when opening app #65

macjeff opened this issue Jul 11, 2022 · 24 comments

Comments

@macjeff
Copy link

macjeff commented Jul 11, 2022

I thought it was just cellular but its wifi also. It seems to be when the app is in the background and I open it up the error is on screen but then in about 5-10 seconds goes away (See screenshot).

I had the issue where the latest Python update crashed my ISY and Michel brought it back. That same day is when I started gett
image0
ing the errors BUT I think there was an app update also so dont know which one.

FYI- I am running iOS 16 beta 3 now (Came out today) And still doing it.

@macjeff
Copy link
Author

macjeff commented Jul 14, 2022

I noticed when its doing it under the ISY it says CLOSED instead of CONNECTED.
It may be an iOS 16 issue but it started after the big update with python changes and Michel had to rebuild my polisy.

@JavierRefuerzo
Copy link
Contributor

Hi Jeff,

Thanks. It's good to hear that the app/ISY are recovering from the error in less than 10 seconds. Does this only happens when app is in memory? If you swipe the app from recents before opening do you get the same error? It's possible iOS 16 is stopping network before the app closes the connection gracefully which causes an already subscribed (817) when reopening the app.

@macjeff
Copy link
Author

macjeff commented Jul 15, 2022

I have been testing and it did happen once after a fresh launch. WELL it happened in memory and I did the force quit. (Swipe up) and usually opening again works but this time it was stuck. A few min later tried again and it worked. Today I just tried and worked first time. Its so random.

@JavierRefuerzo
Copy link
Contributor

Thanks, at this point I think there is a low probability this is caused by iOS 16. Are you familiar with ISY logs?

First clear the error log from a browser:
http://ipaddress:port/rest/log/error?reset=true

Recreate the issue.

Get error log from a browser:
http://ipaddress:port/rest/log/error

@macjeff
Copy link
Author

macjeff commented Jul 15, 2022

One thing FYI. I have had issue since moving to ISY on Polisy where on port 8080 I get Already Subscribed. Michel said its a session eft open. At first I thought it was Homebridge but ruled that out. Then Pg3 but they said it does not. I thought maybe SSH sessions so I purposely used LOGOFF command. Its still doing it and I am thinking maybe its my phone losing internet with UD Mobile in the background.
That could explain because a session times out after a period so the already subscribed i get (only on 8080 not 8443) goes away if I try again in an hour.

But I cleared logs both using URL and inside admin console

When I opened UD Mobile I got the error. All I did is close app (NOT FORCE QUIT) and open back and 5 seconds later it went away.

this is all that is there

Fri 2022/07/15 11:37:48 AM	0	-170001	<s:Envelope><s:Body><u:UDIService xmlns:u="urn:udi-com:service:X_Polisy_Service:1"><control>DOF</control><action></action><flag>65531</flag><node>15 FA 86 1</node></u:UDIService></s:Body></s:Envelope>

Fri 2022/07/15 11:37:49 AM	0	-170001	<s:Envelope><s:Body><u:GetSystemStatus xmlns:u="urn:udi-com:service:X_Polisy_Service:1"></u:GetSystemStatus></s:Body></s:Envelope>

Fri 2022/07/15 11:38:26 AM	0	-170001	<s:Envelope><s:Body><u:Subscribe xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><reportURL>REUSE_SOCKET</reportURL><duration>infinite</duration></u:Subscribe></s:Body></s:Envelope>

Fri 2022/07/15 11:38:29 AM	0	-170001	<s:Envelope><s:Body><u:Subscribe xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><reportURL>REUSE_SOCKET</reportURL><duration>infinite</duration></u:Subscribe></s:Body></s:Envelope>

Fri 2022/07/15 11:38:36 AM	0	-170001	<s:Envelope><s:Body><u:Unsubscribe xmlns:u="urn:udicom:service:X_Insteon_Lighting_Service:1"><SID>uuid:107</SID></u:Unsubscribe></s:Body></s:Envelope>

Fri 2022/07/15 11:38:37 AM	0	-170001	<s:Envelope><s:Body><u:Subscribe xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><reportURL>REUSE_SOCKET</reportURL><duration>infinite</duration></u:Subscribe></s:Body></s:Envelope>

Fri 2022/07/15 11:39:12 AM	0	-170001	<s:Envelope><s:Body><u:GetCurrentSystemStatus xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><SID>uuid:0</SID></u:GetCurrentSystemStatus></s:Body></s:Envelope>

It just happened again a minute later after a force quit so we can rule out idle time

Fri 2022/07/15 11:40:34 AM	0	-170001	<s:Envelope><s:Body><u:Unsubscribe xmlns:u="urn:udicom:service:X_Insteon_Lighting_Service:1"><SID>uuid:108</SID></u:Unsubscribe></s:Body></s:Envelope>

Fri 2022/07/15 11:40:36 AM	0	-170001	<s:Envelope><s:Body><u:Subscribe xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><reportURL>REUSE_SOCKET</reportURL><duration>infinite</duration></u:Subscribe></s:Body></s:Envelope>

Fri 2022/07/15 11:40:40 AM	0	-170001	<s:Envelope><s:Body><u:Subscribe xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><reportURL>REUSE_SOCKET</reportURL><duration>infinite</duration></u:Subscribe></s:Body></s:Envelope>

Fri 2022/07/15 11:40:43 AM	0	-170001	<s:Envelope><s:Body><u:Subscribe xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><reportURL>REUSE_SOCKET</reportURL><duration>infinite</duration></u:Subscribe></s:Body></s:Envelope>

Fri 2022/07/15 11:40:46 AM	0	-170001	<s:Envelope><s:Body><u:Subscribe xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1"><reportURL>REUSE_SOCKET</reportURL><duration>infinite</duration></u:Subscribe></s:Body></s:Envelope>

**** I noticed a quick message flash by. Looked like redirecting or retrying or something. I will try and record a video of it.
GOT IT!!! attached

RPReplay_Final1657899763.MP4

@JavierRefuerzo
Copy link
Contributor

It appears there is something else requesting connections. Please swipe app from recents, close AC, clear error log, wait a few minutes, request error log. Do this without opening the app so we can see if there is something requesting subscriptions that is not the app.

Note: When pasting the error log add ``` before and after the log so chars are not removed.

@macjeff
Copy link
Author

macjeff commented Jul 15, 2022

This is the entire log after 20 min

Fri 2022/07/15 12:39:26 PM 0 -170001 <s:Envelope><s:Body><u:GetCurrentSystemStatus xmlns:u="urn:udi-com:service:X_Insteon_Lighting_Service:1">uuid:0</u:GetCurrentSystemStatus></s:Body></s:Envelope>

And that most likely was the app because I cleared log before I closed it.

Just opened the app and 6 more appeared.

@JavierRefuerzo
Copy link
Contributor

These are not necessarily errors, they are subscription attempts, but needed to see if there was a loop. Let's check the subscriptions, in the past we have had clients which held too many subscriptions causing the same 817 error. This appears very similar, although in the past ISY would not recover and all clients would be blocked from new subscriptions which required a reboot to reset all subscriptions. Are you running both PG2 and PG3? Some of the PG2 node servers utilizing PyISY where found to cause the issue (i.e HueEmulator but there may be others) and I'm unsure if it was resolved.

With AC and app closed what is the output of
http://address:port/rest/subscriptions

Now reboot ISY wait a few minutes to startup without opening AC or App and run rest/subscriptions again so we can see if something else is requesting a socket.

@macjeff
Copy link
Author

macjeff commented Jul 15, 2022 via email

@macjeff
Copy link
Author

macjeff commented Jul 15, 2022

This is BEFORE the ISY reboot. Doing Reboot now of ISY and will post in a bit

It disappears when I add comment so its a screen shot now
Screen Shot 2022-07-15 at 5 46 50 PM

@macjeff
Copy link
Author

macjeff commented Jul 15, 2022

this is after reboot

Screen Shot 2022-07-15 at 6 16 23 PM

@JavierRefuerzo
Copy link
Contributor

JavierRefuerzo commented Jul 15, 2022

Thanks Jeff.

The first screenshot shows 3 expired subscriptions which were not closed gracefully. Do you get the error in the app now?

The same call (rest/subscriptions) should show 1 isExpired="no" when the app is open with a socket id (sid) not equal to -1,. When the app is closed it should remove the same sid and change back to -1.

I see on the forum that ST-inventory is causing issues for other users. Do you have this NS installed?

@macjeff
Copy link
Author

macjeff commented Jul 15, 2022

I do use ST Inventory but on the forum all I see is that its crashing someones entire ISY. Thats not my issue

But as I said before on a regular basis I get already subscribed errors on port 8080 when connecting to IOP. so this could be it. I disabled it in Pg3 for now as its just an Info nodeserver. I dont really need it.

I will post in the forum about my issue but if you could point me to the topic so I dont start a second one and get yelled at (LOL) let me know.

Keep this open for now and I will let you know if I have the issue with ST Inventory off.

@macjeff
Copy link
Author

macjeff commented Jul 18, 2022

So I turned off ST Inventory for the weekend and zero errors. I saw a post saying to increase the short poll to 1 hour and long poll to 1 day so I did. Now its back on.

Right away the errors are back.

But I still dont see a post about ST Inventory not disconnecting gracefully. Can you send me a link? meanwhile I am creating my own!!!

@macjeff
Copy link
Author

macjeff commented Jul 18, 2022

@JavierRefuerzo
Copy link
Contributor

Hi Jeff,

Great. Thanks for isolating the issue.

I have not had time to look into ST-Inventory so it may be a different issue, although the issue appears similar to issues with PyISY. PyISY is a library used by some node servers to connect with ISY.

@macjeff
Copy link
Author

macjeff commented Jul 18, 2022

maybe you can chime in on my forum post. Have a feeling the developer is going want more info

@JavierRefuerzo
Copy link
Contributor

I've been following a few threads and tickets with similar issues. I think this may be related to a client request timeout for 994i while data transmission is in progress. While the 994i recovers most of the time within a minute, if there is a loop of large requests and timeouts this could cause abnormal behavior/crash, similar to a denial of service. The same issue may exist on Polisy but the system recovers in about 10 seconds and may drop request for graceful socket disconnect causing 817 (Already subscribed). I have asked simplex to check the timeout settings in ST-Inventory

@macjeff
Copy link
Author

macjeff commented Jul 20, 2022 via email

@macjeff
Copy link
Author

macjeff commented Aug 15, 2022

All of a sudden (And I was on vacation until yesterday and not touched the ISY) it started doing it today again. I did notice an update ran. Whats different this time is if I turn off wifi and run it as if its not local it works fine but locally it gives me same error. When I turn wifi back on after connecting locally it works until I quit the app and then I get the error again. And it does not recover anymore. Going to try rebooting the ISY. Tried rebooting phone with no luck.

** even though there is an error everything seems to work fine (except error at bottom- see image). I dont think before it would all work fine.

Also I turned off the ST Inventory and that did not fix this time

image
Screenshot 2022-08-14 at 10 12 41 PM

@macjeff
Copy link
Author

macjeff commented Aug 15, 2022

rebooting the ISY seems to have solved the issue but this is annoying and I hope we can narrow down a fix (assuming its not the app)

@JavierRefuerzo
Copy link
Contributor

If it happens again we can look at the logs. If an firmware update ran it's possible it did not start correctly after installation.

If everything was working, but the error was showing it may simply be the app failed to remove the error on reconnect (UI issue). The portal subscription does not use the normal subscription queue, this is the reason it works with portal event when the normal queue appears to be full. I still suspect there is another client subscribing or dropping connections.

@macjeff
Copy link
Author

macjeff commented Aug 15, 2022 via email

@JavierRefuerzo
Copy link
Contributor

Hi Jeff, It is likely there is another client trying to connect to the ISY or dropping connections. It does not appear to be related to the app as all users would have the issue. The app is one client and will attempt to close gracefully, but will show an error if the subscription queue is already full or inoperable which appears to be the case. If a node server, PG3, PG2, or some other client causes the issue where the ISY could not recover then nothing will happen until ISY reboot. So disabling after the fact may have no effect. If disabled and the issue does not present itself until enabled again there is a good chance the disabled client is causing the issue.

Somethings can be fixed in firmware, however if there is a client behaving poorly the client will need to be fixed or access disallowed.

When this happens I will need logs and instructions followed to help isolate the issue. If it's firmware Michel or Chris can take a look, if it's PG3 Bob can take a look, if it's PG2 it may need to be stopped as it is now deprecated, if it's a node server or a client not created by UD then the author will need to fix.

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

No branches or pull requests

2 participants