"Import Data" feature only processing 1st entry

Post Reply
SteveParry
Newbie
Newbie
Posts: 7
Joined: Thu Dec 26, 2019 7:16 am
Location: Samford Valley, Australia
Station model: Davis Vantage Vue
Software: CumulusMX
Contact:

"Import Data" feature only processing 1st entry

Post by SteveParry » Wed Jun 18, 2025 4:41 am

Hi everyone.
I am using MeteoTemplate v19, and I want to upload updated weather records from Cumulus to the server WeatherDB to fill in gaps caused by network outages.

I'm using the data import function to import the daily log files from Cumulus. My host server is on PHPv8.2.

What I am getting is:

Code: Select all

Importing data from CSV/text file...

Errors will be highlighted in red...

Loading CSV/text file from https://samfordweather.com/weather/importData/combined_20250314a.txt

File loaded successfully.
No header, reading from first line.

The imported file has 41 data sets.

Import type: skip
Starting to parse data.

All ok, imported (skipped if exists): 2012-12-16 15:45
INSERT INTO alldata (DateTime,T,Tmax,Tmin,H,P,W,G,R,RR,B,S,D,A) values ('2012-12-16 15:45',33.5,33.5,33.5,38,996.00,7.0,0.0,6.10,31.00,0.0,null,17.3,34.6)
Only the first record is processed.

Looking at importFile.php, it appears that the call (line 446) to "mysqli_query($con,$query)" never returns to the script, so nothing further gets processed. (I inserted echo commands before and after this line). I have full error reporting turned on and nothing in the error log.

Code: Select all

else{
if($parameters['importType']=="skip"){
	echo "All ok, imported (skipped if exists): ".$dateTimeFormatted."<br>".$query."<hr>";
	mysqli_query($con,$query);
}
Anyone else having this issue or know how to resolve it?

Many thanks!
Cheers
...Steve

alexvanuxem
Forecaster
Forecaster
Posts: 211
Joined: Mon Jan 31, 2022 4:41 pm
Location: Sint-Katelijne-Waver, Belgium
Station model: Davis Vantage Pro 2
Software: Meteobridge
Contact:

Re: "Import Data" feature only processing 1st entry

Post by alexvanuxem » Wed Jun 18, 2025 8:37 am

yes.

It seems that your file has no header.
Had it before, start over from the original file.
The fields and the header set up must be correct.
Use test import, it should work.

KR

Alex
Image

SteveParry
Newbie
Newbie
Posts: 7
Joined: Thu Dec 26, 2019 7:16 am
Location: Samford Valley, Australia
Station model: Davis Vantage Vue
Software: CumulusMX
Contact:

Re: "Import Data" feature only processing 1st entry

Post by SteveParry » Thu Jun 19, 2025 3:45 am

@alexvanuxem Thanks Alex.
That's correct - there is no header, and the setting in the Import Data screen is set to "Header Row: No", so it should see the first row as data. The SQL (last line of the quoted output log) shows the first line is being picked up and submitted, but no response comes back from the mysql_query command.

Test Import worked successfully.

Just to add that I cut and paste'd the SQL to phpAdmin for the database and it worked (in that it caught that the record already exists, and therefore should be skipped by the importFile script).

Cheers
...Steve

Post Reply