MB Nano "Timeout in headers"

Post Reply
staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

MB Nano "Timeout in headers"

Post by staze » Tue Mar 26, 2019 3:58 am

Hi All,

Wondering if anyone else is seeing this. I have my Meteobridge Nano pushing to MT via the api.php. And I frequently see it error with "Error: Meteotemplate: Read error (Operation timed out) in headers." for MT.

Meteobridge dev says this is because my internet is slow. Which... it isn't. Unless there's something odd going on.

But I'm curious if anyone else has seen this, how I can try to figure out what's up, etc.

I do have my site behind Cloudflare, but I have my Meteobridge talking to MT through a non-accelerated (direct) DNS entry.

Thanks!
Last edited by staze on Wed Apr 03, 2019 9:16 pm, edited 1 time in total.

mchd17
Forecaster
Forecaster
Posts: 196
Joined: Sat Mar 17, 2018 2:01 am
Location: Illinois
Station model: Davis Pro2 Plus
Software: Meteobridge

Re: MB Nano "Timeout in headers"

Post by mchd17 » Tue Mar 26, 2019 10:10 pm

running two nanos here, no problem. you sure you have api url correct? pw correct?

maybe, disable mt upload, save, reboot nano. enable mt upload, save, see what happens. just saying things i would be trying.
Image

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Wed Apr 03, 2019 7:08 pm

mchd17 wrote: Tue Mar 26, 2019 10:10 pm running two nanos here, no problem. you sure you have api url correct? pw correct?

maybe, disable mt upload, save, reboot nano. enable mt upload, save, see what happens. just saying things i would be trying.
API is correct. PW is correct. It works "MOST" of the time, but randomly fails. I've got Cloudflare infront of my site, but I'm bypassing that to do API updates.

It could be some hosting issue, but I've got no place to start. Is there any good way to turn on some debugging, or...?

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Wed Apr 03, 2019 7:12 pm

Are you using the Meteotemplate "Weather Network" to push, or are you using a service?

mchd17
Forecaster
Forecaster
Posts: 196
Joined: Sat Mar 17, 2018 2:01 am
Location: Illinois
Station model: Davis Pro2 Plus
Software: Meteobridge

Re: MB Nano "Timeout in headers"

Post by mchd17 » Sat Apr 13, 2019 12:35 am

sorry for late response, using mb to push to mt
Image

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Sat Apr 13, 2019 1:08 am

mchd17 wrote: Sat Apr 13, 2019 12:35 am sorry for late response, using mb to push to mt
sorry, I mean, are you using the weather networks function (in meteobridge) to push to API, or are you using a service (in meteobridge) to push?

mchd17
Forecaster
Forecaster
Posts: 196
Joined: Sat Mar 17, 2018 2:01 am
Location: Illinois
Station model: Davis Pro2 Plus
Software: Meteobridge

Re: MB Nano "Timeout in headers"

Post by mchd17 » Sun Apr 14, 2019 10:20 pm

weather networks function, i see on the mb forums you are still having issues, that sucks and hope you can get it fixed soon. you think it's your server? i have a mt test site, wanna try that api and see how your mb works? send me a pm
Image

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Mon Apr 15, 2019 3:10 am

I don't think it's my server, honestly. I don't know what the issue is. It's behaving better since I have it updating once per minute rather than once every 5 minutes... but is still occasionally failing. And Boris has no helpful input on trying to troubleshoot. And not getting really any assistance on this end either. There aren't any errors other than this... nothing server side, no PHP errors, etc.

Super frustrating.

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Mon Apr 15, 2019 8:00 pm

Finally found a lot of when it's timing out.

Code: Select all

2019-04-15 12:45:44 Error: 2019-04-15 12:45:31 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 12:40:39 Error: 2019-04-15 12:40:25 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 12:35:14 Error: 2019-04-15 12:35:01 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 12:30:16 Error: 2019-04-15 12:30:00 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 12:26:08 Error: 2019-04-15 12:25:53 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 12:20:46 Error: 2019-04-15 12:20:31 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 12:15:42 Error: 2019-04-15 12:15:28 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 12:10:43 Error: 2019-04-15 12:10:28 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 12:05:33 Error: 2019-04-15 12:05:18 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 12:00:29 Error: 2019-04-15 12:00:14 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 11:55:16 Error: 2019-04-15 11:55:02 Read error (Operation timed out) in headers.  (no more tries)
2019-04-15 11:50:15 Error: 2019-04-15 11:50:00 Read error (Operation timed out) in headers.  (no more tries)
So... seems like it's timing out doing the DB insert. My DB (table) is set up as innodb and has 1,055,000 rows (or there about). But an insert should be pretty quick. Looking at the DB, the insert IS happening. All the times listed as timing out have rows... so either the insert is taking too long, or the API is responding differently when there's an insert to be done???

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Mon Apr 15, 2019 8:16 pm

trying to wade through api.php and see if maybe it's not returning any response when doing a DB update (and therefore MB is timing out)... but it looks like it should be returning a "Success".

mchd17
Forecaster
Forecaster
Posts: 196
Joined: Sat Mar 17, 2018 2:01 am
Location: Illinois
Station model: Davis Pro2 Plus
Software: Meteobridge

Re: MB Nano "Timeout in headers"

Post by mchd17 » Tue Apr 16, 2019 2:39 am

Who is your host? Do you send mb data anywhere else? If so, no issues on those? My offer is still there to test your mb on a different mt site. It's just a test site I had setup.

What's your site? What's your api url? Copy paste that here
Image

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Tue Apr 16, 2019 4:36 pm

Host is qth.com. Never had any issue. I do send MB data to several other locations, never an issue (unless I save right after it updates and hit a API limit).

I'm pushing to my api via a cloudflare bypassed host. So the normal host is https://www.staze.org/meteo/ but for my MB, it's pushing to http://nocache.staze.org/meteo/api.php

Webhost says he doesn't see anything going on in the logs.

It sure looks like it just isn't getting a response when the DB updates. Looking at the PHP, I see it should respond "success".

For server, it's on PHP 7.3.4 and MySQL 5.7.25. Again, I see all the data in MySQL, and the minute updates work... just for whatever reason the 5 minute ones are timing out according to MB. Any PHP plugin known incompatibility or maybe some plugin I SHOULD have enabled (that the install check doesn't check for)? I do have apc/opcache running...

mchd17
Forecaster
Forecaster
Posts: 196
Joined: Sat Mar 17, 2018 2:01 am
Location: Illinois
Station model: Davis Pro2 Plus
Software: Meteobridge

Re: MB Nano "Timeout in headers"

Post by mchd17 » Wed Apr 17, 2019 12:47 am

Got me. I know nothing about cloudfare. Anyway to bypass that?
Image

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Wed Apr 17, 2019 1:00 am

It is bypassed. That’s the “nocache” subdomain.

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Sat Apr 20, 2019 12:35 am

So I think I found the issue. I think.

It's the DB design, and my fault.

Here's what MT does for the DB:

Code: Select all

CREATE  TABLE  `$dbName`.`alldata` (  `DateTime` datetime NOT  NULL ,
	 `T` decimal( 4, 1  )  DEFAULT  NULL ,
	 `Tmax` decimal( 4, 1  )  DEFAULT  NULL ,
	 `Tmin` decimal( 4, 1  )  DEFAULT  NULL ,
	 `H` decimal( 4, 1  )  DEFAULT  NULL ,
	 `D` decimal( 4, 1  )  DEFAULT  NULL ,
	 `W` decimal( 4, 1  )  DEFAULT  NULL ,
	 `G` decimal( 4, 1  )  DEFAULT  NULL ,
	 `B` decimal( 4, 1  )  DEFAULT  NULL ,
	 `RR` decimal( 7, 3  )  DEFAULT  NULL ,
	 `R` decimal( 7, 3  )  DEFAULT  NULL ,
	 `P` decimal( 7, 3  )  DEFAULT  NULL ,
	 `S` decimal( 5, 1  )  DEFAULT NULL ,
	 `A` decimal( 4, 1  )  DEFAULT NULL ,
	 PRIMARY  KEY (  `DateTime`  ) ,
	 UNIQUE  KEY  `DateTime` (  `DateTime`  ) 
	  ) ENGINE  =  MyISAM  DEFAULT CHARSET  = utf8 COLLATE  = utf8_unicode_ci;
Which, great. If you want MyISAM. I converted to InnoDB, I don't do any MyISAM because MyISAM requires locking the whole database to do an insert. Apparently, MyISAM has no problem with arbitrary primary keys... InnoDB does not like them at all.

Can I suggest changing the database format to include an "ID" row and then using that as the primary key. You can still index on DateTime... MyISAM won't have any problem with this, and InnoDB will love you for it. For now, I'm not sure if I want to move the alldata table back to it's own DB and then convert back to MyISAM, or try to create an ID row to fix this.

Also going to check if for some reason I've got MySQL flushing to disk on every write (I doubt it).

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Mon May 06, 2019 8:49 pm

Hi all,

Any input on this? I'd really like to see this be able to move to InnoDB...

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Sun Oct 13, 2019 1:18 am

Any hope of this getting fixed in the next version @Jachym? I'd like to move back to InnoDB... MyISAM is deprecated as of MySQL 8.0...

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Fri May 08, 2020 10:22 pm

fwiw, my proposed fix didn't work. Created a new column "ID" set to autoincrement. Changed the primary key to it. Then moved table to InnoDB. Inserts still taking longer than 14 seconds.

Not sure why. For now, remaining on MyISAM seems like the only option. =/

User avatar
dmgould
Forecaster
Forecaster
Posts: 173
Joined: Sat Aug 26, 2017 2:43 am
Location: Divide, Colorado, USA
Station model: Davis Pro 2 Plus Wireless
Software: Meteobridge
Contact:

Re: MB Nano "Timeout in headers"

Post by dmgould » Sat May 09, 2020 12:06 am

MBError.JPG
MBError.JPG (34.93 KiB) Viewed 24228 times
I get this all the time with my MB (not a nano). My weather data is being sent via the api.php every 30 seconds using Meteotemplate in the Weather Services tab. This error occurs every 5 minutes. The old Meteotemplate versions, before the api, used an http upload. Those http upload statements are still in my Services tab for upload every 5 minutes, but they are grayed out. Maybe it's those old upload statements causing an issue. I also run a MB Pro on another site. This does not happen on the Pro which is setup identically. It's a mystery for me too.
Dave G
Image

staze
Observer
Observer
Posts: 32
Joined: Thu Nov 15, 2018 11:39 pm
Location: Oregon
Station model: Davis Vantage Vue
Software: Meteobridge Nano SD
Contact:

Re: MB Nano "Timeout in headers"

Post by staze » Sat May 09, 2020 5:32 am

In my case, it's because I had converted the DB to innodb.

Every 5 minutes is how often MT writes to it's DB. the every 30 seconds, or minute, etc just update the live data, but don't get archived. So the timeout is the fact the API is taking too long to respond back from the DB write.

I'm just using the normal API call from my nano, not the HTTP method.

Would check your DB. I'm going to keep experimenting. I'm not convinced this can't be solved with some modifications to the database schema.

Post Reply