Page 1 of 1

System.InvalidOperationException in build 3036

Posted: Sat 13 Feb 2016 8:53 am
by rpedroletti
Hello,

I'm testing cumulus MX, and I met this exception :

Code: Select all

2016-02-12 19:40:38.732 System.InvalidOperationException: La séquence ne contient aucun élément.
   à System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   à (DateTime) dans C:\Users\steve\Documents\Visual Studio 2015\Projects\CumulusMX\CumulusMX\WeatherStation.cs:ligne 5476
   à (Object , RunWorkerCompletedEventArgs ) dans C:\Users\steve\Documents\Visual Studio 2015\Projects\CumulusMX\CumulusMX\DavisStation.cs:ligne 419
   à System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
   à System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)
   à System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   à System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   à System.Threading.ThreadPoolWorkQueue.Dispatch()
   à System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
I'm attaching the full MXDiags in which you'll also find a couple of I/O errors due to windows 10 firewall I finally managed to setup in the right way.
Thank you.
Richard.

Re: System.InvalidOperationException in build 3036

Posted: Sat 13 Feb 2016 9:23 am
by steve
That's interesting - I actually spotted what is technically a bug in the code only yesterday and corrected it. But I thought it was only a theoretical problem and that its shouldn't normally occur. It happens when it tries to calculate the 3-hour temperature trend but there is no data to do it.

I think that you are hitting the problem because of problems in your data logs:

2016-02-12 19:39:13.555 Error on line 1 of data\févr.16log.txt: Le format de la chaîne d'entrée est incorrect.

2016-02-12 19:39:13.602 GetRainfallTotals: Error on line 1214 of dayfile.txt: Le format de la chaîne d'entrée est incorrect.

2016-02-12 19:39:20.977 Loading last N hour data from data logs: 12/02/2016 19:30:00
2016-02-12 19:39:20.977 Loaded 3 entries to last hour data list
2016-02-12 19:39:20.993 Error at line 484 of data\févr.16log.txt : Le format de la chaîne d'entrée est incorrect.
2016-02-12 19:39:20.993 Please edit the file to correct the error
2016-02-12 19:39:20.993 Loaded 0 entries to last 3 hour data list
2016-02-12 19:39:20.993 Error at line 468 of data\févr.16log.txt : Le format de la chaîne d'entrée est incorrect.
2016-02-12 19:39:20.993 Please edit the file to correct the error
2016-02-12 19:39:20.993 Loaded 0 entries to graph data list
2016-02-12 19:39:21.009 Error at line 192 of data\févr.16log.txt : Le format de la chaîne d'entrée est incorrect.
2016-02-12 19:39:21.009 Please edit the file to correct the error
2016-02-12 19:39:21.009 Loaded 0 entries to recent data list
2016-02-12 19:39:21.024 Error at line 1225 of data\dayfile.txt : Le format de la chaîne d'entrée est incorrect.
2016-02-12 19:39:21.024 Please edit the file to correct the error

You will need to correct those problems.

Re: System.InvalidOperationException in build 3036

Posted: Sat 13 Feb 2016 9:37 am
by rpedroletti
Hello Steve,

Well it's weird : I had a look at the couple of lines mentionned as containing incorrect data : I can't find anyhting with a problem.
I decided then to relaunch cumulus MX, and the problem seems to have disappeared.
I don't know what happened, but anyway, as you said, the theorical bug is now fixed.

I'm about to install cumulus MX on a raspberry I don't use. Do you think a raspberry model B is enough or a raspberry 2 is mandatory. As it is .Net code, I guess a model 2 is required, doesn't it ?

Thank you.
Richard

Re: System.InvalidOperationException in build 3036

Posted: Sat 13 Feb 2016 9:40 am
by mcrossley
MX runs fine on a model B, my old B runs MX, and another web site using NginX and PHP.

Re: System.InvalidOperationException in build 3036

Posted: Sat 13 Feb 2016 9:41 am
by steve
I suspect that the reason you didn't hit the problem this time is that there was logger data to download, so the 3-hour data list was not empty. If you look in the latest MX diags file, you'll be able to see whether it is still complaining about the log files.

A model B is fine for running MX, I used one to begin with until I got a Pi 2.