Removed an erroneous daily rainfall reading from the database and now its back after reboot

52 views
Skip to first unread message

Muireadach O Connor

unread,
Apr 3, 2020, 11:20:20 AM4/3/20
to weewx-user
Hi guys,

I'm struggling to understand what I'm doing wrong here.

I want to remove a daily reading of 134mm rain from February 2013 as its bothering me in my records page. I had cleaned the rain gauge that day and never got around to correcting it.
I'd previously amended a max rainRate figure from the database without too much issue so thought this would be the same but its proving much more troublesome.

I removed it using :

update archive set rain=NULL where rain > 4; (db in imperial)

Next made a  new copy of this new database

Then..

sudo wee_database --drop-daily
sudo wee_database weewx.conf --rebuild-daily

then ran :

wee_reports --config=/etc/weewx/weewx.conf

However the records webpage on my pi (reports folder) in still showed the old value in there.

At this stage I figured maybe its cached in memory so stopped the WeeWX service and restarted the raspberry pi

Now the old value is back in the database again (/shakes fist at cloud)
I've looked at my amended copy and the latest one and the old maximum daily reading is definitely back and definitely was removed.

I'm guessing this is being pulled from the console somehow, should I have cleared it also there also before restarting?
If not, anyone any ideas how to fix this?

gjr80

unread,
Apr 3, 2020, 10:41:23 PM4/3/20
to weewx-user
Hi,

The only way that something historical would be pulled from the console and placed in the archive would be if WeeWX was doing a catchup on startup, and then WeeWX would only catchup records timestamped after the most recent record in your archive and the catchup would only occur if your station had a logger/memory and supported a catchup. Catching up back to 2013 I would suggest is beyond all of the stations currently supported by WeeWX. Most likely what has happened is that the data appeared to be deleted but in fact it was not and when you subsequently made copies of your database you just copied a database that included the erroneous data.

I would suggest repeating the process this time screen capturing everything you do (and the responses as well). The broad process I would use is:

1. backup your database
2. query your database to find the erroneous data
3. run your update query to remove the erroneous data
4. query your database again to confirm you have indeed removed the erroneous data
5. if you wish make another backup/shuffle your databases
6. drop then rebuild your daily summaries
(6.5 if really paranoid query your database again to confirm the erroneous data has been removed from the archive and the rain daily summary table archive_rain_day)
7. run wee_reports or start WeeWX normally and wait for the reports to be generated

If the data is still there post all of your commands and the responses.

Gary

Muireadach O Connor

unread,
Apr 6, 2020, 8:18:36 AM4/6/20
to weewx-user
Thanks Gary,

I found the source of my issue, I was logging the output of my putty session to a file in case I needed to put the steps taken on here as per your suggestions.
To show exactly what and where i was editing i did a "locate" command on the weewx.sdb file and only then realised I was editing the wrong one, I was actually editing an old backup in the wrong location, hense it not working! Doh!

Thanks for offering to help, you already did in a roundabout way in the end!
Reply all
Reply to author
Forward
0 new messages