Internal Error

Hi Team,

I have been using manager for some time now. Today when I open my company in manager I got the following internal Error. This error comes up even when I use the files from the backup. Can anyone help?

Uploading: image.png…

System.AggregateException: One or more errors occurred. (An item with the same key has already been added. Key: a227bc14-3229-48ae-a7f1-6d01022f07d2)
—> System.ArgumentException: An item with the same key has already been added. Key: a227bc14-3229-48ae-a7f1-6d01022f07d2
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey](ParallelQuery1 source, Func2 keySelector, IEqualityComparer1 comparer)
— End of inner exception stack trace —
at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey](ParallelQuery1 source, Func2 keySelector, IEqualityComparer1 comparer) at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey](ParallelQuery1 source, Func`2 keySelector)
at Manager.ApplicationData.Get(String entityId) in C:\projects\manager\Manager\ApplicationData.cs:line 125
at Manager.ApplicationData.Get(Byte entityId) in C:\projects\manager\Manager\ApplicationData.cs:line 106
at ManagerServer.HttpHandlers.Businesses.Business.Start.InnerGet() in C:\projects\manager\ManagerServer\HttpHandlers\Businesses\Business\Start.cs:line 24
at ManagerServer.HttpHandlers.Template.Get() in C:\projects\manager\ManagerServer\HttpHandlers\Template.cs:line 321
at ManagerServer.HttpHandlers.HttpHandler.ProcessRequest() in C:\projects\manager\ManagerServer\HttpHandlers\HttpHandler.cs:line 146
at ManagerServer.Startup.<>c.<b__1_1>d.MoveNext() in C:\projects\manager\ManagerServer\Startup.cs:line 89
— End of stack trace from previous location —
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

What edition and version of Manager are you using?

I am currently using window destop edition 21.7.52

Can you explain when this error occurs?

Do you get a list of tour businesses?

Where are your business files stored?

V21.7.52 is the latest version today at this time. You reference that you have been using Manager for a while. So what version number where you using before the update and is it a Windows, macOS, Linux, Cloud or Server edition. Then how did you do the upgrade to the latest version and what are the steps you took to get the error message as asked by @Joe91

Yes I do get a list of businesses I have two of them, one works okay the other give this error when I tried to gain access into it. I then romeved the business and and attached one from a backup file, it open once and the second time it give me the same error messages. Files are stored on my “C” drive.

And where did you tell Manager (bottom left) screen where business are stored to store the business. You maybe importing somehting at exact the same place as where it already is… (Just a wild guess.)

The current defualt loction is c:\Users****\AppData\Local\Manager

About 2 weeks ago I did manager update, and all will well.

Two weeks ago, the version was not 21.7.52 so you must have updated since then

The error message implies that there is a data error in your file - as if it was open twice and a new records added

It is not clear what the duplicate key referenced in the error message is - it could be almost anything in the database

Are you saying that when you import the backup it opens correctly, but if you close it and re-open it there is an error?

The previous 3 backups have the same issue. The first time you attach the backup file it opens and if you go out of manager and log in again then I will get the same error. And yes I did upgrade manager today, I thought that was will solve problem.

That’s almost as if your Manager installation has a problem.

Do you have an previous version of Manager you can restore ?

When you import, did you change the business name?

There could be a problem with duplicate business names

Check what files are in the default Manager folder


I have downloaded DB Browser for SQLite and I can see the duplicate, am not sure if it is possible to just delete them?

@Joe91 and @eko Thank you for your help, I have fixed it. DB Browser for SQLite, I attended the manager file, then went on Browse Data, under Table I went to Changes and searched for a duplicate object, I found two of the as shown on the image above I deleted them and also under Table I went from “Changes” table to “Object” table I found two records there as well and I deleted them and I wrote the changes to the database. And wala it works…Thank you so much for jumping in so quick to help.

@Dickson 2 entries with the same Object field in Changes table is not considered duplicate. However, two entries with the same Key field in Objects tab is a duplicate. Now, Manager doesn’t know how to handle it because Key field is a primary key so the database should ensure it will never happen.

I’m really curious how this could have happened though. If you could send me the broken database (before your fix) to lubos@manager.io, I’d appreciate that.

@lubos you are quite right when I delete the line on Changes the problem continued and the database only got fixed after I deleted the duplicate under Objects. I fixed the file but I should have copies of it, I will send it through to you. Thanks.