Page 1 of 1
Creash in the 7th August 2014 release
Posted: Fri 08 Aug 2014 7:56 am
by Brox
I had to replace my server where I was running cumulus and installed yesterdays, the 7th August 2014 version on the new server.
When I start up Cumulus it just crashes with the error message: Could not convert variant of type (UnicodeString) into type (Date).
A link to the full error report:
https://www.dropbox.com/s/f5r6zlpjgup5wqh/bugreport.txt
Re: Creash in the 7th August 2014 release
Posted: Fri 08 Aug 2014 8:20 am
by steve
Windows cannot convert the timestamp from today.ini into a date and time. Are you using the data from your old machine? If your new machine does not have the same date and time format settings as the old one, Windows may not be able to recognise the format that was written on the old machine.
Re: Creash in the 7th August 2014 release
Posted: Fri 08 Aug 2014 8:32 am
by Brox
OK, a classical programming fault, - not using invariant culture when storing dates as text. Been there, done that
I will try to figure out what language I used on the old server and how to change it on the new.
Re: Creash in the 7th August 2014 release
Posted: Fri 08 Aug 2014 8:48 am
by Brox
I checked the content of the today.ini file and it looks like I had used Norwegian on the old server, - where I had
Timestamp=27.07.2014 14:35:00
What is worse is that Norwegian uses comma as decimal point instead of a period as in US, and you have the same problems there:
Speed=2,70000004768372
I really recommend using invariant culture when converting timestamps and number to text which shall be stored and re-read.
Being an old programmer I have burned my fingers several times on such errors. A program was working well into the user changed his language setting or changed his date format (Norwegian users hates for example the am/pm on timestamps and always changes to 24-hour clock even if the rest of the installation is US English).
I will try to change language on the server, but I wish I did not have to since the new server will be used by other non-Norwegians now.
Is there other files than today.ini where the current locale is used? If not, manually editing the file would probably help.
Re: Creash in the 7th August 2014 release
Posted: Fri 08 Aug 2014 8:59 am
by Brox
OK, - re-reading my message above i figured out that it was exactly what I had not done yet on the new server: Setting the time and date formats.
I changed to dd.MM.yyy and HH:mm:ss in the control panel helped.
Cumulus is up and running now:
http://home.ebnett.no/bpbrox/Weather/
Hopefully that setting is for the logged in user only.
Re: Creash in the 7th August 2014 release
Posted: Fri 08 Aug 2014 9:03 am
by steve
Yes, there are lots of places. Sorry, I did the best I could when I changed Cumulus so that it would work on systems other than my own. If I'd set out to produce a commercial product with the intention of selling it all over the world and actually making some money out of it, I would have done it differently. It's quite remarkable that it works at all on anyone else's system, given how it started out.
Re: Creash in the 7th August 2014 release
Posted: Fri 08 Aug 2014 9:48 am
by Brox
Luckily you are using ; as column separator in the other text files instead of comma, and a fixed date format in the alltimelog.txt file, so I don't think the problem is so big. You might just loose the digits after the decimal point, and for temperatures it probably does not matter.
I my job loosing the digits after the decimal point just because it was used comma instead of period when converting from text could be catastrophic.....
I have lost my monthly records, but I have a backup from my old installation and will try to figure out how to get them back.
Thanks for a great program.