Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
r2w7  
#1 Posted : Friday, July 9, 2010 7:48:01 PM(UTC)
r2w7

Rank: Newbie

Joined: 7/9/2010(UTC)
Posts: 2
Location: Seattle, WA

My install of ManicTime crashed a couple of weeks ago with "System.Data.SqlServerCe.SqlCeException: The database file may be corrupted.". A restart of ManicTime seemed to have resolved the problem, however I since then I have been unable to use the Statistics feature of ManicTime as I receive this error when clicking on the tab:

Code:
System.ApplicationException: Error loading statistics.
at Finkit.ManicTime.Client.Main.Views.StatisticsMainViewModel.LoadStatisticsListCompleted(Statistics[] statistics, StatisticsGroup[] statisticsGroups, Exception error)
at Finkit.ManicTime.Client.Main.Views.StatisticsMainViewDataLoader.OnLoadStatisticsCompleted(Statistics[] allStatistics, StatisticsGroup[] allStatisticsGroups, Exception exception)
at Finkit.ManicTime.Client.Main.Views.StatisticsMainViewDataLoader.<>c__DisplayClass2.<BeginLoadStatisticsList>b__1(Object sender, RunWorkerCompletedEventArgs e)
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
---
System.Data.SqlServerCe.SqlCeException: The specified table does not exist. [ StatisticsGroup ]
at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at Finkit.ManicTime.Common.DataAccess.GenericCommandExecutor.<ExecuteReader>d__0.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Finkit.ManicTime.Client.Main.Logic.StatisticsRepository.GetStatisticsGroups()
at Finkit.ManicTime.Client.Main.Logic.StatisticsRepository.GetAll(Boolean returnUknownItems)
at Finkit.ManicTime.Client.Main.Logic.StatisticsRepository.GetAll()
at Finkit.ManicTime.Client.Main.Views.StatisticsMainViewDataLoader.<>c__DisplayClass2.<BeginLoadStatisticsList>b__0(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)


And the relevent section in ManicTimeClient.log is:
Code:
7/9/2010 9:44:04 AM    2    13368    1    ManicTime Client 1.3.1.2 started.
7/9/2010 9:44:05 AM    2    13368    5    Creating channel.
7/9/2010 9:44:05 AM    2    13368    5    Subscribing
7/9/2010 9:44:05 AM    2    13368    5    Subscribed.
7/9/2010 9:44:07 AM    1    13368    1    *** System.ApplicationException: Error loading statistics., at Finkit.ManicTime.Client.Main.Views.StatisticsMainViewModel.LoadStatisticsListCompleted(Statistics[] statistics, StatisticsGroup[] statisticsGroups, Exception error) at Finkit.ManicTime.Client.Main.Views.StatisticsMainViewDataLoader.OnLoadStatisticsCompleted(Statistics[] allStatistics, StatisticsGroup[] allStatisticsGroups, Exception exception) at Finkit.ManicTime.Client.Main.Views.StatisticsMainViewDataLoader.<>c__DisplayClass2.<BeginLoadStatisticsList>b__1(Object sender, RunWorkerCompletedEventArgs e) at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e) at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) *** System.Data.SqlServerCe.SqlCeException: The specified table does not exist. [ StatisticsGroup ], at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan() at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) at System.Data.SqlServerCe.SqlCeCommand.ExecuteReader(CommandBehavior behavior) at System.Data.SqlServerCe.SqlCeCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() at Finkit.ManicTime.Common.DataAccess.GenericCommandExecutor.<ExecuteReader>d__0.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Finkit.ManicTime.Client.Main.Logic.StatisticsRepository.GetStatisticsGroups() at Finkit.ManicTime.Client.Main.Logic.StatisticsRepository.GetAll(Boolean returnUknownItems) at Finkit.ManicTime.Client.Main.Logic.StatisticsRepository.GetAll() at Finkit.ManicTime.Client.Main.Views.StatisticsMainViewDataLoader.<>c__DisplayClass2.<BeginLoadStatisticsList>b__0(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
7/9/2010 9:44:11 AM    2    13368    1    TrackerServiceClient CloseConnection.
7/9/2010 9:44:11 AM    2    13368    1    ManicTime Client 1.3.1.2 stopped.


Is there a way I can rebuild the statistics portion of the sdf database? My only deviation from the defaults is I had created one custom statistics tab and I don't mind recreating it.

Edited by user Friday, July 16, 2010 8:43:35 AM(UTC)  | Reason: Not specified

admin  
#2 Posted : Monday, July 12, 2010 1:43:54 PM(UTC)
admin

Rank: Administration

Joined: 4/13/2010(UTC)
Posts: 872

hi,

We are having a lot of problems with Microsoft SQL CE database lately.

If database is corrupted, MT tries to run the repair tool. Sometimes repair tool just deletes certain portions of the database. In your case it looks like one of statistics tables got deleted.

If you like you can send it to me at support@manictime.com and we can try to repair it.

Look at this page to learn more about database location
http://www.manictime.com...3/1/where-is-data-stored

Sorry for the trouble.

r2w7  
#3 Posted : Wednesday, July 14, 2010 12:25:24 AM(UTC)
r2w7

Rank: Newbie

Joined: 7/9/2010(UTC)
Posts: 2
Location: Seattle, WA

Fixed it. It does appear that when my sdf database previously got corrupted and then subsequently repaired that a table was dropped.

I dumped the tables from my repaired manictime sdf file:
Code:
Activity
ActivityUpdatedDate
ComputerUsage
ComputerUsageType
ComputerUsageUpdatedDate
DatabaseVersion
DayDurationStatisticsCacheItem
DeletedActivity
DocumentGroup
GroupCategory
GroupStatistics
GroupStatisticsCacheItem
GroupStatisticsGroup
Process
Sequence
Statistics
StatisticsCache
Tag
TagGroup
TagGroupTag
Timeline
TimeTag
TimeTagUpdatedDate
TopStatistics


I then renamed that file and re-opened ManicTime so it created a new default ManicTime.sdf. Dumping the tables from that I saw that the new sdf database had the table StatisticsGroup which had been dropped in my version.

I scripted the creation of that table based on the one in the default database via:
Code:
CREATE TABLE [StatisticsGroup] (
[StatisticsGroupId] int NOT NULL ,
[Name] nvarchar(100) NOT NULL ,
[DisplayOrder] int NOT NULL ,
[StatisticsGroupType] int NOT NULL ,
[GraphType] int ,
[GroupBy] int NOT NULL ,
[UpdatedUtcTime] datetime NOT NULL ,
[TimelineId] int );
ALTER TABLE [StatisticsGroup] ADD CONSTRAINT [PK_StatisticsGroupId] PRIMARY KEY ([StatisticsGroupId]);


And then adding the default data rows:
Code:
INSERT INTO "StatisticsGroup" ("StatisticsGroupId","Name","DisplayOrder","StatisticsGroupType","GraphType","GroupBy","UpdatedUtcTime","TimelineId")
VALUES (1,'',1,3,NULL,0,'7/12/2010 8:27:23 PM',NULL);
INSERT INTO "StatisticsGroup" ("StatisticsGroupId","Name","DisplayOrder","StatisticsGroupType","GraphType","GroupBy","UpdatedUtcTime","TimelineId")
VALUES (2,'',2,2,3,0,'7/12/2010 8:27:23 PM',2);
INSERT INTO "StatisticsGroup" ("StatisticsGroupId","Name","DisplayOrder","StatisticsGroupType","GraphType","GroupBy","UpdatedUtcTime","TimelineId")
VALUES (3,'',3,2,3,0,'7/12/2010 8:27:23 PM',3);
INSERT INTO "StatisticsGroup" ("StatisticsGroupId","Name","DisplayOrder","StatisticsGroupType","GraphType","GroupBy","UpdatedUtcTime","TimelineId")
VALUES (4,'',4,2,3,0,'7/12/2010 8:27:23 PM',1);
INSERT INTO "StatisticsGroup" ("StatisticsGroupId","Name","DisplayOrder","StatisticsGroupType","GraphType","GroupBy","UpdatedUtcTime","TimelineId")
VALUES (5,'',5,2,3,0,'7/12/2010 8:27:23 PM',4);
INSERT INTO "StatisticsGroup" ("StatisticsGroupId","Name","DisplayOrder","StatisticsGroupType","GraphType","GroupBy","UpdatedUtcTime","TimelineId")
VALUES (6,'',6,1,1,1,'7/12/2010 8:27:23 PM',NULL);


And then ran those scripts against my original sdf file (renamed back to Manictime.sdf) to add that table+contents back. Now when I click on the Statistics tab in ManicTime I get the old familiar tabs and functionality. Hooray for ManicTime using SQL CE. =)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.