Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

SANdood
Senior Boarder
Senior Boarder
Posts: 57
Joined: Wed Jan 28, 2015 1:36 pm

Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**

Post by SANdood » Wed Aug 28, 2019 7:51 pm

Turns out that I can specify the timeout on Hubitat - will try that to see if it makes it easier for me to catch and handle the timeout...

Still, would like a valid HTTP Response Status instead of an empty string...

User avatar
staze
Expert Boarder
Expert Boarder
Posts: 96
Joined: Fri Jan 18, 2019 2:56 am
Contact:

Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8

Post by staze » Wed Aug 28, 2019 10:28 pm

I wonder why we'd enter this state at all... why is MB suddenly unable to, seemingly reliably, respond to these requests after some number of hours...
Davis Vantage Vue, Weather Envoy, Meteobridge Nano SD

SANdood
Senior Boarder
Senior Boarder
Posts: 57
Joined: Wed Jan 28, 2015 1:36 pm

Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8

Post by SANdood » Wed Aug 28, 2019 10:51 pm

@staze -

On my own MeteoBridge, I have 21 different uploads showing on my Live Data tab. In addition, I have 8 different FTP/HTML push items on my Services page. And 4 different local systems (ST, HE and rPi) each making template CGI requests every 1-2 minutes. All this on the relatively beastly TL-MR3020v3 platform.

From running my code, you know that it is taking 4-8 seconds for the MB to respond to the (optimized) HE template request (the original could take as long as 15 seconds to generate a response).

Although I don't believe that the MeteoBridge is single-threaded, 33 requests each taking 8+ seconds eventually has multiple requests being handled simultaneously, and apparently a large percentage of those have to go through the CGI Template responder. At some point something has to give...

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6001
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8

Post by admin » Wed Aug 28, 2019 11:51 pm

Just released update gives a 503/504 return code, if template evaluation does not work for any reason.

SANdood
Senior Boarder
Senior Boarder
Posts: 57
Joined: Wed Jan 28, 2015 1:36 pm

Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**

Post by SANdood » Thu Aug 29, 2019 12:28 am

AWESOME! Installing the update now.

I have extended the timeout to 20 seconds, and my code already checks for non-200 Status, so this should be easy to monitor. Hopefully, by not hitting the Hubitat timeout, things won't form the Read timeout log-jam any more...

I'll keep you posted, and THANKS SO MUCH!!!

User avatar
staze
Expert Boarder
Expert Boarder
Posts: 96
Joined: Fri Jan 18, 2019 2:56 am
Contact:

Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8

Post by staze » Thu Aug 29, 2019 12:49 am

SANdood wrote:
Wed Aug 28, 2019 10:51 pm
@staze -
Although I don't believe that the MeteoBridge is single-threaded, 33 requests each taking 8+ seconds eventually has multiple requests being handled simultaneously, and apparently a large percentage of those have to go through the CGI Template responder. At some point something has to give...
Totally. That said, my MB Nano should only have it's uploads, and just my Hubitat asking for template. I guess I'm unsure how the requests could be backing up at all (as mentioned, how they're continuing to fail once they start failing). =/

Could some variable on the MB be being set once that "null" is returned that causes it to just fail from then on out?
Davis Vantage Vue, Weather Envoy, Meteobridge Nano SD

SANdood
Senior Boarder
Senior Boarder
Posts: 57
Joined: Wed Jan 28, 2015 1:36 pm

Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**

Post by SANdood » Thu Aug 29, 2019 1:47 pm

New version of MB now with 3 template.cgi requestors every 60 seconds is running extremely well - I think the extended timeout on my side plus the new error responses from MB combine for a significant improvement.

My updated MeteoBridge Weather Station for SmartThings & Hubitat is available here: https://raw.githubusercontent.com/SANdo ... ion.groovy

SANdood
Senior Boarder
Senior Boarder
Posts: 57
Joined: Wed Jan 28, 2015 1:36 pm

Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8

Post by SANdood » Thu Aug 29, 2019 1:50 pm

admin wrote:
Wed Aug 28, 2019 11:51 pm
Just released update gives a 503/504 return code, if template evaluation does not work for any reason.
Is there a difference in the meaning between a 503 and a 504 Response Status?

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 6001
Joined: Mon Oct 01, 2007 10:51 pm

Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**

Post by admin » Sat Aug 31, 2019 11:35 am

504 is a time out, 503 indicates that operation cannot be started at all.

User avatar
staze
Expert Boarder
Expert Boarder
Posts: 96
Joined: Fri Jan 18, 2019 2:56 am
Contact:

Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**

Post by staze » Sat Aug 31, 2019 6:38 pm

Been up and running consistently (no reboots on either end) for several days now. Haven't seen a single 50x error.

Thanks Boris for making this change! =)
Davis Vantage Vue, Weather Envoy, Meteobridge Nano SD

Post Reply