stringer-rss / stringer

A self-hosted, anti-social RSS reader.
MIT License
3.83k stars 388 forks source link

Migration fails for stories_order enum #1183

Open brentcetinich opened 2 months ago

brentcetinich commented 2 months ago

I have an old version of stringer and I just built latest image from 40e5a1f. When the container starts the logs are showing the migration is failing with the following error.

I can't tell what version I am coming from as I overwrote the old image :\

Any ideas how to workaround this or how I can see what version I used to have?

stringer  | 2024-04-17 08:40:49,952 INFO success: puma entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
stringer  | 2024-04-17 08:40:51,915 DEBG 'puma' stdout output:
stringer  | rake aborted!
stringer  | StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
stringer  | 
stringer  | Undeclared attribute type for enum 'stories_order'. Enums must be backed by a database column or declared with an explicit type via `attribute`.
stringer  | 
stringer  | 2024-04-17 08:40:51,915 DEBG 'puma' stdout output:
mockdeep commented 2 months ago

@brentcetinich sorry about that! Is there more log output with a stack trace? It looks to me like it's trying to boot the server before the migration has been run.

volfco commented 1 month ago
2024-06-03 00:14:14,304 DEBG fd 9 closed, stopped monitoring <POutputDispatcher at 140457815599376 for <Subprocess at 140457813493392 with name puma in state RUNNING> (stdout)>
2024-06-03 00:14:14,304 WARN exited: puma (exit status 1; not expected)
2024-06-03 00:14:14,304 DEBG received SIGCHLD indicating a child quit
2024-06-03 00:14:15,310 INFO spawned: 'puma' with pid 242
2024-06-03 00:14:16,313 INFO success: puma entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-06-03 00:14:19,398 DEBG 'puma' stdout output:
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)

Undeclared attribute type for enum 'stories_order'. Enums must be backed by a database column or declared with an explicit type via `attribute`.

2024-06-03 00:14:19,399 DEBG 'puma' stdout output:
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/enum.rb:250:in `block in _enum'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/attributes.rb:225:in `block in attribute'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/attributes.rb:266:in `block in load_schema!'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/attributes.rb:265:in `each'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/attributes.rb:265:in `load_schema!'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/encryption/encryptable_record.rb:127:in `load_schema!'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/model_schema.rb:563:in `block in load_schema'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/model_schema.rb:560:in `synchronize'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/model_schema.rb:560:in `load_schema'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/model_schema.rb:425:in `columns_hash'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1796:in `arel_column'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1783:in `block in arel_columns'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1776:in `each'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1776:in `flat_map'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1776:in `arel_columns'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1733:in `build_select'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1591:in `build_arel'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1490:in `arel'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/finder_methods.rb:369:in `block in exists?'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation.rb:1018:in `skip_query_cache_if_necessary'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/finder_methods.rb:369:in `exists?'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation.rb:289:in `empty?'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation.rb:316:in `any?'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/querying.rb:23:in `any?'
/app/db/migrate/20230223045525_add_null_false_to_associations.rb:5:in `change'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:986:in `exec_migration'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:970:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:969:in `block in migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:227:in `with_connection'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:968:in `migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1178:in `migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1529:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/transaction.rb:535:in `block in within_new_transaction'
/usr/local/bundle/gems/activesupport-7.1.3.2/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/transaction.rb:532:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1580:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1528:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1503:in `each'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1503:in `migrate_without_lock'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1448:in `block in migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1600:in `with_advisory_lock'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1448:in `migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1274:in `up'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1249:in `migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/tasks/database_tasks.rb:243:in `migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/railties/databases.rake:93:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli.rb:486:in `exec'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli.rb:31:in `dispatch'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli.rb:25:in `start'
/usr/local/bundle/gems/bundler-2.3.25/exe/bundle:48:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.3.25/exe/bundle:36:in `<top (required)>'
/usr/local/bundle/bin/bundle:25:in `load'
/usr/local/bundle/bin/bundle:25:in `<main>'

Caused by:
Undeclared attribute type for enum 'stories_order'. Enums must be backed by a database column or declared with an explicit type via `attribute`.

2024-06-03 00:14:19,402 DEBG 'puma' stdout output:
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/enum.rb:250:in `block in _enum'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/attributes.rb:225:in `block in attribute'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/attributes.rb:266:in `block in load_schema!'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/attributes.rb:265:in `each'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/attributes.rb:265:in `load_schema!'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/encryption/encryptable_record.rb:127:in `load_schema!'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/model_schema.rb:563:in `block in load_schema'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/model_schema.rb:560:in `synchronize'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/model_schema.rb:560:in `load_schema'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/model_schema.rb:425:in `columns_hash'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1796:in `arel_column'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1783:in `block in arel_columns'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1776:in `each'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1776:in `flat_map'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1776:in `arel_columns'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1733:in `build_select'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1591:in `build_arel'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/query_methods.rb:1490:in `arel'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/finder_methods.rb:369:in `block in exists?'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation.rb:1018:in `skip_query_cache_if_necessary'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation/finder_methods.rb:369:in `exists?'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation.rb:289:in `empty?'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/relation.rb:316:in `any?'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/querying.rb:23:in `any?'
/app/db/migrate/20230223045525_add_null_false_to_associations.rb:5:in `change'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:986:in `exec_migration'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:970:in `block (2 levels) in migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:969:in `block in migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:227:in `with_connection'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:968:in `migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1178:in `migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1529:in `block in execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/transaction.rb:535:in `block in within_new_transaction'
/usr/local/bundle/gems/activesupport-7.1.3.2/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/transaction.rb:532:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1580:in `ddl_transaction'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1528:in `execute_migration_in_transaction'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1503:in `each'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1503:in `migrate_without_lock'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1448:in `block in migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1600:in `with_advisory_lock'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1448:in `migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1274:in `up'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/migration.rb:1249:in `migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/tasks/database_tasks.rb:243:in `migrate'
/usr/local/bundle/gems/activerecord-7.1.3.2/lib/active_record/railties/databases.rake:93:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli.rb:486:in `exec'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli.rb:31:in `dispatch'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/cli.rb:25:in `start'
/usr/local/bundle/gems/bundler-2.3.25/exe/bundle:48:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.3.25/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.3.25/exe/bundle:36:in `<top (required)>'
/usr/local/bundle/bin/bundle:25:in `load'
/usr/local/bundle/bin/bundle:25:in `<main>'

Running into the same issue when using the Docker container

Kochanac commented 2 weeks ago

having the same error on trying to install in docker