Jump to content


Photo

Developing a standalone embystat server

emby statistics server

  • Please log in to reply
330 replies to this topic

#121 pir8radio OFFLINE  

pir8radio

    NGINX

  • Members
  • 2783 posts
  • Local time: 02:04 PM
  • LocationChicago

Posted 11 February 2019 - 09:37 AM

@pir8radio

 

I will update the first post today to make the download links more clear!

 

As for the nginx support, what do you need exactly? EmbyStat does not need IIS, it can also be hosted by itself (using Kestrel) 

I found these docs in the MS website => https://docs.microso...aspnetcore-2.2 

 

Not sure if you need some code changes to let it work on Nginx. Feel free to test it and let me know, I will try it myself later this week as well.

 

i assume it uses some kind of server side scripting?  asp, php?   I know there are some modules for nginx. 



#122 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 356 posts
  • Local time: 09:04 PM
  • LocationAntwerp, Belgium

Posted 11 February 2019 - 10:16 AM

I'm running my backend in C# with .net CORE yes. 

 

I did a fast search and indeed it should be possible to host it with nginx. Have to check it more in depth later in the next couple of days.



#123 mgworek ONLINE  

mgworek

    Advanced Member

  • Members
  • 604 posts
  • Local time: 03:04 PM

Posted 11 February 2019 - 10:38 AM

@mgworek @Macieksoft

 

Are you guys running EmbyStat in docker on your machines? Feel free to send me the log files you find in the /Logs directory so I can have a look as well.

I will try to setup an unraid test machine as well, but I have no experience with unraid at all :)

 

 

Yea, I am running it in a Docker on my unraid machine. I won't be able to do it today but I will try running it again this week and get you logs.

 

Thanks!



#124 mgworek ONLINE  

mgworek

    Advanced Member

  • Members
  • 604 posts
  • Local time: 03:04 PM

Posted 12 February 2019 - 04:11 PM

Yea, I am running it in a Docker on my unraid machine. I won't be able to do it today but I will try running it again this week and get you logs.

 

Thanks!

 

 

@reggi 

 

I start fresh with a new docker template and it is working now. Not sure why it wasn't working before. It started and stopped a few seconds later. I didn't see anything when viewing the logs.

 

Quick question. Is there a config directory or anything I should be setting in the docker to save settings to my cache drive like other apps?

 

it loads but won't connect to my server. "Getting Emby token failed. Please check your credentials and address"


Edited by mgworek, 12 February 2019 - 04:25 PM.


#125 Macieksoft OFFLINE  

Macieksoft

    Member

  • Members
  • 23 posts
  • Local time: 03:04 PM
  • LocationMaryland

Posted 18 February 2019 - 11:34 AM

@reggi 

 

I start fresh with a new docker template and it is working now. Not sure why it wasn't working before. It started and stopped a few seconds later. I didn't see anything when viewing the logs.

 

Quick question. Is there a config directory or anything I should be setting in the docker to save settings to my cache drive like other apps?

 

it loads but won't connect to my server. "Getting Emby token failed. Please check your credentials and address"

 

Im still getting the issue where the docker stops after a couple seconds. How exactly did you set up the docker on your side? Thanks.  



#126 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 356 posts
  • Local time: 09:04 PM
  • LocationAntwerp, Belgium

Posted 18 February 2019 - 03:21 PM

Hey @Macieksoft

 

Sorry for not replying sooner. What docker image are you running? Best thing to do is running the nightly builds for now because the beta version has some problems with docker still.

 

You can always create a share to /Logs so you can access the log files. In the new release you will also be able to access your user settings in a json file.

(at the moment the settings are still stored in the database located in the root folder)



#127 Macieksoft OFFLINE  

Macieksoft

    Member

  • Members
  • 23 posts
  • Local time: 03:04 PM
  • LocationMaryland

Posted 18 February 2019 - 04:30 PM

Hey @Macieksoft

 

Sorry for not replying sooner. What docker image are you running? Best thing to do is running the nightly builds for now because the beta version has some problems with docker still.

 

You can always create a share to /Logs so you can access the log files. In the new release you will also be able to access your user settings in a json file.

(at the moment the settings are still stored in the database located in the root folder)

I tried the beta linux version at first, but the logs just said "application shutting down", just tried the nightly version (just assigned a port too it, not sure if it needs a share or acess of some sort). The logs just said:

 

Sequence contains no elements

SYSTEM Server shutdown

 

Im not very knowledgeable in docker so my help is prob very limited. Im assuming im missing a point where I create a share to it but when I tired to give it an appdata folder is just failed. I couldn't manage to get any access to more detailed logs.



#128 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 356 posts
  • Local time: 09:04 PM
  • LocationAntwerp, Belgium

Posted 18 February 2019 - 05:14 PM

Oke, I found the problem. I will need to update the database migrations but they are still on a side branch. 

 

I will try to make a new build this night and push the new version to docker.

 

If you want to mount the Logs folder use the following docker command: docker run -p <port>:5432 -v <path-on-host>:/app/Logs uping/embystat:nightly-linux



#129 Macieksoft OFFLINE  

Macieksoft

    Member

  • Members
  • 23 posts
  • Local time: 03:04 PM
  • LocationMaryland

Posted 21 February 2019 - 01:50 PM

Oke, I found the problem. I will need to update the database migrations but they are still on a side branch. 

 

I will try to make a new build this night and push the new version to docker.

 

If you want to mount the Logs folder use the following docker command: docker run -p <port>:5432 -v <path-on-host>:/app/Logs uping/embystat:nightly-linux

Thanks! Got it up and running on unraid, doing the media sync now, ill report back if I run into any problems. 



#130 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 356 posts
  • Local time: 09:04 PM
  • LocationAntwerp, Belgium

Posted 23 February 2019 - 04:01 AM

Hey guys,

 

So I got a new release ready for you (sorry for the long release interval)

Had some refactor work done as well as setting up the web socket connection to Emby, after some long night I can finally say that EmbyStat is receiving life event data from Emby. At this moment it is still limited to play events (start, stopped and paused) but it's a start.

 

Release noted:

* Live session data is stored
* Added user sync
* Added device sync
* Created new user page (displaying session data)
* Added option to enable Exception logging
* Updated to Angular 7
* Some refactoring
* Minor bug fixes 

 

Also you can find your settings in the Settings/usersettings.json file. If you are running docker you can easily create a share to it with "-v /path/on/host:/app/Settings"

And I installed some online exception logging on Rollbar, this means that I will receive a message every time your system get's an exception, this will make my life easier and will help me fix bugs faster. This option is not enabled by default! So feel free to go to the settings page and enable the option. You will have to restart the server after you hit the save button. If you want to know what data is logged feel free to send me a message! In short, I receive the exception details, release train and version number. I do not receive your log files, your settings files, IP address, ...

 

Feel free to test this version and let me know what you think about it.

 

Next release I will increase the Emby events and calculate some more statistics about the user usage and try to increase the server stability by refactoring and bug fixing.


  • Happy2Play, neik and DRAGUNSLAYER like this

#131 pir8radio OFFLINE  

pir8radio

    NGINX

  • Members
  • 2783 posts
  • Local time: 02:04 PM
  • LocationChicago

Posted 24 February 2019 - 12:16 AM

2019-02-23 22:14:26 [INF] 1 scheduled job(s) enqueued.
2019-02-23 22:14:35 [INF] SMALLEMBYSYNC-JOB	Starting job
2019-02-23 22:14:35 [INF] EMBY-CLIENT	Sending GET: http://xxx.xxx.xxx.xxx:xxxx/emby/System/Info?format=json
2019-02-23 22:14:35 [INF] Received web socket message: UserUpdated
2019-02-23 22:14:35 [ERR] Error while running job
Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException: SQLite Error 19: 'NOT NULL constraint failed: ServerInfo.LocalAddress'.
   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)
   at EmbyStat.Repositories.EmbyRepository.AddOrUpdateServerInfo(ServerInfo entity) in D:\Yoda\work\aa794b64fcf59423\EmbyStat.Repositories\EmbyRepository.cs:line 88
   at EmbyStat.Services.EmbyService.GetAndProcessServerInfo(String embyAddress, String accessToken) in D:\Yoda\work\aa794b64fcf59423\EmbyStat.Services\EmbyService.cs:line 215
   at EmbyStat.Jobs.Jobs.Sync.SmallSyncJob.RunJob() in D:\Yoda\work\aa794b64fcf59423\EmbyStat.Jobs\Jobs\Sync\SmallSyncJob.cs:line 29
   at EmbyStat.Jobs.BaseJob.Execute() in D:\Yoda\work\aa794b64fcf59423\EmbyStat.Jobs\BaseJob.cs:line 44
2019-02-23 22:14:35 [ERR] SMALLEMBYSYNC-JOB	Job failed, check logs for more info.

Doesn't seem to handle not having a local server address.


Edited by pir8radio, 24 February 2019 - 12:17 AM.


#132 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 356 posts
  • Local time: 09:04 PM
  • LocationAntwerp, Belgium

Posted 24 February 2019 - 08:45 AM

Thanks for the log. I didn't knew it was possible that you don't have a local address. Let me fix it in 31 quick.

 

I also noticed that I have some events that fails mapping, but I'm not using the events at the moment. So will fix that as well today.


  • DRAGUNSLAYER likes this

#133 pir8radio OFFLINE  

pir8radio

    NGINX

  • Members
  • 2783 posts
  • Local time: 02:04 PM
  • LocationChicago

Posted 24 February 2019 - 10:03 AM

Thanks for the log. I didn't knew it was possible that you don't have a local address. Let me fix it in 31 quick.

 

I also noticed that I have some events that fails mapping, but I'm not using the events at the moment. So will fix that as well today.

 

Yea if you bind the local address to 127.0.0.1  emby won't have a local address...   My emby server is directly attached to the internet backbone, there really is no local network.   So all I have is a WAN.   Thanks!!


  • reggi and DRAGUNSLAYER like this

#134 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 356 posts
  • Local time: 09:04 PM
  • LocationAntwerp, Belgium

Posted 24 February 2019 - 01:54 PM

Thanks for the info @pir8radio, I never used Emby without local address that's why it never failed on my setup.

 

I pushed a new update (version 0.1.0-beta.32) that should fix your problem. Can you verify?


  • DRAGUNSLAYER likes this

#135 Kyouma OFFLINE  

Kyouma

    Advanced Member

  • Members
  • 45 posts
  • Local time: 09:04 PM

Posted 09 March 2019 - 05:41 AM

Just wanted to test this on my NAS using docker, but it´s not working. I search for embystat and try to download it, at first it looks like it is downloading, but then it vanishes.

Here is a screencapture so you can see what i mean

 

https://www.dropbox....-24-28.mp4?dl=0


  • reggi likes this

#136 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 356 posts
  • Local time: 09:04 PM
  • LocationAntwerp, Belgium

Posted 11 March 2019 - 11:03 AM

@Kyouma

 

Thanks for the dropbox file, strange behavior indeed. Do you have access to some log files to see what happens as well?

You can try to mount the Logs folder of EmbyStat while you create the container with -v /path/on/the/host:/app/Logs

 

At the moment my dev machine is broken (CPU started to behave strange) so I will look at the problem when my new hardware arrives!



#137 Kyouma OFFLINE  

Kyouma

    Advanced Member

  • Members
  • 45 posts
  • Local time: 09:04 PM

Posted 11 March 2019 - 11:30 AM

@reggi

 

sorry im not into this kind of stuff, where do i have to type that?



#138 Spaceboy OFFLINE  

Spaceboy

    Advanced Member

  • Members
  • 3811 posts
  • Local time: 08:04 PM

Posted 16 March 2019 - 07:09 AM

Hi, I've been trying to get this running in docker on a synology. it seems to crash on trying to sync with Emby and then crashes everytime it restarts within 30seconds or so. log is attached Attached File  uping-embystat1.txt   446.77KB   3 downloads



#139 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 356 posts
  • Local time: 09:04 PM
  • LocationAntwerp, Belgium

Posted 18 March 2019 - 10:11 AM

@Kyouma

Can you send me a PM with more system specs? Specially the OS you are using and the app to generate the docker files. I'll see what I can do then.

 

@Spaceboy

You are having the same problem as hbooo on GitHub => https://github.com/m...Stat/issues/538

Problem is that the play event TvChannel can't be mapped at the moment. Will fix that in the new release


  • Spaceboy likes this

#140 Spaceboy OFFLINE  

Spaceboy

    Advanced Member

  • Members
  • 3811 posts
  • Local time: 08:04 PM

Posted 18 March 2019 - 11:53 AM

@Kyouma

Can you send me a PM with more system specs? Specially the OS you are using and the app to generate the docker files. I'll see what I can do then.

 

@Spaceboy

You are having the same problem as hbooo on GitHub => https://github.com/m...Stat/issues/538

Problem is that the play event TvChannel can't be mapped at the moment. Will fix that in the new release

no problem, i'll look out for the update







Also tagged with one or more of these keywords: emby, statistics, server

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users