Jump to content

Developing a standalone embystat server


reggi

Recommended Posts

darkassassin07

The embystat.exe along with everything else you extracted from the zip (found here) should be in its own install folder wherever you want.

 

For example extract everything in the zip to C:/program files/embystat

So that you end up with C:/program files/embystat/embystat.exe

Then point the application path in the embystat service setup to that file.

Edited by darkassassin07
Link to comment
Share on other sites

The embystat.exe along with everything else you extracted from the zip (found here) should be in its own install folder wherever you want.

 

For example extract everything in the zip to C:/program files/embystat

So that you end up with C:/program files/embystat/embystat.exe

Then point the application path in the embystat service setup to that file.

Can you remove the old service cause when I moved the folder to the program file the path changed or can you change the path? Cause it just says paused.

Edited by Glbjr29
Link to comment
Share on other sites

Again in command prompt:

nssm remove embystat

 

 

Then re-create it again with the new path.

 

https://nssm.cc/usage

Why is all my processes failing?

 

 00:06:09 31-12-19 MEDIASYNC-JOB => Processed (178/451) Heroes

00:06:10 31-12-19 MEDIASYNC-JOB => Can't seem to process show House, check the logs for more details!
00:06:10 31-12-19 MEDIASYNC-JOB => Processed (179/451) House
00:06:10 31-12-19 MEDIASYNC-JOB => Can't seem to process show House of Anubis, check the logs for more details!
00:06:10 31-12-19 MEDIASYNC-JOB => Processed (180/451) House of Anubis
00:06:10 31-12-19 MEDIASYNC-JOB => Can't seem to process show House of Cards (US), check the logs for more details!
00:06:10 31-12-19 MEDIASYNC-JOB => Processed (181/451) House of Cards (US)
00:06:11 31-12-19 MEDIASYNC-JOB => Can't seem to process show How I Met Your Mother, check the logs for more details!
00:06:11 31-12-19 MEDIASYNC-JOB => Processed (182/451) How I Met Your Mother
00:06:11 31-12-19 MEDIASYNC-JOB => Can't seem to process show The Hunt for the Zodiac Killer, check the logs for more details!
00:06:11 31-12-19 MEDIASYNC-JOB => Processed (183/451) The Hunt for the Zodiac Killer
00:06:11 31-12-19 MEDIASYNC-JOB => Can't seem to process show Hyperdrive, check the logs for more details!
00:06:11 31-12-19 MEDIASYNC-JOB => Processed (184/451) Hyperdrive
00:06:12 31-12-19 MEDIASYNC-JOB => Can't seem to process show I Feel Bad, check the logs for more details!
00:06:12 31-12-19 MEDIASYNC-JOB => Processed (185/451) I Feel Bad
00:06:12 31-12-19 MEDIASYNC-JOB => Can't seem to process show I Love Dick, check the logs for more details!
00:06:12 31-12-19 MEDIASYNC-JOB => Processed (186/451) I Love Dick
00:06:12 31-12-19 MEDIASYNC-JOB => Can't seem to process show iCarly, check the logs for more details!
00:06:13 31-12-19 MEDIASYNC-JOB => Processed (187/451) iCarly
 
 
Cause it keeps starting over and over
 
 
Edited by Glbjr29
Link to comment
Share on other sites

Happy2Play

 

Why is all my processes failing?

 

 00:06:09 31-12-19 MEDIASYNC-JOB => Processed (178/451) Heroes

00:06:10 31-12-19 MEDIASYNC-JOB => Can't seem to process show House, check the logs for more details!
00:06:10 31-12-19 MEDIASYNC-JOB => Processed (179/451) House
00:06:10 31-12-19 MEDIASYNC-JOB => Can't seem to process show House of Anubis, check the logs for more details!
00:06:10 31-12-19 MEDIASYNC-JOB => Processed (180/451) House of Anubis
00:06:10 31-12-19 MEDIASYNC-JOB => Can't seem to process show House of Cards (US), check the logs for more details!
00:06:10 31-12-19 MEDIASYNC-JOB => Processed (181/451) House of Cards (US)
00:06:11 31-12-19 MEDIASYNC-JOB => Can't seem to process show How I Met Your Mother, check the logs for more details!
00:06:11 31-12-19 MEDIASYNC-JOB => Processed (182/451) How I Met Your Mother
00:06:11 31-12-19 MEDIASYNC-JOB => Can't seem to process show The Hunt for the Zodiac Killer, check the logs for more details!
00:06:11 31-12-19 MEDIASYNC-JOB => Processed (183/451) The Hunt for the Zodiac Killer
00:06:11 31-12-19 MEDIASYNC-JOB => Can't seem to process show Hyperdrive, check the logs for more details!
00:06:11 31-12-19 MEDIASYNC-JOB => Processed (184/451) Hyperdrive
00:06:12 31-12-19 MEDIASYNC-JOB => Can't seem to process show I Feel Bad, check the logs for more details!
00:06:12 31-12-19 MEDIASYNC-JOB => Processed (185/451) I Feel Bad
00:06:12 31-12-19 MEDIASYNC-JOB => Can't seem to process show I Love Dick, check the logs for more details!
00:06:12 31-12-19 MEDIASYNC-JOB => Processed (186/451) I Love Dick
00:06:12 31-12-19 MEDIASYNC-JOB => Can't seem to process show iCarly, check the logs for more details!
00:06:13 31-12-19 MEDIASYNC-JOB => Processed (187/451) iCarly
 
 
Cause it keeps starting over and over
 
 

 

You would need to attach the log to see the details on why they failed.

  • Like 1
Link to comment
Share on other sites

darkassassin07

I would be willing to bet that's another example of a currently known bug regarding duplicate keys being inserted into embystats db.

 

It's something that's being worked on, but development isn't super quick.

 

Personally with the current version, I'm seeing the sync throwing errors on half a dozen series, then claiming to fail to finish after around 3min. However once its stopped, the majority of statistics are still available.

 

 

As a temporary solution you could revert to an older release such as beta.13 until beta.15 is released and see how that goes.

 

 

Keep in mind embystat is a project seprate from emby being developed in the free time of one guy (a community member) that also works full time as a software dev.

Doing something for a living all week, then coming home to do it some more is never easy.

 

 

Gotta applaud your efforts @@reggi, we all appreciate it :D

Edited by darkassassin07
  • Like 2
Link to comment
Share on other sites

Happy2Play

Only error I am getting is for Series that does not have a TVDB id.  Other then that Media sync takes about 7 minutes.

2019-12-30 21:44:25.1635 [INFO] MEDIASYNC-JOB	Found 2 show for Yoga library 
2019-12-30 21:44:25.2032 [INFO] THETVDB-CLIENT	Call to THETVDB: https://api.thetvdb.com/series//episodes?page=1 
2019-12-30 21:44:25.3944 [ERROR] MEDIASYNC-JOB	Can't seem to process show DDP yoga, check the logs for more details! 
2019-12-30 21:44:25.3944 [ERROR] System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at EmbyStat.Clients.Tvdb.TvdbClient.GetEpisodes(String seriesId, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Clients.Tvdb\TvdbClient.cs:line 66
   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.ProgressMissingEpisodesAsync(Show show, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 330
   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.GetMissingEpisodesFromTvdbAsync(Show show, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 306 System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at EmbyStat.Clients.Tvdb.TvdbClient.GetEpisodes(String seriesId, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Clients.Tvdb\TvdbClient.cs:line 66
   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.ProgressMissingEpisodesAsync(Show show, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 330
   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.GetMissingEpisodesFromTvdbAsync(Show show, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 306
2019-12-30 21:44:25.5023 [INFO] MEDIASYNC-JOB	Processed (0/2) DDP yoga 


2019-12-30 21:48:45.5927 [INFO] MEDIASYNC-JOB Job finished after 7 minutes.

Issue already reported on Github
https://github.com/mregni/EmbyStat/issues/1029

Edited by Happy2Play
  • Like 1
Link to comment
Share on other sites

darkassassin07

I get one that looks like this with a few different series:

 

2019-12-30 19:09:03.1193 [ERROR] MEDIASYNC-JOB	Can't seem to process show Good Eats, check the logs for more details! 
2019-12-30 19:09:03.1193 [ERROR] LiteDB.LiteException: Cannot insert duplicate key in unique index '_id'. The duplicate value is '106631'.
   at LiteDB.IndexService.AddNode(CollectionIndex index, BsonValue key, Byte level, IndexNode last)
   at LiteDB.IndexService.AddNode(CollectionIndex index, BsonValue key, IndexNode last)
   at LiteDB.LiteEngine.InsertDocument(CollectionPage col, BsonDocument doc, BsonType autoId)
   at LiteDB.LiteEngine.<>c__DisplayClass22_0.<Insert>b__0(CollectionPage col)
   at LiteDB.LiteEngine.Transaction[T](String collection, Boolean addIfNotExists, Func`2 action)
   at LiteDB.LiteEngine.Insert(String collection, BsonDocument doc, BsonType autoId)
   at LiteDB.LiteCollection`1.Insert(T document)
   at EmbyStat.Repositories.ShowRepository.<>c__DisplayClass4_0.<AddEpisode>b__0() in d:\a\1\s\EmbyStat.Repositories\ShowRepository.cs:line 69
   at EmbyStat.Repositories.BaseRepository.ExecuteQuery(Action query) in d:\a\1\s\EmbyStat.Repositories\BaseRepository.cs:line 29
   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.ProgressMissingEpisodesAsync(Show show, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 353
   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.GetMissingEpisodesFromTvdbAsync(Show show, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 306 LiteDB.LiteException: Cannot insert duplicate key in unique index '_id'. The duplicate value is '106631'.
   at LiteDB.IndexService.AddNode(CollectionIndex index, BsonValue key, Byte level, IndexNode last)
   at LiteDB.IndexService.AddNode(CollectionIndex index, BsonValue key, IndexNode last)
   at LiteDB.LiteEngine.InsertDocument(CollectionPage col, BsonDocument doc, BsonType autoId)
   at LiteDB.LiteEngine.<>c__DisplayClass22_0.<Insert>b__0(CollectionPage col)
   at LiteDB.LiteEngine.Transaction[T](String collection, Boolean addIfNotExists, Func`2 action)
   at LiteDB.LiteEngine.Insert(String collection, BsonDocument doc, BsonType autoId)
   at LiteDB.LiteCollection`1.Insert(T document)
   at EmbyStat.Repositories.ShowRepository.<>c__DisplayClass4_0.<AddEpisode>b__0() in d:\a\1\s\EmbyStat.Repositories\ShowRepository.cs:line 69
   at EmbyStat.Repositories.BaseRepository.ExecuteQuery(Action query) in d:\a\1\s\EmbyStat.Repositories\BaseRepository.cs:line 29
   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.ProgressMissingEpisodesAsync(Show show, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 353
   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.GetMissingEpisodesFromTvdbAsync(Show show, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 306
  • Like 1
Link to comment
Share on other sites

I got Embystat Working but my user info doesn't work as well as the dashboard. Anyone else having the same issue.

Edited by Glbjr29
Link to comment
Share on other sites

darkassassin07

Keep in mind embystat is a project seprate from emby being developed in the free time of one guy (a community member) that also works full time as a software dev.

Doing something for a living all week, then coming home to do it some more is never easy.

  • Like 1
Link to comment
Share on other sites

Happy2Play

Ok thanks. Hopefully they will get it to load faster also. Are they still working on it or is it at a stand still.

You can see the dev commented in that issue on github yesterday.

  • Like 1
Link to comment
Share on other sites

Alex3111

I got Embystat Working but my user info doesn't work as well as the dashboard. Anyone else having the same issue.

 

I have the same thing, I think it's a working progress, and that is part that is not working yet; I think...  He'll get there, as the plugin used to have this part working.

Link to comment
Share on other sites

Alex3111

Ok thanks. Hopefully they will get it to load faster also. Are they still working on it or is it at a stand still.

 

I am SURE, that if you $$$, he'll get done faster!  Heh...

  • Like 1
Link to comment
Share on other sites

Alex3111

Is there any place you want/need us to post or send you the log files.  For me, on Debian v8 Netgear ReadyNAS 314, it pretty much worked for the day that I installed it, 3 days later I wanted to see if it was getting any data, and it seemed to be locked up.  After rebooting the NAS, which I hadn't done in weeks, and 'systemctl stop embystat.service' and start, it would still not connect or update at least.  Decided to wipe the folder and start from scratch again.  It was able to do an update.  2 days have gone by, and nothing again; can't get stats even trying systemctl stop, start, status, and the status is good, but still won't show any stats.  Also since I am running Emby 4.4.0.5 Beta, I stopped the service, but made sure before stopping it to do the small sync, check for new updates, database cleanup, and check emby connection to make sure they are talking.  It was able to show the 4.4.0.5 version, but still won't get moving on the media sync.  Sometimes it stalls at 0%, sometimes at 70%. Noticed at 70% it has already done the movies, and it tries to do the show episodes.  At 0%, well, nothing shows on the screen job log side.

Let me know!  We'll keep trying.

 

Debian x64 local install to /home/embystat folder, running from embystat.service

Equipment:  Netgear ReadyNAS 314 NAS server; same that I run my Emby server Beta 4.4.0.5; previously 4.4.0.4

Link to comment
Share on other sites

reggi

@@Alex3111, it is normal that nothing really "moves" in EmbyStat at the moment because the user statistics are still broken. So if you didn't add any new movies or episodes to Emby it will generate the same statistics every run.

Currently I'm not developing to the beta Emby API, meaning that I'm always running a bit behind on their new implementation for now. That could be an issue as well for your beta server.

 

If you want you can PM me your logs, create a github issue on https://github.com/mregni/EmbyStat/issues/new/choose or on gitter: https://gitter.im/EmbyStat/Lobby. It is indeed strange that the job hangs on 0% or 70% so that might be a bug :)

Link to comment
Share on other sites

reggi

So, I created a first new beta version to see if I fixed the duplicate issue. Feel free to download the beta.15 version and rerun your sync job.

 

Complete list of fixes in this release:

- Fixed duplicate id error
- Merging duplicate shows in the same library
- Fixed Null ref exception in TVDB client
- Added "under construction image"
- Added paging to show overview page
 
I did notice that if you have over 1000 shows on Emby it can really slow down the show statistic calculations. It can take 20-30 minutes to calculate them :(
I will have to refactor the calculations some more to decrease the time to a more acceptable value.
  • Like 1
Link to comment
Share on other sites

rdmiller13
It ran through all 358 series that I have with no issues, but then kicked back at the very end.

 

2020-01-06 06:26:13.7124 [ERROR] Error while running job System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.

   at lambda_method(Closure , Object , Object )

   at LiteDB.BsonMapper.DeserializeObject(Type type, Object obj, BsonDocument value)

   at LiteDB.BsonMapper.Deserialize(Type type, BsonValue value)

   at LiteDB.BsonMapper.DeserializeList(Type type, BsonArray value)

   at LiteDB.BsonMapper.Deserialize(Type type, BsonValue value)

   at LiteDB.BsonMapper.<>c__DisplayClass45_0.<RegisterDbRefList>b__1(BsonValue bson, BsonMapper m)

   at LiteDB.BsonMapper.DeserializeObject(Type type, Object obj, BsonDocument value)

   at LiteDB.BsonMapper.Deserialize(Type type, BsonValue value)

   at LiteDB.BsonMapper.ToObject[T](BsonDocument doc)

   at LiteDB.LiteCollection`1.Find(Query query, Int32 skip, Int32 limit)+MoveNext()

   at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)

   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

   at EmbyStat.Repositories.ShowRepository.<>c__DisplayClass2_0.<RemoveShowsThatAreNotUpdated>b__0() in d:\a\1\s\EmbyStat.Repositories\ShowRepository.cs:line 40

   at EmbyStat.Repositories.BaseRepository.ExecuteQuery(Action query) in d:\a\1\s\EmbyStat.Repositories\BaseRepository.cs:line 29

   at EmbyStat.Repositories.ShowRepository.RemoveShowsThatAreNotUpdated(DateTime startTime) in d:\a\1\s\EmbyStat.Repositories\ShowRepository.cs:line 49

   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.ProcessShowsAsync(IEnumerable`1 libraries, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 206

   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.RunJobAsync() in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 85

   at EmbyStat.Jobs.BaseJob.Execute() in d:\a\1\s\EmbyStat.Jobs\BaseJob.cs:line 54

2020-01-06 06:26:13.8303 [ERROR] MEDIASYNC-JOB Job failed, check logs for more info. 

2020-01-06 06:26:13.9975 [WARN] Failed to process the job 'a541ee59-d140-447a-ae9b-8b087f3eae8f': an exception occurred. Retry attempt 1 of 2 will be performed in 00:00:37. System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.

   at lambda_method(Closure , Object , Object )

   at LiteDB.BsonMapper.DeserializeObject(Type type, Object obj, BsonDocument value)

   at LiteDB.BsonMapper.Deserialize(Type type, BsonValue value)

   at LiteDB.BsonMapper.DeserializeList(Type type, BsonArray value)

   at LiteDB.BsonMapper.Deserialize(Type type, BsonValue value)

   at LiteDB.BsonMapper.<>c__DisplayClass45_0.<RegisterDbRefList>b__1(BsonValue bson, BsonMapper m)

   at LiteDB.BsonMapper.DeserializeObject(Type type, Object obj, BsonDocument value)

   at LiteDB.BsonMapper.Deserialize(Type type, BsonValue value)

   at LiteDB.BsonMapper.ToObject[T](BsonDocument doc)

   at LiteDB.LiteCollection`1.Find(Query query, Int32 skip, Int32 limit)+MoveNext()

   at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)

   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

   at EmbyStat.Repositories.ShowRepository.<>c__DisplayClass2_0.<RemoveShowsThatAreNotUpdated>b__0() in d:\a\1\s\EmbyStat.Repositories\ShowRepository.cs:line 40

   at EmbyStat.Repositories.BaseRepository.ExecuteQuery(Action query) in d:\a\1\s\EmbyStat.Repositories\BaseRepository.cs:line 29

   at EmbyStat.Repositories.ShowRepository.RemoveShowsThatAreNotUpdated(DateTime startTime) in d:\a\1\s\EmbyStat.Repositories\ShowRepository.cs:line 49

   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.ProcessShowsAsync(IEnumerable`1 libraries, CancellationToken cancellationToken) in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 206

   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.RunJobAsync() in d:\a\1\s\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 85

   at EmbyStat.Jobs.BaseJob.Execute() in d:\a\1\s\EmbyStat.Jobs\BaseJob.cs:line 54

   at EmbyStat.Jobs.BaseJob.Execute() in d:\a\1\s\EmbyStat.Jobs\BaseJob.cs:line 66

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

Link to comment
Share on other sites

reggi

Did you install a new instance of the server or upgraded the beta.14 version to .15? Best thing is to run a clean install of EmbyStat.

I'll try to add a database migration to map Id from int to string in .16

 

EDIT: If you open the show or movie page you should be able to see your statistics. First load will take some time

Edited by reggi
Link to comment
Share on other sites

reggi

Running a new instance will fix the error probably. The statistics calculation will take a long time anyway :P

At the moment I still have to load the database into memory to calculate the statistics, that's BAD practice so I will need to switch that asap.

Link to comment
Share on other sites

rdmiller13

Worked like a champ!  Viewing too - one thing missing that I used to be able to do was click on the percentage column and it'd sort - that coming back?

 

Thanks!  Course now I have to go clean up my missing episodes :P

Link to comment
Share on other sites

reggi

Worked like a champ!  Viewing too - one thing missing that I used to be able to do was click on the percentage column and it'd sort - that coming back?

 

Thanks!  Course now I have to go clean up my missing episodes :P

 

Yeah, the idea is to bring that back as well. I removed the sorting because of the click event you have now on each show row. But I'm thinking of remove that and instead add a second page to view the missing episodes or a popup. Don't know what would be best :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...