Jump to content

Developing a standalone embystat server


reggi

Recommended Posts

arrbee99

How do you run it ?

 

I downloaded it to windows, unzipped it, ran embystat.exe and got a box with stuff in it...

 

5ce5c88b0cecb_Embystatbox.jpg

Link to comment
Share on other sites

Spaceboy

How do you run it ?

 

I downloaded it to windows, unzipped it, ran embystat.exe and got a box with stuff in it...

 

5ce5c88b0cecb_Embystatbox.jpg

yep then open localhost:5432 or ip:5432
Link to comment
Share on other sites

arrbee99

OK, I'll find some instructions. Ta.

 

Hopefully it'll be automatic at some point as its a bit off-putting tbh.

Link to comment
Share on other sites

cuzz1369

OK, I'll find some instructions. Ta.

 

Hopefully it'll be automatic at some point as its a bit off-putting tbh.

It is automatic. It's a web app. Open a web browser and go to http://localhost:5423

 

Sent from my SM-G965W using Tapatalk

Edited by cuzz1369
Link to comment
Share on other sites

Spaceboy

OK, I'll find some instructions. Ta.

 

Hopefully it'll be automatic at some point as its a bit off-putting tbh.

as cuzz said it is automatic, which bit of the text in the command window or my instruction don’t you understand??
Link to comment
Share on other sites

arrbee99

as cuzz said it is automatic, which bit of the text in the command window or my instruction don’t you understand??

 

Well, anything with ports that isn't automatic baffles me (not that difficult in my case), but mainly I think in the intro, post #1 of this thread, I didn't spot anything about going to a web page to actually set thing up. Again, it might be completely obvious you need to do that but not, sadly, to me.

 

Also, the box says type ctrl+c to shut down. Does that mean to use Embystat I should never shut it down, just close the box and it will stay running ?

 

The box said 5432 is now listening, which to me implies all working and maybe it is, but now what ? open web page and set up.

 

The box said port 5432 but the link cuzz gave is port 5423 - just a typo I presume.

 

Also, while I've been typing this annoying newbie stuff, should I worry about this wizard still running message I'm getting after I said to 'downloading data' or something ? (it said run or update something at the end of the wizard so I did)

 

5ce5d31c835f6_Embystatwizardmessage.jpg

Link to comment
Share on other sites

arrbee99

Though actually running through some tasks (orange buttons) seems to be all good (wizard not finished message doesn't seem to matter)

Link to comment
Share on other sites

reggi

@@arrbee99, keep in mind you are running a beta version of the app (no stable version is releasedd yet) meaning that it is not all setup to "just work". Have to put some time and effort in documentation in "how to install" on different OS systems.

 

As for the orange error, this is because EmbyStat starts to ping the Emby server from the moment you boot EmbyStat. But because at that point you didn't finish the wizard it can't ping anything hence the orange warning. This will change in the future because I will propably remove the PING job logging from the UI.

 

Have fun testing the app!

  • Like 1
Link to comment
Share on other sites

adrianwi

I'll give it another spin, but the last few times I've tried it in a Docker container I've encountered issues with the disk space on my Ubuntu VM being completely used up.  I need to completely rule out anything else, but the last time I don't recall changing anything other than running the embystats container.  When I deleted that it freed up all of the space.

Link to comment
Share on other sites

reggi

That is a strange issue indeed. I have been testing it on an Ubuntu VM as well without any problems. Maybe the database exploded or something when trying to write, that's the only disk IO that happens anyway. 

Let's hope, when I release the new version with the NOSQL db your issue will be fixed as well!

 

Did you every had a chance to look what files where taking up your disk?

Link to comment
Share on other sites

adrianwi

No, it didn't behave very well with zero free bytes.  I just about managed to kiill the embystats container and it it jumped from 100% to around 23, so I'm pretty sure that was the culprit.

 

I need a stable VM at the minute as I'm running a survey for someone, but once that's complete I'll give the latest beta another shot.

Link to comment
Share on other sites

cuzz1369

I'll give it another spin, but the last few times I've tried it in a Docker container I've encountered issues with the disk space on my Ubuntu VM being completely used up. I need to completely rule out anything else, but the last time I don't recall changing anything other than running the embystats container. When I deleted that it freed up all of the space.

I had the same issue with docker running on ubuntu 16.04.

 

Sent from my SM-G965W using Tapatalk

Link to comment
Share on other sites

arrbee99

@@arrbee99, keep in mind you are running a beta version of the app (no stable version is releasedd yet) meaning that it is not all setup to "just work". Have to put some time and effort in documentation in "how to install" on different OS systems.

 

As for the orange error, this is because EmbyStat starts to ping the Emby server from the moment you boot EmbyStat. But because at that point you didn't finish the wizard it can't ping anything hence the orange warning. This will change in the future because I will propably remove the PING job logging from the UI.

 

Have fun testing the app!

 

All fair enough, it was just a few comments as someone who saw the other stats plugin heading for removal and thought its time to try this new one.

 

While I'm typing, is there a plan somewhere to add something in Emby to send you to the new stats (not) plugin like the new stats thing has a button to send you to Emby ?

Link to comment
Share on other sites

shadofall

just FYI port 5432 is used by postgresql  which is installed on all synology devices by default

  • Like 1
Link to comment
Share on other sites

reggi

Didn't knew that about the port on Synology. But if you are running in a docker you can change the mapping. If you run it from command just add the --port flag.

But maybe I should switch to another default port instead!

 

For the storage problem in the Ubuntu docker image. Let's see what happens when I switch to NOSQL database, let's hope that fixes the problem.

 

@@arrbee99, I don't think there will come a button in Emby to link to EmbyStat. Possibility is that I create a Emby plugin that links to EmbyStat (that way I also can capture more events as well) but building the plugin is not on the roadmap at the moment.

  • Like 2
Link to comment
Share on other sites

hshah

Didn't knew that about the port on Synology. But if you are running in a docker you can change the mapping. If you run it from command just add the --port flag.

But maybe I should switch to another default port instead!

 

Yes you did lol :P

 

https://emby.media/community/index.php?/topic/56640-developing-a-standalone-embystat-server/?view=findpost&p=726428

 

Synology prevents me from using 5432 as the local port because one of its background services uses it, so initially I tried the settings shown in the 2nd screenshot.  The container logs stated that it was listening on port 5432, which was expected, but I couldn't access the UI using 65432.  I'm not entirely sure why, especially since I have Tautulli running in another container with 34400/8181 (local/container) and I access it absolutely fine using 34400.  I didn't bother investigating and just set "--port 65432" with bridged mode disabled.

  • Like 1
Link to comment
Share on other sites

Schar

Hi

 

This looks like it will be really neat. Just downloaded it and cannot get my initial media sync to work; log extract below. I installed :latest-win (0.37). 

 

Second question; tried the docker on Unraid, got it installed but cannot seem to connect to it at all; running with this command:

docker run -d --name='EmbyStat' --net='bridge' -e HOST_OS="Unraid" -p '5432:5432/tcp' 'uping/embystat:latest-linux' 

Am I missing something there?

2019-05-26 00:25:08.1982 [INFO] MEDIASYNC-JOB	Starting job 
2019-05-26 00:25:08.1982 [INFO] EMBY-CLIENT	Sending a ping to Emby 
2019-05-26 00:25:08.1982 [INFO] EMBY-CLIENT	Sending POST: http://xxx.xxx.xxx.xxx:xxxx/emby/System/Ping?format=json 
2019-05-26 00:25:08.1982 [INFO] MEDIASYNC-JOB	First delete all existing media and root media collections from database so we have a clean start. 
2019-05-26 00:25:08.2264 [INFO] MEDIASYNC-JOB	Asking Emby for all root folders 
2019-05-26 00:25:08.2264 [INFO] EMBY-CLIENT	Sending GET: http://xxx.xxx.xxx.xxx:xxxx/emby//Library/MediaFolders?format=json 
2019-05-26 00:25:08.2388 [INFO] Received web socket message: Sessions 
2019-05-26 00:25:08.2760 [ERROR] Error while running job System.InvalidOperationException: The instance of entity type 'Collection' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.ThrowIdentityConflict(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.IdentityMap`1.Add(TKey key, InternalEntityEntry entry, Boolean updateDuplicate)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking(InternalEntityEntry entry)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState(EntityState oldState, EntityState newState, Boolean acceptChanges)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction(EntityEntryGraphNode node, Boolean force)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph[TState](EntityEntryGraphNode node, TState state, Func`3 handleNode)
   at Microsoft.EntityFrameworkCore.DbContext.SetEntityState[TEntity](TEntity entity, EntityState entityState)
   at EmbyStat.Repositories.CollectionRepository.AddOrUpdateRange(IEnumerable`1 collections) in D:\Yoda\work\aa794b64fcf59423\EmbyStat.Repositories\CollectionRepository.cs:line 36
   at EmbyStat.Jobs.Jobs.Sync.MediaSyncJob.RunJob() in D:\Yoda\work\aa794b64fcf59423\EmbyStat.Jobs\Jobs\Sync\MediaSyncJob.cs:line 83
   at EmbyStat.Jobs.BaseJob.Execute() in D:\Yoda\work\aa794b64fcf59423\EmbyStat.Jobs\BaseJob.cs:line 46
2019-05-26 00:25:08.2760 [ERROR] Failed executing DbCommand (3ms) [Parameters=[@p0='?' (Size = 32), @p1='?' (Size = 5), @p2='?' (Size = 32), @p3='?'], CommandType='Text', CommandTimeout='30']
INSERT INTO "Collections" ("Id", "Name", "PrimaryImage", "Type")
VALUES (@p0, @p1, @p2, @p3); Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 19: 'UNIQUE constraint failed: Collections.Id'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
2019-05-26 00:25:08.2928 [ERROR] An exception occurred in the database while saving changes for context type 'EmbyStat.Repositories.ApplicationDbContext'.
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException: SQLite Error 19: 'UNIQUE constraint failed: Collections.Id'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(DbContext _, ValueTuple`2 parameters)
   at Microsoft.EntityFrameworkCore.Storage.Internal.NoopExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess) Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException: SQLite Error 19: 'UNIQUE constraint failed: Collections.Id'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(DbContext _, ValueTuple`2 parameters)
   at Microsoft.EntityFrameworkCore.Storage.Internal.NoopExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave)
   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
   at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
2019-05-26 00:25:08.2928 [ERROR] Failed to process the job '09bd334e-274e-4c71-8440-612128cff199': an exception occurred. Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException: SQLite Error 19: 'UNIQUE constraint failed: Collections.Id'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(DbContext _, ValueTuple`2 parameters)
   at Microsoft.EntityFrameworkCore.Storage.Internal.NoopExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnec
Link to comment
Share on other sites

reggi

@@Schar

That is one hell of an ugly exception you got there :( I'll try to investigate it but can't promise I will find something fast. I'm going to move to a NOSQL solution anyway and then the error will go away normally.

 

As for the docker command, looks good to me. I know there a re some other guys testing it on unraid (they do have update problems, unraid will install a new container every time I push a new image to docker hub). 

Link to comment
Share on other sites

archangelz

I have the same issue as Schar above, can't get past the initial sync and it looks similar to issue #634. 

2019-05-24.log

Edited by archangelz
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...