Skip to content

Error while migrating database #1311

@SchinkTasia

Description

@SchinkTasia

Hello,
After 1 year i want to install notebook.ai on a new system (Debian) and while migrating i got the following error.
I need to say, that i have experience in NodeJS but i dont really understand Ruby 🥴

username@hostname:~/homepage/notebook$ rake db:migrate
RAILS_GROUPS is unset; defaulting to web,worker
[Warning] Failed to detect RailsAdmin npm package, did you run "yarn install"?
== 20140713043535 CreateModels: migrating =====================================
-- create_table(:characters, {:id=>:integer})
   -> 0.0022s
-- create_table(:items, {:id=>:integer})
   -> 0.0009s
-- create_table(:locations, {:id=>:integer})
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

wrong number of arguments (given 3, expected 2)
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/schema_definitions.rb:405:in "column"
/home/username/.rvm/gems/ruby-3.2.1/gems/paperclip-6.1.0/lib/paperclip/schema.rb:54:in "block (2 levels) in attachment"
/home/username/.rvm/gems/ruby-3.2.1/gems/paperclip-6.1.0/lib/paperclip/schema.rb:52:in "each_pair"
/home/username/.rvm/gems/ruby-3.2.1/gems/paperclip-6.1.0/lib/paperclip/schema.rb:52:in "block in attachment"
/home/username/.rvm/gems/ruby-3.2.1/gems/paperclip-6.1.0/lib/paperclip/schema.rb:51:in "each"
/home/username/.rvm/gems/ruby-3.2.1/gems/paperclip-6.1.0/lib/paperclip/schema.rb:51:in "attachment"
/home/username/homepage/notebook/db/migrate/20140713043535_create_models.rb:101:in "block in change"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:100:in "block in create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:35:in "block in create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:314:in "create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:929:in "block in method_missing"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:897:in "block in say_with_time"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:897:in "say_with_time"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:918:in "method_missing"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:35:in "create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:100:in "create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:160:in "create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:198:in "create_table"
/home/username/homepage/notebook/db/migrate/20140713043535_create_models.rb:94:in "change"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:867:in "exec_migration"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:851:in "block (2 levels) in migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:850:in "block in migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in "with_connection"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:849:in "migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1037:in "migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1329:in "block in execute_migration_in_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1380:in "block in ddl_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in "block in transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/transaction.rb:319:in "block in within_new_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activesupport-6.1.7.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in "block (2 levels) in synchronize"
/home/username/.rvm/gems/ruby-3.2.1/gems/activesupport-6.1.7.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in "handle_interrupt"
/home/username/.rvm/gems/ruby-3.2.1/gems/activesupport-6.1.7.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in "block in synchronize"
/home/username/.rvm/gems/ruby-3.2.1/gems/activesupport-6.1.7.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in "handle_interrupt"
/home/username/.rvm/gems/ruby-3.2.1/gems/activesupport-6.1.7.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in "synchronize"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/transaction.rb:317:in "within_new_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in "transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/transactions.rb:209:in "transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1380:in "ddl_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1328:in "execute_migration_in_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1302:in "each"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1302:in "migrate_without_lock"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1253:in "migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1086:in "up"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1061:in "migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/tasks/database_tasks.rb:237:in "migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:92:in "block (3 levels) in <top (required)>"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:90:in "each"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:90:in "block (2 levels) in <top (required)>"
/home/username/.rvm/gems/ruby-3.2.1/bin/ruby_executable_hooks:22:in "eval"
/home/username/.rvm/gems/ruby-3.2.1/bin/ruby_executable_hooks:22:in "<main>"

Caused by:
ArgumentError: wrong number of arguments (given 3, expected 2)
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/schema_definitions.rb:405:in "column"
/home/username/.rvm/gems/ruby-3.2.1/gems/paperclip-6.1.0/lib/paperclip/schema.rb:54:in "block (2 levels) in attachment"
/home/username/.rvm/gems/ruby-3.2.1/gems/paperclip-6.1.0/lib/paperclip/schema.rb:52:in "each_pair"
/home/username/.rvm/gems/ruby-3.2.1/gems/paperclip-6.1.0/lib/paperclip/schema.rb:52:in "block in attachment"
/home/username/.rvm/gems/ruby-3.2.1/gems/paperclip-6.1.0/lib/paperclip/schema.rb:51:in "each"
/home/username/.rvm/gems/ruby-3.2.1/gems/paperclip-6.1.0/lib/paperclip/schema.rb:51:in "attachment"
/home/username/homepage/notebook/db/migrate/20140713043535_create_models.rb:101:in "block in change"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:100:in "block in create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:35:in "block in create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:314:in "create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:929:in "block in method_missing"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:897:in "block in say_with_time"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:897:in "say_with_time"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:918:in "method_missing"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:35:in "create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:100:in "create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:160:in "create_table"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration/compatibility.rb:198:in "create_table"
/home/username/homepage/notebook/db/migrate/20140713043535_create_models.rb:94:in "change"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:867:in "exec_migration"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:851:in "block (2 levels) in migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:850:in "block in migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in "with_connection"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:849:in "migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1037:in "migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1329:in "block in execute_migration_in_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1380:in "block in ddl_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in "block in transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/transaction.rb:319:in "block in within_new_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activesupport-6.1.7.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in "block (2 levels) in synchronize"
/home/username/.rvm/gems/ruby-3.2.1/gems/activesupport-6.1.7.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in "handle_interrupt"
/home/username/.rvm/gems/ruby-3.2.1/gems/activesupport-6.1.7.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in "block in synchronize"
/home/username/.rvm/gems/ruby-3.2.1/gems/activesupport-6.1.7.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in "handle_interrupt"
/home/username/.rvm/gems/ruby-3.2.1/gems/activesupport-6.1.7.2/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in "synchronize"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/transaction.rb:317:in "within_new_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in "transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/transactions.rb:209:in "transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1380:in "ddl_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1328:in "execute_migration_in_transaction"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1302:in "each"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1302:in "migrate_without_lock"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1253:in "migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1086:in "up"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/migration.rb:1061:in "migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/tasks/database_tasks.rb:237:in "migrate"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:92:in "block (3 levels) in <top (required)>"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:90:in "each"
/home/username/.rvm/gems/ruby-3.2.1/gems/activerecord-6.1.7.2/lib/active_record/railties/databases.rake:90:in "block (2 levels) in <top (required)>"
/home/username/.rvm/gems/ruby-3.2.1/bin/ruby_executable_hooks:22:in "eval"
/home/username/.rvm/gems/ruby-3.2.1/bin/ruby_executable_hooks:22:in "<main>"
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Additional to mention that "username" and "hostname" are placeholders in this log.
I replaced the username and hostname manually.

When i do "yarn install" before migrating the database it would work, but after that it cant find the "billing" table.

What can i do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions