mregni / EmbyStat

Multiplatform statistics server for Emby server
MIT License
286 stars 21 forks source link

embystat:beta container fails to start #1745

Open jathek opened 2 years ago

jathek commented 2 years ago

Bug report

Describe the bug Getting the below when I try to start a uping/embystat:beta container

2022-05-10 21:01:16.17120325 CDT [2022-05-10 21:01:16.153] []  [INF] --------------------------------------------------------------------
2022-05-10 21:01:16.17694466 CDT [2022-05-10 21:01:16.176] []  [INF] System info:
2022-05-10 21:01:16.17698680 CDT [2022-05-10 21:01:16.176] []  [INF]    Environment     Production
2022-05-10 21:01:16.17699375 CDT [2022-05-10 21:01:16.176] []  [INF]    Debugger        False
2022-05-10 21:01:16.18020532 CDT [2022-05-10 21:01:16.180] []  [INF]    Process Name    dotnet
2022-05-10 21:01:16.18023307 CDT [2022-05-10 21:01:16.180] []  [INF]    Log level:      Information
2022-05-10 21:01:16.18024215 CDT [2022-05-10 21:01:16.180] []  [INF]    Port:           6555
2022-05-10 21:01:16.18025014 CDT [2022-05-10 21:01:16.180] []  [INF]    URL's:          http://*
2022-05-10 21:01:16.18026215 CDT [2022-05-10 21:01:16.180] []  [INF]    ConfigDir:      /app/data
2022-05-10 21:01:16.18027037 CDT [2022-05-10 21:01:16.180] []  [INF]    DataDir:        /app/data
2022-05-10 21:01:16.18027777 CDT [2022-05-10 21:01:16.180] []  [INF]    LogDir:         /app/data/logs
2022-05-10 21:01:16.18028512 CDT [2022-05-10 21:01:16.180] []  [INF]    Can update:     True
2022-05-10 21:01:16.18029287 CDT [2022-05-10 21:01:16.180] []  [INF]    As service:     False
2022-05-10 21:01:16.18030081 CDT [2022-05-10 21:01:16.180] []  [INF] --------------------------------------------------------------------
2022-05-10 21:01:17.10175340 CDT [2022-05-10 21:01:17.100] [Microsoft.EntityFrameworkCore.Database.Connection]  [ERR] An error occurred using the connection to database 'main' on server 'SqliteData.db'.
2022-05-10 21:01:17.10263481 CDT SQLite Error 14: 'unable to open database file'.
2022-05-10 21:01:17.11437513 CDT [2022-05-10 21:01:17.102] []  [FTL] Server terminated unexpectedly
2022-05-10 21:01:17.11438681 CDT Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 14: 'unable to open database file'.
2022-05-10 21:01:17.11439121 CDT    at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
2022-05-10 21:01:17.11439534 CDT    at Microsoft.Data.Sqlite.SqliteConnectionInternal..ctor(SqliteConnectionStringBuilder connectionOptions, SqliteConnectionPool pool)
2022-05-10 21:01:17.11439946 CDT    at Microsoft.Data.Sqlite.SqliteConnectionPool.GetConnection()
2022-05-10 21:01:17.11440336 CDT    at Microsoft.Data.Sqlite.SqliteConnectionFactory.GetConnection(SqliteConnection outerConnection)
2022-05-10 21:01:17.11440726 CDT    at Microsoft.Data.Sqlite.SqliteConnection.Open()
2022-05-10 21:01:17.11441066 CDT    at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected)
2022-05-10 21:01:17.11441347 CDT    at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(Boolean errorsExpected)
2022-05-10 21:01:17.11441617 CDT    at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
2022-05-10 21:01:17.11441890 CDT    at Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal.SqliteDatabaseCreator.Create()
2022-05-10 21:01:17.11443447 CDT    at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
2022-05-10 21:01:17.11443774 CDT    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
2022-05-10 21:01:17.11444058 CDT    at EmbyStat.Web.Program.SetupDatabase(IHost host)
2022-05-10 21:01:17.11444331 CDT    at EmbyStat.Web.Program.Main(String[] args)
2022-05-10 21:01:17.11444750 CDT SYSTEM Server shutdown
2022-05-10 21:01:17.11445041 CDT [2022-05-10 21:01:17.114] []  [INF] Server shutdown

To Reproduce Steps to reproduce the behavior:

  1. Try to start the container

System (please complete the following information):

Additional context Docker Compose:

  # EmbyStat - emby/jellyfin statistics
  embystat:
    container_name: embystat
    image: uping/embystat:beta
    restart: unless-stopped
    user: $PUIDN:$PGIDN
    networks:
      t2_proxy:
    # ports:
      # - 6555:6555
    environment:
      - TZ=$TZ
    volumes:
      - $CONTDIR/embystat:/app/config
mregni commented 2 years ago

I released beta.30 yesterday. Can you try again to spin up the container?

jathek commented 2 years ago

I released beta.30 yesterday. Can you try again to spin up the container?

It works with the most recent beta (pulled a few minutes ago) but only if I remove

user: $PUIDN:$PGIDN

when .env is loaded this becomes

user: 99:100
mregni commented 2 years ago

I'm not sure that Embystat is using that user property. The next big update is to make the runtime and startup more robust, so I'll try to include the runtime user correct as well.

jathek commented 2 years ago

I removed the user property for now. Embystat starts now and seems to work with the latest beta. However, it doesn't seem to be storing the data in the /app/config folder? I mapped /app/data instead and see the logs and usersettings.json in there, but where is the database info stored? I've scanned my jellyfin server but no embystat database exists anywhere that I can find, either in my mount folders or in a docker volume.

mregni commented 2 years ago

True, it seems I had some bugs that the data/logs/config folders were not correctly used. I'm currently working on a fix for that. Thanks for letting me know!