Page 1 of 1
MB Nano "Timeout in headers"
Posted: Tue Mar 26, 2019 3:58 am
by staze
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!
Re: MB Nano "Timeout in headers"
Posted: Tue Mar 26, 2019 10:10 pm
by mchd17
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.
Re: MB Nano "Timeout in headers"
Posted: Wed Apr 03, 2019 7:08 pm
by staze
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...?
Re: MB Nano "Timeout in headers"
Posted: Wed Apr 03, 2019 7:12 pm
by staze
Are you using the Meteotemplate "Weather Network" to push, or are you using a service?
Re: MB Nano "Timeout in headers"
Posted: Sat Apr 13, 2019 12:35 am
by mchd17
sorry for late response, using mb to push to mt
Re: MB Nano "Timeout in headers"
Posted: Sat Apr 13, 2019 1:08 am
by staze
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?
Re: MB Nano "Timeout in headers"
Posted: Sun Apr 14, 2019 10:20 pm
by mchd17
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
Re: MB Nano "Timeout in headers"
Posted: Mon Apr 15, 2019 3:10 am
by staze
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.
Re: MB Nano "Timeout in headers"
Posted: Mon Apr 15, 2019 8:00 pm
by staze
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???
Re: MB Nano "Timeout in headers"
Posted: Mon Apr 15, 2019 8:16 pm
by staze
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".
Re: MB Nano "Timeout in headers"
Posted: Tue Apr 16, 2019 2:39 am
by mchd17
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
Re: MB Nano "Timeout in headers"
Posted: Tue Apr 16, 2019 4:36 pm
by staze
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...
Re: MB Nano "Timeout in headers"
Posted: Wed Apr 17, 2019 12:47 am
by mchd17
Got me. I know nothing about cloudfare. Anyway to bypass that?
Re: MB Nano "Timeout in headers"
Posted: Wed Apr 17, 2019 1:00 am
by staze
It is bypassed. That’s the “nocache” subdomain.
Re: MB Nano "Timeout in headers"
Posted: Sat Apr 20, 2019 12:35 am
by staze
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).
Re: MB Nano "Timeout in headers"
Posted: Mon May 06, 2019 8:49 pm
by staze
Hi all,
Any input on this? I'd really like to see this be able to move to InnoDB...
Re: MB Nano "Timeout in headers"
Posted: Sun Oct 13, 2019 1:18 am
by staze
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...
Re: MB Nano "Timeout in headers"
Posted: Fri May 08, 2020 10:22 pm
by staze
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. =/
Re: MB Nano "Timeout in headers"
Posted: Sat May 09, 2020 12:06 am
by dmgould

- MBError.JPG (34.93 KiB) Viewed 24254 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.
Re: MB Nano "Timeout in headers"
Posted: Sat May 09, 2020 5:32 am
by staze
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.