revenz / NextPvrWebConsole

Webconsole and API for NextPVR
2 stars 1 forks source link

Invalid DateTime Format #28

Closed KaraokeStu closed 11 years ago

KaraokeStu commented 11 years ago

Server Error in '/' Application.

String was not recognized as a valid DateTime.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: String was not recognized as a valid DateTime.

Source Error:

Line 778: { Line 779: OnException(x); Line 780: throw; Line 781: } Line 782:

Source File: c:\Users\Stuart\Documents\GitHub\NextPvrWebConsole\NextPvrWebConsole\Models\PetaPoco.cs Line: 780

Stack Trace:

[FormatException: String was not recognized as a valid DateTime.] System.DateTimeParse.ParseExactMultiple(String s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style) +3340054 System.DateTime.ParseExact(String s, String[] formats, IFormatProvider provider, DateTimeStyles style) +49 System.Data.SQLite.SQLiteConvert.ToDateTime(String dateText) +254 System.Data.SQLite.SQLite3.GetDateTime(SQLiteStatement stmt, Int32 index) +62 System.Data.SQLite.SQLite3.GetValue(SQLiteStatement stmt, Int32 index, SQLiteType typ) +385 System.Data.SQLite.SQLiteDataReader.GetValue(Int32 i) +86 petapoco_factory_0(IDataReader ) +595 PetaPoco.d71.MoveNext() in c:\Users\Stuart\Documents\GitHub\NextPvrWebConsole\NextPvrWebConsole\Models\PetaPoco.cs:780 System.Linq.Enumerable.FirstOrDefault(IEnumerable1 source) +164 PetaPoco.Database.FirstOrDefault(String sql, Object[] args) in c:\Users\Stuart\Documents\GitHub\NextPvrWebConsole\NextPvrWebConsole\Models\PetaPoco.cs:1132 NextPvrWebConsole.Models.User.GetByUsername(String Username) in c:\Users\Stuart\Documents\GitHub\NextPvrWebConsole\NextPvrWebConsole\Models\User.cs:132 NextPvrWebConsole.ExtensionMethods.GetUser(Controller Controller) in c:\Users\Stuart\Documents\GitHub\NextPvrWebConsole\NextPvrWebConsole\ExtensionMethods.cs:91 NextPvrWebConsole.Controllers.RecordingsController.Index() in c:\Users\Stuart\Documents\GitHub\NextPvrWebConsole\NextPvrWebConsole\Controllers\RecordingsController.cs:16 lambdamethod(Closure , ControllerBase , Object[] ) +62 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +211 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) +27 System.Web.Mvc.Async.<>cDisplayClass42.b41() +28 System.Web.Mvc.Async.<>cDisplayClass8`1.b7(IAsyncResult ) +10 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +48 System.Web.Mvc.Async.<>cDisplayClass39.b33() +57 System.Web.Mvc.Async.<>cDisplayClass4f.b49() +223 System.Web.Mvc.Async.<>cDisplayClass37.b36(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +48 System.Web.Mvc.Async.<>cDisplayClass2a.b20() +24 System.Web.Mvc.Async.<>cDisplayClass25.b22(IAsyncResult asyncResult) +102 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43 System.Web.Mvc.<>cDisplayClass1d.b18(IAsyncResult asyncResult) +14 System.Web.Mvc.Async.<>cDisplayClass4.b3(IAsyncResult ar) +23 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57 System.Web.Mvc.Async.<>cDisplayClass4.b3(IAsyncResult ar) +23 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 System.Web.Mvc.<>cDisplayClass8.b3(IAsyncResult asyncResult) +25 System.Web.Mvc.Async.<>cDisplayClass4.b__3(IAsyncResult ar) +23 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629708 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929

KaraokeStu commented 11 years ago

This happens on all screens (some multiple times)

revenz commented 11 years ago

Might be an issue with System.Data.SQLite.dll.

I was having issues recording a program in NPVR because I was using a newer version of that dll than NPVR. I could read the dates fine, but NPVR reporting "String was not recognized as a valid DateTime."

Trying downloading the latest code, delete the .db file in app_data and run it again.

Thats likely the issue.

On Sun, Nov 18, 2012 at 4:34 PM, KaraokeStu notifications@github.comwrote:

This happens on all except the dashboard

— Reply to this email directly or view it on GitHubhttps://github.com/revenz/NextPvrWebConsole/issues/28#issuecomment-10482164.

John Andrews www.reven.co.nz

KaraokeStu commented 11 years ago

Fantastic, deleting the .db file sorted the issue.

Might be worth adding to the change log (or potentially looking for invalid dates and, if they exist, truncating that/those tables?)

I know once it's gone Beta, those issues won't exist, but it's always good to keep it idiot proof ;)