Open rctneil opened 2 days ago
I've seen other people report this error but not a single answer as to what it means or how to resolve it?
This is because db:schema:load:queue
tries to load that schema also in test environment, and it's not configured for test
. I think this is a bug in Rails, I'd argue it shouldn't try to load the schema for a DB that's not configured for an environment. To work around that, simply configure the queue
database for test. However:
I do notice however, that it did load the schema as the solid queue tables are in the queue database.
It seems you're all done, then, and you don't need to bother with loading the queue schema individually and working around that bug.
The error related to your primary DB is unrelated to Solid Queue and might mean you have a problem with your migrations. I'd guess that either the primary DB existed before db:prepare
, but somehow your schema_migrations
table doesn't have that migration tracked, or you have some conflicting migrations 🤔 Maybe a previous migration creating the people
table?
Something else weird is happening. When I db:prepare, the queue_schema.rb
file gets updated to look like the below. I think this is why the create people
is causing an issue:
Why is queue_schema.rb
getting changed with some of my custom tables? I don't understand that?
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.2].define(version: 2024_07_18_095033) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "action_text_rich_texts", force: :cascade do |t|
t.string "name", null: false
t.text "body"
t.string "record_type", null: false
t.bigint "record_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
end
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
create_table "active_storage_blobs", force: :cascade do |t|
t.string "key", null: false
t.string "filename", null: false
t.string "content_type"
t.text "metadata"
t.string "service_name", null: false
t.bigint "byte_size", null: false
t.string "checksum"
t.datetime "created_at", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
create_table "active_storage_variant_records", force: :cascade do |t|
t.bigint "blob_id", null: false
t.string "variation_digest", null: false
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "folders", force: :cascade do |t|
t.string "name"
t.string "remote_id"
t.integer "parent_id"
t.integer "lft", null: false
t.integer "rgt", null: false
t.integer "depth", default: 0, null: false
t.integer "children_count", default: 0, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "slug"
t.index ["lft"], name: "index_folders_on_lft"
t.index ["parent_id"], name: "index_folders_on_parent_id"
t.index ["rgt"], name: "index_folders_on_rgt"
t.index ["slug"], name: "index_folders_on_slug", unique: true
end
create_table "pages", force: :cascade do |t|
t.string "name"
t.boolean "active"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "slug"
end
create_table "photos", force: :cascade do |t|
t.text "description"
t.string "filename"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "name"
t.string "extension"
t.string "mime_type"
t.integer "folder_id"
t.string "web_view_link"
t.string "web_content_link"
t.integer "width"
t.integer "height"
t.string "remote_id"
t.integer "last_update"
t.string "server"
t.string "secret"
t.string "secret_h"
t.string "secret_k"
t.string "web_content_link_h"
t.string "web_content_link_k"
t.string "web_content_link_o"
t.integer "position"
end
create_table "settings", force: :cascade do |t|
t.string "key"
t.string "value_text"
t.boolean "value_boolean"
t.integer "value_integer"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "data_type"
t.text "value_rich_text"
end
create_table "sizes", force: :cascade do |t|
t.bigint "photo_id"
t.bigint "video_id"
t.string "label"
t.integer "width"
t.integer "height"
t.string "source"
t.string "url"
t.string "media"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["photo_id"], name: "index_sizes_on_photo_id"
t.index ["video_id"], name: "index_sizes_on_video_id"
end
create_table "solid_queue_blocked_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.string "queue_name", null: false
t.integer "priority", default: 0, null: false
t.string "concurrency_key", null: false
t.datetime "expires_at", null: false
t.datetime "created_at", null: false
t.index ["concurrency_key", "priority", "job_id"], name: "index_solid_queue_blocked_executions_for_release"
t.index ["expires_at", "concurrency_key"], name: "index_solid_queue_blocked_executions_for_maintenance"
t.index ["job_id"], name: "index_solid_queue_blocked_executions_on_job_id", unique: true
end
create_table "solid_queue_claimed_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.bigint "process_id"
t.datetime "created_at", null: false
t.index ["job_id"], name: "index_solid_queue_claimed_executions_on_job_id", unique: true
t.index ["process_id", "job_id"], name: "index_solid_queue_claimed_executions_on_process_id_and_job_id"
end
create_table "solid_queue_failed_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.text "error"
t.datetime "created_at", null: false
t.index ["job_id"], name: "index_solid_queue_failed_executions_on_job_id", unique: true
end
create_table "solid_queue_jobs", force: :cascade do |t|
t.string "queue_name", null: false
t.string "class_name", null: false
t.text "arguments"
t.integer "priority", default: 0, null: false
t.string "active_job_id"
t.datetime "scheduled_at"
t.datetime "finished_at"
t.string "concurrency_key"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["active_job_id"], name: "index_solid_queue_jobs_on_active_job_id"
t.index ["class_name"], name: "index_solid_queue_jobs_on_class_name"
t.index ["finished_at"], name: "index_solid_queue_jobs_on_finished_at"
t.index ["queue_name", "finished_at"], name: "index_solid_queue_jobs_for_filtering"
t.index ["scheduled_at", "finished_at"], name: "index_solid_queue_jobs_for_alerting"
end
create_table "solid_queue_pauses", force: :cascade do |t|
t.string "queue_name", null: false
t.datetime "created_at", null: false
t.index ["queue_name"], name: "index_solid_queue_pauses_on_queue_name", unique: true
end
create_table "solid_queue_processes", force: :cascade do |t|
t.string "kind", null: false
t.datetime "last_heartbeat_at", null: false
t.bigint "supervisor_id"
t.integer "pid", null: false
t.string "hostname"
t.text "metadata"
t.datetime "created_at", null: false
t.string "name", null: false
t.index ["last_heartbeat_at"], name: "index_solid_queue_processes_on_last_heartbeat_at"
t.index ["name", "supervisor_id"], name: "index_solid_queue_processes_on_name_and_supervisor_id", unique: true
t.index ["supervisor_id"], name: "index_solid_queue_processes_on_supervisor_id"
end
create_table "solid_queue_ready_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.string "queue_name", null: false
t.integer "priority", default: 0, null: false
t.datetime "created_at", null: false
t.index ["job_id"], name: "index_solid_queue_ready_executions_on_job_id", unique: true
t.index ["priority", "job_id"], name: "index_solid_queue_poll_all"
t.index ["queue_name", "priority", "job_id"], name: "index_solid_queue_poll_by_queue"
end
create_table "solid_queue_recurring_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.string "task_key", null: false
t.datetime "run_at", null: false
t.datetime "created_at", null: false
t.index ["job_id"], name: "index_solid_queue_recurring_executions_on_job_id", unique: true
t.index ["task_key", "run_at"], name: "index_solid_queue_recurring_executions_on_task_key_and_run_at", unique: true
end
create_table "solid_queue_recurring_tasks", force: :cascade do |t|
t.string "key", null: false
t.string "schedule", null: false
t.string "command", limit: 2048
t.string "class_name"
t.text "arguments"
t.string "queue_name"
t.integer "priority", default: 0
t.boolean "static", default: true, null: false
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["key"], name: "index_solid_queue_recurring_tasks_on_key", unique: true
t.index ["static"], name: "index_solid_queue_recurring_tasks_on_static"
end
create_table "solid_queue_scheduled_executions", force: :cascade do |t|
t.bigint "job_id", null: false
t.string "queue_name", null: false
t.integer "priority", default: 0, null: false
t.datetime "scheduled_at", null: false
t.datetime "created_at", null: false
t.index ["job_id"], name: "index_solid_queue_scheduled_executions_on_job_id", unique: true
t.index ["scheduled_at", "priority", "job_id"], name: "index_solid_queue_dispatch_all"
end
create_table "solid_queue_semaphores", force: :cascade do |t|
t.string "key", null: false
t.integer "value", default: 1, null: false
t.datetime "expires_at", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["expires_at"], name: "index_solid_queue_semaphores_on_expires_at"
t.index ["key", "value"], name: "index_solid_queue_semaphores_on_key_and_value"
t.index ["key"], name: "index_solid_queue_semaphores_on_key", unique: true
end
create_table "taggings", force: :cascade do |t|
t.bigint "tag_id"
t.string "taggable_type"
t.bigint "taggable_id"
t.string "tagger_type"
t.bigint "tagger_id"
t.string "context", limit: 128
t.datetime "created_at", precision: nil
t.string "tenant", limit: 128
t.index ["context"], name: "index_taggings_on_context"
t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true
t.index ["tag_id"], name: "index_taggings_on_tag_id"
t.index ["taggable_id", "taggable_type", "context"], name: "taggings_taggable_context_idx"
t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy"
t.index ["taggable_id"], name: "index_taggings_on_taggable_id"
t.index ["taggable_type", "taggable_id"], name: "index_taggings_on_taggable_type_and_taggable_id"
t.index ["taggable_type"], name: "index_taggings_on_taggable_type"
t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type"
t.index ["tagger_id"], name: "index_taggings_on_tagger_id"
t.index ["tagger_type", "tagger_id"], name: "index_taggings_on_tagger_type_and_tagger_id"
t.index ["tenant"], name: "index_taggings_on_tenant"
end
create_table "tags", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "taggings_count", default: 0
t.index ["name"], name: "index_tags_on_name", unique: true
end
create_table "tokens", force: :cascade do |t|
t.string "access_token"
t.string "refresh_token"
t.datetime "expires_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "secret"
t.string "type"
t.boolean "refreshable"
end
create_table "users", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "role"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
create_table "videos", force: :cascade do |t|
t.string "description"
t.string "filename"
t.string "name"
t.string "extension"
t.string "mime_type"
t.bigint "folder_id", null: false
t.string "web_content_link"
t.string "web_content_link_o"
t.integer "width"
t.integer "height"
t.text "remote_id"
t.integer "last_update"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "position"
t.index ["folder_id"], name: "index_videos_on_folder_id"
end
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "sizes", "photos"
add_foreign_key "sizes", "videos"
add_foreign_key "solid_queue_blocked_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
add_foreign_key "solid_queue_claimed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
add_foreign_key "solid_queue_failed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
add_foreign_key "solid_queue_ready_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
add_foreign_key "solid_queue_recurring_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
add_foreign_key "solid_queue_scheduled_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
add_foreign_key "taggings", "tags"
add_foreign_key "videos", "folders"
end
Huh, that doesn't make any sense! Do you have anything under db/queue_migrate
?
db/queue_migrate
does not exist. Should it just be an empty folder? Should it have been created automatically?
It's super confusing. I have no idea why it's happening.
No, that's ok. I thought that perhaps you had copied your migrations over there. Can you try undoing all the changes to the queue_schema.rb
file (if you have committed it, just run bin/rails solid_queue:install
and overwrite it), so it only contains Solid Queue tables, then run:
bin/rails db:drop
bin/rails db:prepare
and see what happens?
Is it ok running db:drop
when I have tables in my primary database with data I want to keep?
Ah, no, in that case, you don't want to drop your development DB. You should run
bin/rails db:drop:queue
instead.
Ok,
Doing that gives me:
Created database 'family_media_development_queue'
== 20240726093041 CreatePeople: migrating =====================================
-- create_table(:people)
bin/rails aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
PG::DuplicateTable: ERROR: relation "people" already exists
/workspaces/family-media/db/migrate/20240726093041_create_people.rb:3:in `change'
Caused by:
ActiveRecord::StatementInvalid: PG::DuplicateTable: ERROR: relation "people" already exists (ActiveRecord::StatementInvalid)
/workspaces/family-media/db/migrate/20240726093041_create_people.rb:3:in `change'
Caused by:
PG::DuplicateTable: ERROR: relation "people" already exists (PG::DuplicateTable)
/workspaces/family-media/db/migrate/20240726093041_create_people.rb:3:in `change'
Tasks: TOP => db:prepare
(See full trace by running task with --trace)
It may be the db:schema:load:queue
command that messed up the queue schema. I've checked the migrations and they do look ok. It's only creating the people table once as far as I can see,
This is bizarre, it shouldn't be trying to run the migrations under db/migrate
in your queue
database 😕
What do you get from
bin/rails db:migrate:status
I get:
database: family_media_development
up 20240229130131 Create photos up 20240301091711 Update fields on photo up 20240301101628 Add google drive id to photos up 20240301104651 Create folders up 20240313104912 Create tokens up 20240314122134 Add slug to folders up 20240318105044 ** NO FILE ** up 20240318105045 ** NO FILE ** up 20240507115321 Add secret to tokens up 20240507125352 Add type and refreshable to token up 20240509091942 Acts as taggable on migrationacts as taggable on engine up 20240509091943 Add missing unique indicesacts as taggable on engine up 20240509091944 Add taggings counter cache to tagsacts as taggable on engine up 20240509091945 Add missing taggable indexacts as taggable on engine up 20240509091946 Change collation for tag namesacts as taggable on engine up 20240509091947 Add missing indexes on taggingsacts as taggable on engine up 20240509091948 Add tenant to taggingsacts as taggable on engine up 20240510090903 Add last update to photos up 20240522094103 Create settings up 20240522094846 Add fields to settings up 20240522114749 Create active storage tablesactive storage up 20240523085216 Create action text tablesaction text up 20240523102046 Create pages up 20240523102345 Add slug to pages up 20240617105037 Rename fields up 20240617112347 Add extra fields to photo up 20240617113641 Store photo ur ls on photo up 20240617115925 Rename google drive id to remote id on folders up 20240618092246 Create users up 20240618092302 Add devise to users up 20240710091842 Add role to users up 20240716103526 Create videos up 20240716111221 Add service name to active storage blobsactive storage up 20240716111222 Create active storage variant recordsactive storage up 20240716111223 Remove not null on active storage blobs checksumactive storage up 20240717085638 Create sizes up 20240718092127 Add position to photo up 20240718095033 Add position to video up 20240726093041 Create people up 20240726113531 Add parents to people up 20240726114511 Create partnerships up 20240730142529 Add root to people up 20240801121018 Add tag id to people up 20240809115203 Change folder id to be nullable in videos up 20240813110631 Create documents up 20240814104717 ** NO FILE ** up 20240814105241 ** NO FILE ** up 20240814110121 ** NO FILE ** up 20240913092750 ** NO FILE ** up 20240913103856 Add type to page up 20240913104247 Change type to string on pages up 20240913105519 Add media types to pages up 20240913114047 Change type to integer in pages up 20240913121904 Add page to setting up 20240913131847 Move media types up 20240913132026 Rename media types to value media types on settings up 20240913140617 Add media flags to folders up 20240913150903 Add position to pages up 20240917102518 Add document to pages up 20240917114603 Add source to videos up 20240917115419 Add video to pages up 20240919144339 Create people tags up 20240923084940 Rename parent1 id to parent id in people up 20240923091605 Remove roots from people up 20240923114417 Change biography to text in people up 20240924084019 Add marriage date and marriage date parts and divorce date and divorce date parts and marriage place to partnerships up 20241007125043 Create recurring executionssolid queue up 20241007125044 Create recurring taskssolid queue up 20241007125045 Add name to processessolid queue up 20241007125046 Make name not nullsolid queue up 20241007125047 Change solid queue recurring tasks static to not nullsolid queue up 20241105105659 Drop solid queue tables
database: family_media_development_queue
up 001 ** NO FILE **
I think the NO FILE for the primary DB are where I previously installed Solid Queue but then removed it entirely.
Not sure about NO FILE for the queue DB though.
Ok, that looks perfect. The up 001 ********** NO FILE **********
is expected, as it's the version set by the schema and there aren't any migration files. Then, if you now run
bin/rails db:migrate
does it do anything? It should do nothing, including no errors.
Correct. Nothing, no output
Ok, and bin/rails db:prepare
continues giving you that bizarre error? The one with
PG::DuplicateTable: ERROR: relation "people" already exists
/workspaces/family-media/db/migrate/20240726093041_create_people.rb:3:in `change'
That is correct. Full output is:
== 20240726093041 CreatePeople: migrating =====================================
-- create_table(:people)
bin/rails aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
PG::DuplicateTable: ERROR: relation "people" already exists
/workspaces/family-media/db/migrate/20240726093041_create_people.rb:3:in `change'
Caused by:
ActiveRecord::StatementInvalid: PG::DuplicateTable: ERROR: relation "people" already exists (ActiveRecord::StatementInvalid)
/workspaces/family-media/db/migrate/20240726093041_create_people.rb:3:in `change'
Caused by:
PG::DuplicateTable: ERROR: relation "people" already exists (PG::DuplicateTable)
/workspaces/family-media/db/migrate/20240726093041_create_people.rb:3:in `change'
Tasks: TOP => db:prepare
(See full trace by running task with --trace)
What version of Rails are you using? This seems like an issue on Rails itself, considering the above.
Rails shows as:
gem "rails", "~> 7.2.1.2"
Oh, wait, one last thing. Could you run:
bin/rails db:prepare --trace
and copy the output before the error?
Output:
** Invoke db:prepare (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:prepare
== 20240726093041 CreatePeople: migrating =====================================
-- create_table(:people)
bin/rails aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
PG::DuplicateTable: ERROR: relation "people" already exists
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:56:in `exec'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:56:in `block (2 levels) in raw_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:1004:in `block in with_raw_connection'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activesupport-7.2.1.2/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:976:in `with_raw_connection'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:55:in `block in raw_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activesupport-7.2.1.2/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:1119:in `log'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:54:in `raw_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:538:in `internal_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:309:in `create_table'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration/default_strategy.rb:10:in `method_missing'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1059:in `block in method_missing'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1025:in `block in say_with_time'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/benchmark.rb:298:in `measure'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1025:in `say_with_time'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1048:in `method_missing'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:585:in `create_table'
/workspaces/family-media/db/migrate/20240726093041_create_people.rb:3:in `change'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:994:in `exec_migration'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:978:in `block (2 levels) in migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/benchmark.rb:298:in `measure'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:977:in `block in migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:389:in `with_connection'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:976:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1190:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1538:in `block in execute_migration_in_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activesupport-7.2.1.2/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1589:in `ddl_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1537:in `execute_migration_in_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1512:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1512:in `migrate_without_lock'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1457:in `block in migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1609:in `with_advisory_lock'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1457:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1264:in `up'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1239:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:251:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:202:in `block (4 levels) in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:554:in `with_temporary_pool'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:201:in `block (3 levels) in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:200:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:200:in `block (2 levels) in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:199:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:199:in `block in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:603:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:603:in `each_current_environment'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:198:in `prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/railties/databases.rake:399:in `block (2 levels) in <main>'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_module.rb:59:in `with_application'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:156:in `invoke_rake'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:73:in `block in invoke'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:149:in `with_argv'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:69:in `invoke'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands.rb:18:in `<main>'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:4:in `<main>'
Caused by:
ActiveRecord::StatementInvalid: PG::DuplicateTable: ERROR: relation "people" already exists (ActiveRecord::StatementInvalid)
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:56:in `exec'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:56:in `block (2 levels) in raw_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:1004:in `block in with_raw_connection'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activesupport-7.2.1.2/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:976:in `with_raw_connection'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:55:in `block in raw_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activesupport-7.2.1.2/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:1119:in `log'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:54:in `raw_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:538:in `internal_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:309:in `create_table'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration/default_strategy.rb:10:in `method_missing'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1059:in `block in method_missing'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1025:in `block in say_with_time'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/benchmark.rb:298:in `measure'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1025:in `say_with_time'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1048:in `method_missing'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:585:in `create_table'
/workspaces/family-media/db/migrate/20240726093041_create_people.rb:3:in `change'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:994:in `exec_migration'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:978:in `block (2 levels) in migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/benchmark.rb:298:in `measure'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:977:in `block in migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:389:in `with_connection'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:976:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1190:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1538:in `block in execute_migration_in_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activesupport-7.2.1.2/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1589:in `ddl_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1537:in `execute_migration_in_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1512:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1512:in `migrate_without_lock'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1457:in `block in migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1609:in `with_advisory_lock'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1457:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1264:in `up'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1239:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:251:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:202:in `block (4 levels) in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:554:in `with_temporary_pool'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:201:in `block (3 levels) in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:200:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:200:in `block (2 levels) in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:199:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:199:in `block in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:603:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:603:in `each_current_environment'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:198:in `prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/railties/databases.rake:399:in `block (2 levels) in <main>'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_module.rb:59:in `with_application'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:156:in `invoke_rake'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:73:in `block in invoke'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:149:in `with_argv'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:69:in `invoke'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands.rb:18:in `<main>'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:4:in `<main>'
Caused by:
PG::DuplicateTable: ERROR: relation "people" already exists (PG::DuplicateTable)
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:56:in `exec'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:56:in `block (2 levels) in raw_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:1004:in `block in with_raw_connection'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activesupport-7.2.1.2/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:976:in `with_raw_connection'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:55:in `block in raw_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activesupport-7.2.1.2/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract_adapter.rb:1119:in `log'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:54:in `raw_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:538:in `internal_execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:137:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/query_cache.rb:27:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:309:in `create_table'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration/default_strategy.rb:10:in `method_missing'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1059:in `block in method_missing'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1025:in `block in say_with_time'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/benchmark.rb:298:in `measure'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1025:in `say_with_time'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1048:in `method_missing'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:585:in `create_table'
/workspaces/family-media/db/migrate/20240726093041_create_people.rb:3:in `change'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:994:in `exec_migration'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:978:in `block (2 levels) in migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/benchmark.rb:298:in `measure'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:977:in `block in migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:389:in `with_connection'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:976:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1190:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1538:in `block in execute_migration_in_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activesupport-7.2.1.2/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1589:in `ddl_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1537:in `execute_migration_in_transaction'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1512:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1512:in `migrate_without_lock'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1457:in `block in migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1609:in `with_advisory_lock'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1457:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1264:in `up'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/migration.rb:1239:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:251:in `migrate'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:202:in `block (4 levels) in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:554:in `with_temporary_pool'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:201:in `block (3 levels) in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:200:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:200:in `block (2 levels) in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:199:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:199:in `block in prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:603:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:603:in `each_current_environment'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/tasks/database_tasks.rb:198:in `prepare_all'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/railties/databases.rake:399:in `block (2 levels) in <main>'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_module.rb:59:in `with_application'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:156:in `invoke_rake'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:73:in `block in invoke'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:149:in `with_argv'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/command.rb:69:in `invoke'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/railties-7.2.1.2/lib/rails/commands.rb:18:in `<main>'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/home/vscode/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:prepare
Hmm ok, unfortunately nothing useful there 😞 I think I'd open an issue in Rails at this point, with the output from
bin/rails db:migrate:status
bin/rails db:migrate
bin/rails db:prepare
Basically the problem is that db:prepare
tries to run db:migrate
, and that tries to run a migration that has already been run according to db:migrate:status
, and the same error doesn't happen when running db:migrate
alone.
You could also try to upgrade Rails to 8.0.0.rc2 and see if the same thing happens, before opening an issue there.
@rosa Ok, Just tried Rails 8.0.0 RC2 and I still get the issue.
I'll get the output of those commands and post an issue now. I'll report back.
Thanks!
Sounds great, I'll be following the issue in Rails too 🙏 How bizarre!
This whole multi database thing is getting super confusing.
In Development:
I totally removed Solid queue from my app and started the process to install it and configure it from scratch.
I added the gem, ran the installer. My
database.yml
looks like:My
development.rb
andproduction.rb
files both have the following in them:When I run
rails db:prepare
I get:I can see it's trying to prepare all databases in an idempotent way (as per the docs for
db:prepare
but it's failing on that one migration. There are multiple migrations above and below thatcreate people
one so i'm not sure why it's failing at that point?That migration looks like:
If I run
rails db:schema:load:queue
, I get this error:I've seen other people report this error but not a single answer as to what it means or how to resolve it?
I do notice however, that it did load the schema as the solid queue tables are in the queue database.
What do I do now?