Page 1 of 1

MySQL table issues after updating

Posted: Tue 08 Dec 2020 2:21 am
by stefanbagnato
It took some troubleshooting, but I've determined that every time I update CumulusMX after a new SQL value is added to any table, it "breaks" my tables. What this means is that, data is still logged to the table, but I cannot see any new data in myphpadmin and any scripts I've written (such as querying the table to extract data) fail because the most recent values (don't exist).

For instance, I updated on 11/23 from b3094 to b3096. Everything looked good to go. One of my scripts queries the 'monthly' table each day to pull the rainfall between 7am the day before and 7am of the current day to calculate the rainfall and submit to CoCoRaHs. I checked my logs yesterday on their site and noticed no entries, even though it has rained since the 23rd. I manually ran a SQL select query and the value returned was Null. I didn't have time to look at it.

I sat down this evening to investigate and what I found is that whenever a new column is added to any of the three tables (dayfile, monthly, realtime), it "breaks" the table in the way I described above. In this case, the Humidex column was added. A few months ago, I updated from 3086 to 3094, and had the same type of issue. I don't recall how I fixed it that time, but it took a few days. This evening, I figured out that if I created a new table using the feature in the MX dashboard, it'll start updating right away. I then have to copy all of the data out of the old table and into the new. The copy function in myphpadmin won't work for this as it tries to create a new table with this data instead of simply copy, so I have to write a long insert query including all of the columns from the old table and inserting them into the new table, minus the new column that now exists.

I understand this is probably a very unique issue, and my platform is also unique in that everything is local. Except for paying for my domain name, everything is local; mysql db, web server, and all. Aside from that, I was wondering if anybody else has experienced anything like this, and if they have any ideas on fixing the root cause.

Re: MySQL table issues after updating

Posted: Tue 08 Dec 2020 9:42 am
by mcrossley
Yes, humidex was added back in b3089. The release notes do say (perhaps not as prominently as they could!)...
  • Daily SQL table has four two additional columns for Humidex high, high time
  • Monthly SQL table has an additional column for Humidex
You can just edit your existing Table structure in PhpMyAdmin, and add the extra columns, there is no need to create a new table and copy the contents. That is how I update my SQL instance. Were you perhaps setting something like the Not Null property? Did you replicate the same column configuration as other temperature values (DECIMAL 5,1 iirc)?

Re: MySQL table issues after updating

Posted: Tue 08 Dec 2020 3:36 pm
by stefanbagnato
Mark, that's just it. I didn't make any changes whatsoever. I updated Cumulus as normal (extract into C:) and went about my day. May completely be an issue with the steps I take (which I am fine with as long as I know what I am doing wrong), but when future columns are added to any of the tables, should I be manually adding them in SQL first (formatting correctly of course) before doing the update? Either way, since I've been bitten (self-inflicted or otherwise) twice by this now, I'll take the extra time and monitor the tables to make sure data is still visible :D

Re: MySQL table issues after updating

Posted: Tue 08 Dec 2020 4:12 pm
by mcrossley
Yes, you should update the tables before (or at the same time as) Cumulus. Otherwise the new data inserts will fail.

Re: MySQL table issues after updating

Posted: Tue 08 Dec 2020 10:31 pm
by stefanbagnato
I don't disagree there. I don't know if this is an issue for anybody else. Maybe just something that needs to be added to the documentation? Either way, I know what to do for myself in the future.

Re: MySQL table issues after updating

Posted: Wed 09 Dec 2020 9:13 am
by mcrossley
The "documentation" is sorely lacking I'm afraid.

Re: MySQL table issues after updating

Posted: Wed 09 Dec 2020 10:54 pm
by stefanbagnato
:cry: