Jump to content

Notification


BobFrankston

Recommended Posts

  • 11 months later...
Posted

Hi,

I think Michel was wondering about the 815 (MAX Subscribers Reached). 

I actually hit that problem also, on and off. And a reboot is the only way out, as far as I know. And I have seen someone else on the forum complaining about this also.

What I do is to create a subscription. If the subscription seems broken, I close it and re-subscribe. I decide that the subscription is broken when heartbeats are missing and/or variable updates are not being reported via the event stream. Once in a while, I end up with and ISY subscription state like this:

<Subscriptions>
<Sub isExpired="no" isPortal="no" sid="52" sock="31" isReusingSocket="yes" isConnecting="no"/>
<Sub isExpired="no" isPortal="no" sid="36" sock="27" isReusingSocket="yes" isConnecting="no"/>
<Sub isExpired="no" isPortal="no" sid="57" sock="15" isReusingSocket="yes" isConnecting="no"/>
<Sub isExpired="no" isPortal="no" sid="37" sock="22" isReusingSocket="yes" isConnecting="no"/>
<Sub isExpired="no" isPortal="no" sid="38" sock="44" isReusingSocket="yes" isConnecting="no"/>
<Sub isExpired="no" isPortal="no" sid="41" sock="21" isReusingSocket="yes" isConnecting="no"/>
<Sub isExpired="no" isPortal="no" sid="42" sock="19" isReusingSocket="yes" isConnecting="no"/>
<Sub isExpired="no" isPortal="no" sid="43" sock="23" isReusingSocket="yes" isConnecting="no"/>
<Sub isExpired="no" isPortal="no" sid="44" sock="26" isReusingSocket="yes" isConnecting="no"/>
<Sub isExpired="no" isPortal="no" sid="45" sock="45" isReusingSocket="yes" isConnecting="no"/>
</Subscriptions>
 
Note that even the portal is not subscribed anymore. This state persists until I reboot the ISY.
This is what I think is contributing to the problem:
- I believe that the ISY must be bogged down to start the chain of events leading to this problem. I have seen heartbeats missing for 3 minutes.
- When my program decides to unsubscribe and resubscribe, the ISY might return 817 (already subscribed). My program treats 817 and a failure; can I do something better?
- Even though my program spaces out the retries (30 seconds or so), the ISY doesn't seem to be able to recover and gets stuck in the 'max subscribes reached'.
 
Any insight is appreciated.
 
Bert

 

  • 3 weeks later...
Posted

I'm getting this state, immediately after rebooting:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Subscriptions>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
</Subscriptions>

Is this expected?

-Tom

Posted

@Michel Kohanim:

I just shut down CQC and rebooted the ISY.  I get the same response.

Maybe this is what it's supposed to say?  Does it always return a list of 10?

I'm trying to get the latest PyISY example program to run.  It starts out OK by dumping the node list, but then it's supposed to stay in a loop where it reports events.  Instead, it keeps telling me it has reached the subscription limit, then disconnects for 60 seconds and tries again, over and over.  Sounded similar to what's going on here, so I thought I'd reply

.We're trying to figure out what's wrong.  The thread is over here:

 

Posted

Another similarity to this thread is that I do have some legacy web server code on the ISY.  It was written long ago as an interface to the ISY - you put your lights in the old rooms interface and this web server dished up a graphical representation for controlling your lights.  I forget what it was called, but Michel, you might remember.  I don't access it anymore, however, because somewhere along the line a firmware update broke it.  But I can remove it if you think it would help.

 

-Tom

Posted

@xlurkr,

Not really sure what I am checking out. I had already read your post fully before. The only thing I didn't answer is: yes, it will return 10 all the time. The bottom line is this: something is subscribing to ISY but it's not releasing the subscription. Not really sure how to debug this except shutting things down one at a time and see whether or not there are any improvements.

 

With kind regards,
Michel

Posted

@Michel Kohanim:

OK, thanks.  I think I'll make a private network with just the ISY and my laptop and reboot the ISY to see what happens then.

What should the 10 lines look like if no one is subscribed to the ISY?  The lines I copied above were what the ISY returned literally seconds after rebooting.

-Tom

Posted

@Michel Kohanim@shbatm:

Today I disconnected my ISY from the rest of my network and made a private network with just my laptop and the ISY.  I rebooted it, connected via the console, and got the following response back from /rest/subscriptions:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Subscriptions>
<Sub isConnecting="no" isReusingSocket="yes" sock="32" sid="26" isPortal="no" isExpired="no"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
</Subscriptions>

I launched PyCharm, and ran the PyISY connection_test.py program.  It timed out like before, with the too many subscribers error.  I power-cycled the ISY and repeated, except this time I didn't launch the console.  I got this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Subscriptions>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
</Subscriptions>

connection_test.py kept timing out as before.

Seems to me, either the program is doing something wrong, or there's something about the state of the ISY that's out of whack, causing the program to fail to subscribe.

Michel, are the responses above what I should expect if nothing is trying to subscribe to the ISY?  What is the normal line that should be returned from a freshly-restarted ISY?

-Tom

Posted
8 hours ago, xlurkr said:

Yes.  Why?

-Tom

Just checking.  I've seen errors, problems when people try to setup connections or even Polyglot and do not have the ISY Network Module (it's required) and spend lots of time troubleshooting and then it comes down to no they actually don't have the network module.

Posted

@xlurkr,

You got that error when /rest/subscription returns this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Subscriptions>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
<Sub isConnecting="no" isReusingSocket="no" sock="-1" sid="-1" isPortal="no" isExpired="yes"/>
</Subscriptions>

With kind regards,
Michel

Posted

@Michel Kohanim:

I still don't know if what /rest/subscriptions is returning is what you would expect on a just-rebooted ISY with no subscribers.  Is it?  If not, what should I be seeing, and what do you recommend I do to return it to that state?

-Tom

Posted

Hi Michel,

Going back to my comment/question from April 29.

I probably was not clear enough.

Most of the time, if a subscription is 'bad', I unsubscribe and resubscribe successfully. And the ISY behaves properly.

Sometimes (every 4 months or so), the ISY doesn't behave properly and the result is that the ISY runs out of subscriber slots and never reclaims them (i.e. I wait for 12 hours without any change in the ISY subscriber state), forcing me to reboot. This "not behaving properly" is accompanied by errors 817 from subscribe, which I don't know what to do with except to treat it as a failed subscribe and try again. It is also accompanied by the ISY being very busy to the point that heartbeats are missed for up to 3 minutes.

Is there anything better I can do with error 817?

Also, I got into the same bad situation today again. The interesting thing is that I noticed "out of memory" in the summary page of the programs.I didn't find a clear answer in the forum, but I deleted a bunch of programs and any "out of memory" is gone now. After that, I got into the bad situation where the ISY doesn't reclaim subscription slots. So I suspect that this problem is somehow related to the "out of memory". Note that my usage is not excessive compared to what I read in the forum: I have about 200 PLM links, 180 programs, 250 (sub)devices (insteon, zwave, nodeserver items)

Interestingly, the Admin Console also got "already subscribed" error, so it doesn't know what to do with that error either...

I'm rebooting my ISY now.

Your insight is appreciated.

Bert

Posted

@Bert2013:

If Michel won't answer, can you help me?  You've seen what /rest/subscription is returning on my ISY.  Would you expect it to throw an error if PyISY attempted to subscribe?  Can you tell me what /rest/subscriptions should return if there are no subscribers?  So far, all I've gotten is people asking me to provide the information, and telling me (I think) that I shouldn't be seeing what I'm seeing, without telling me what's wrong with the response, what a correct response looks like, and most importantly, what I should do to my ISY to fix it.

-Tom

Posted

xlurkr,

If sid == -1 and/or isExpired == 'yes' then that entry is free. Most of what you have shows that pretty much everything is free. Look at mine and you see that none of them are free, resulting in 'Max subscribers reached' when anything tries to subscribe at that time.

There is most likely something wrong with your python code, of with PyISY itself. You should debug where your error comes from and what your error is exactly.  'Max subscribers reached' is error 815 while 'Already subscribed' is error 817.

Bert

 

Posted

Hi @Bert2013,

The only reason subscriptions do not expire is because the end client is still responding to heartbeat events. Next time you see this issue, unplug your client, wait a while (sometimes, it could be up to 14 hours = TCP fin_wait timeout) and see whether or not the subscriptions clear.

@xlurkr, precisely what @Bert2013 said.

With kind regards,
Michel

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...