Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Missing column in database #2

Closed
crobibero opened this issue Feb 17, 2025 · 2 comments
Closed

Bug: Missing column in database #2

crobibero opened this issue Feb 17, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@crobibero
Copy link

Describe the Bug

Update from SenexCrenshaw/StreamMaster:latest to ghcr.io/carlreid/streammaster:latest
Fail to start due to missing database column

Stream Master Version

0.6.0

Relevant Logs

fail: Microsoft.EntityFrameworkCore.Query[10100]
      An exception occurred while iterating over the results of a query for context type 'StreamMaster.Infrastructure.EF.PGSQL.PGSQLRepositoryContext'.
      Npgsql.PostgresException (0x80004005): 42703: column s.M3UFileId does not exist
      
      POSITION: 206
         at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
         at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
         at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
         at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
         at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
         at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
         at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.Enumerator.MoveNext()
        Exception data:
          Severity: ERROR
          SqlState: 42703
          MessageText: column s.M3UFileId does not exist
          Position: 206
          File: parse_relation.c
          Line: 3665
          Routine: errorMissingColumn
      Npgsql.PostgresException (0x80004005): 42703: column s.M3UFileId does not exist
      
      POSITION: 206
         at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
         at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
         at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
         at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
         at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
         at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
         at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
         at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
         at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.Enumerator.MoveNext()
        Exception data:
          Severity: ERROR
          SqlState: 42703
          MessageText: column s.M3UFileId does not exist
          Position: 206
          File: parse_relation.c
          Line: 3665
          Routine: errorMissingColumn
@crobibero crobibero added the bug Something isn't working label Feb 17, 2025
@carlreid
Copy link
Owner

Thanks for flagging this. I think it will be a little tricky to resolve it. I'll see what I can do to get alignment code side in terms of the data structure.

Though my largest concern is that yours/others will have ran DB migrations from previous upgrades. So as I make the code changes now, and generate new migrations, then it'll try end up trying to re-create columns and such that already exist in your deployments.

I might be able to try guard against that and not run migrations but mark them as ran. That way anyone that's since used the images produced by this repo, can continue to update. Then anyone that came from a "future" version, should be able to jump over.

@carlreid
Copy link
Owner

Resolved by #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants