Odd problem with reports

I have this weird problem with my WU-reports. Sometimes they show up and then all of a sudden they give an error message saying : ERROR: no data for https://www.akker.be/WXDailyHistory.php?ID=IVLAAMSG11. You can check it out here: https://www.akker.be/wxStartReports.php The files are present and are populated and permissions set to 775. Any suggestions?

Marc AKA Staccermaccer,

The data can not be retrieved by WXDailyHistory.php, it gets a 401 error

Access Denied
You don't have permission to access "http://api.weather.com/v2/pws/history/daily?" on this server.
Reference #18.b6c51102.1684651472.2f5be4

Some wild guesses what could cause this:

An typing error for the API key error or similar (20% chance)
= = =
Or you reached the maximum allowed number of API-access for the day. (60%)
Maybe your API-key is compromised and others are using your key
or
Maybe you are using / testing other templates and scripts using the same API-key
or
You have the wrong file-permissions and the data is not cached.
It then rereads all the data every time the page is executed

I tested the same request with my own WU API-key, it worked OK.
You can check the API usage at your WU dashboard
= = =
A mix-up of Leuven and Saratoga scripts. (20 %)
The load data script WXDailyHistory.php seems to be a Saratoga script
The other scripts are Leuven ones.
Normally it should work OK.

Wim

Hi, Wim!

Thanks for your swift answer. I know i am a pain in the ‘beep’ but my api-calls are around 130 per day. I have found one odd thing, i get two different types of reports, one with just text and one in HTML? I replaced the files with the text-files and all is working… :confused:

Same problem today

With the link https://www.akker.be/wxStartReports.php
The script WXDailyHistory.php is used to load the data
ERROR: no data for https://www.akker.be/WXDailyHistory.php?ID=IVLAAMSG11&month=01&day=01&year=2023&format=1&graphspan=year

Using stand-alone access https://www.akker.be/wureports/startReports.php?lang=nl
No error is shown, all data is displayed
But this one is using https://www.akker.be/pws/PWS_DailyHistory.php

Please check if you are using the latest version of WXDailyHistory.php

= = =
Also one remark about the invalid files.
Your . . ./wuData/IVLAAMSG11-year-2023.txt file is outdated.

2023-05-05,18.3,15.1,12.3,13.9,11.5,9.2,86,79,68,1018,1015,30,1,19,1.12
2023-05-06,20.9,15.1,9.4,13.4,10.5,5.9,83,75,60,1018,1016,14,1,4,0.02
2023-05-07,19.7,16.1,13.3,14.1,11.6,9.0,79,75,66,1021,1016,11,0,2,0.12

When you replace it manually , it gets a new date/time-stamp and is valid for 24 hours.After that period the scripts try to reload the data.
Seems that there has been no correct reload since May 7.
Has there been any changes since that date, f.i. new PHP version?
Wim

Hi, Wim

WXDailyhistory is up to date!
Not that i know of. I manually entered the missing data in the other file, but that gets overwritten after 24 hours. I will include a screenshot of my mapstructure in Filezilla. I think something is double-over and getting overwritten?

mapstruc

Sorry, but I have no idea what is going on.

Next time, if the data file is replaced with an html file, please do not delete or replace that “html” file. Simply rename that xyz.txt file to xyz.html
Maybe we can detect which script is replacing the data file and what error message WU is returning.

You main-site reports and your wu-graphs both have that problem.

But when running the reports stand-alone, they work OK.

===
The error message discussed above is clear. The API key is invalid.
When I check the API-key used it is a correct key but not for your IVLAAMSG11
Neither can I check from the outside what API-key is used when running stand-alone.

But only you can see if that key used in WXDailyHistory.php is exactly the same as used in your settings. Only you can see the contents of that script as sce=view does not show the PHP.

Only you has FTP access to the source of the scripts on your website
and only you can access your Wunderground profile with the correct API-key.

Succes,
Wim

Hi, Wim

I checked the API-key, i have an old one and a new one, i have tried both of them but no changes when i trie that. I am using the latest version of WXDailyHistory. $Version = “WXDailyHistory.php Version 1.32 - 09-Sep-2019”; The only thing that works is when i manually replace the .txt-file with the copy which is in “wureports”. I am thinking of removing all the doubles and restrict myself to the one that is working…

Marc,

Hi, Wim!

I have been busy with my api-keys and something has changed, i am getting the reports but i have an error message:

ERROR in line 0: Number of fields = 17, expected 16 ERROR in line 0: Number of fields = 17, expected 16 ERROR in line 0: Number of fields = 17, expected 16 ERROR in line 0: Number of fields = 17, expected 16 ERROR in line 0: Number of fields = 17, expected 16 ERROR in line 0: Number of fields = 17, expected 16 ERROR in line 0: Number of

So i checked the file 2022 because that is showing correct and the 2023 file and indeed i have a 17th field. When i remove the last input the report is showing the values one by one. Where should i be looking to correct that?

You can check it out here: 17 fields

THX in advance…

Marc,

That is a different formatted file.
https://www.akker.be/wuData/IVLAAMSG11-year-2023.txt

It has indeed 1 field extra, decimals and the date format is missing leading zeroes.

From my previous post

2023-05-05,18.3,15.1,12.3,13.9,11.5,9.2,86,79,68,1018,1015,30,1,19,1.12
2023-05-06,20.9,15.1,9.4,13.4,10.5,5.9,83,75,60,1018,1016,14,1,4,0.02
2023-05-07,19.7,16.1,13.3,14.1,11.6,9.0,79,75,66,1021,1016,11,0,2,0.12

Same lines from your current file loaded with https://www.akker.be/WXDailyHistory.php?ID=IVLAAMSG11&month=01&day=01&year=2023&format=1&graphspan=year

2023-5-5,18.3,15.1,12.3,13.9,11.5,9.2,86,79,68,1018.4,1015.1,30.1,0.6,19,11.2,756
2023-5-6,20.9,15.1,9.4,13.4,10.5,5.9,83,74.5,60,1017.5,1016.1,14.2,0.5,3.9,0.2,956
2023-5-7,19.7,16.1,13.3,14.1,11.6,9,79,74.5,66,1021.1,1015.8,10.6,0.2,2.4,1.2,492

That extra field is not in the header line.

Date,TemperatureHighC,TemperatureAvgC,TemperatureLowC,DewpointHighC,DewpointAvgC,DewpointLowC,HumidityHigh,HumidityAvg,HumidityLow,PressureMaxhPa,PressureMinhPa,WindSpeedMaxKMH,WindSpeedAvgKMH,GustSpeedMaxKMH,PrecipitationSumCM

This works OK https://www.akker.be/wureports/startReports.php?lang=nl&test
Uses files such as https://www.akker.be/wureports/wuData/IVLAAMSG11-year-2023.txt

In your screenshot there are at least 3 different wuData/ folders where data is stored

You use (at least) 2 different scripts to load the data from WU
WXDailyHistory.php which returns the data with 1 extra field
and pws/PWS_DailyHistory.php which returns slightly different format coampatible with “Leuven” reports and history.

Succces,
Wim