Closed Ch0wW closed 4 years ago
There's an issue with active storage (Rails 5+ attachments' management service) tables which I can reproduce randomly. The tables are active_storage_blobs
and active_storage_attachments
. Dropping these tables from the Postgres database and re-running the migration from the app works, If you want to do this manually.
I am investigating why this issue happens, it might be a conflict between the schema.rb
and the migrations of Rails. I will be posting instructions on how to bypass this issue in a while.
Well, you try to create the table multiple times. active_storage_blobs
is already created in https://github.com/chrisvel/wreeto_official/blob/master/db/migrate/20200507150546_squash_migration.rb#L51 , but you try to create it again in https://github.com/chrisvel/wreeto_official/blob/master/db/migrate/20200727110809_create_active_storage_tables.active_storage.rb#L4 .
@cars10 you're right, I never thought about the squash migration because I didn't use ActiveStorage back then. It must have been collateral damage. This must be the issue, thanks a lot.
@Ch0wW I am building a new docker image, in some minutes you can pull and retry.
I've used the latest docker image, docker-compose down the project, deleted all volumes bound by the database, and the issue persists, with the same error message.
Here's what happens when the base is also clean, in production mode, when typing docker-compose run app bundle exec rake db:drop db:migrate db:setup
:
@Ch0wW can you try just docker-compose run app bundle exec rake db:migrate:reset
?
Sure thing! Here's the output, still from a clean environment/database.
pi@raspberrypi:~/wreeto_official $ docker-compose run app bundle exec rake db:migrate:reset
Creating network "wreeto_official_default" with the default driver
Creating wreeto_official_redis_1 ... done
Creating wreeto_official_postgres_1 ... done
Creating wreeto_official_app_run ... done
rake aborted!
PG::ConnectionBad: could not connect to server: Connection refused
Is the server running on host "postgres" (172.23.0.2) and accepting
TCP/IP connections on port 5432?
/usr/local/bundle/gems/pg-1.2.3/lib/pg.rb:58:in `initialize'
/usr/local/bundle/gems/pg-1.2.3/lib/pg.rb:58:in `new'
/usr/local/bundle/gems/pg-1.2.3/lib/pg.rb:58:in `connect'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql_adapter.rb:692:in `connect'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql_adapter.rb:223:in `initialize'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in `new'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in `postgresql_connection'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:830:in `new_connection'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:874:in `checkout_new_connection'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in `try_to_checkout_new_connection'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:814:in `acquire_connection'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:538:in `checkout'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in `connection'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:1033:in `retrieve_connection'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_handling.rb:118:in `retrieve_connection'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_handling.rb:90:in `connection'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
/usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Database 'gahh' already exists
-- enable_extension("plpgsql")
-> 0.0621s
-- create_table("accounts", {:force=>:cascade})
-> 0.0662s
-- create_table("active_storage_attachments", {:force=>:cascade})
-> 0.1077s
-- create_table("active_storage_blobs", {:force=>:cascade})
-> 0.4498s
-- create_table("backups", {:force=>:cascade})
-> 0.0810s
-- create_table("categories", {:force=>:cascade})
-> 0.1529s
-- create_table("notes", {:force=>:cascade})
-> 0.2990s
-- create_table("taggings", {:force=>:cascade})
-> 0.1090s
-- create_table("tags", {:force=>:cascade})
-> 0.0819s
-- create_table("users", {:force=>:cascade})
-> 0.1742s
-- add_foreign_key("active_storage_attachments", "active_storage_blobs", {:column=>"blob_id"})
-> 0.0120s
-- add_foreign_key("backups", "users")
-> 0.0109s
-- add_foreign_key("categories", "categories", {:column=>"parent_id"})
-> 0.0090s
-- add_foreign_key("categories", "users")
-> 0.0098s
-- add_foreign_key("notes", "categories")
-> 0.0106s
-- add_foreign_key("notes", "users")
-> 0.0099s
-- add_foreign_key("taggings", "notes")
-> 0.0097s
-- add_foreign_key("taggings", "tags")
-> 0.0094s
-- add_foreign_key("tags", "users")
-> 0.0104s
-- add_foreign_key("users", "accounts")
-> 0.0099s
=> Creating default user [admin:password]
rake aborted!
ActiveRecord::RecordInvalid: Validation failed: Account must exist
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/validations.rb:80:in `raise_validation_error'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/validations.rb:52:in `save!'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:315:in `block in save!'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:387:in `block in with_transaction_returning_status'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:212:in `transaction'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:385:in `with_transaction_returning_status'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:315:in `save!'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/suppressor.rb:48:in `save!'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/persistence.rb:53:in `create!'
/app/wreeto/db/seeds.rb:2:in `<top (required)>'
/usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:285:in `load'
/usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:285:in `block in load'
/usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:285:in `load'
/usr/local/bundle/gems/railties-5.2.4.3/lib/rails/engine.rb:556:in `load_seed'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:281:in `load_seed'
/usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:194:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
/usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
/usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
/usr/local/bundle/bin/bundle:23:in `load'
/usr/local/bundle/bin/bundle:23:in `<main>'
Tasks: TOP => db:setup => db:seed
(See full trace by running task with --trace)
By the way, I wasn't able to create an user, the message ActiveRecord::RecordInvalid: Validation failed: Account must exist
appearing every single time. Hence the fact I can't use admin/password.
EDIT: .env used, since I slightly modified it :
POSTGRES_HOST=postgres
POSTGRES_USER=wreeto-user
POSTGRES_PASSWORD=************
POSTGRES_DB=gahh
POSTGRES_PORT=5432
RACK_ENV=production
RAILS_ENV=production
RAILS_MASTER_KEY=f21ab619787e22f6cb13d3884ca20d78
REDIS_HOST=redis
REDIS_PASSWORD=
SMTP_USERNAME=
SMTP_PASSWORD=
WREETO_HOST=localhost
WREETO_PORT=8383
You can run docker-compose run app bundle exec rails console
and then
account = Account.create!
User.create!({username: 'admin', email: 'user@email.com', password: 'password', confirmed_at: DateTime.now, account: account})
I found out something is missing and I will update it asap.
Awesome, this seems to work!
I just noticed that this message is repeated every second, but apparently I can make it work just fine :
app_1 | 13:22:33 sidekiq.1 | `Redis#exists(key)` will return an Integer in redis-rb 4.3. `exists?` returns a boolean, you should use it instead. To opt-in to the new behavior now you can set Redis.exists_returns_integer = true. To disable this message and keep the current (boolean) behaviour of 'exists' you can set `Redis.exists_returns_integer = false`, but this option will be removed in 5.0. (/usr/local/bundle/gems/sidekiq-6.0.7/lib/sidekiq/launcher.rb:160:in `block (2 levels) in ❤')
This is just a warning of Sidekiq, I guess it will go away If updated. Did you log in successfully ?
I've restarted from scratch the database, created the steps once again, and it did work successfully.
That's great! Well, I know this may be difficult to install in some cases and I'm sorry about that. I am working on simplifying the installation.
The issues you had occurred to me randomly but I wasn't able to reproduce them always so they were hard to debug.
I would be happy If you open more issues as you find them. Just a last question. Did you manage to install wreeto on the RPI ? I know there must be a separate ARM build about this, so it would be interesting to hear it works without one.
I indeed installed Wreeto on my Raspberry Pi 3B. I only had to recompile the Dockerfile and use my image on the docker-compose.yml file to make it work.
However, please note that the ruby package tzinfo-data
cannot be installed since it's not x86/x64. I don't know what would be the incidence of that missing package, but well...
Very interesting. I will find a workaround for the missing package and create a separate build for ARM devices as making Wreeto work on low cost devices is a priority for me. Thanks for the feedback.
My application is in a container. And my fron, which is front and back, is no longer running because the bank restore is not running docker logs 2b619051d2d6 Invoking Migrations == 0 EnableExtensions: migrating ============================================== -- enable_extension(:unaccent) -> 0.0130s == 0 EnableExtensions: migrated (0.0131s) =====================================
== 20170806125915 CreateActiveStorageTables: migrating ======================== -- create_table(:active_storage_blobs) rake aborted! StandardError: An error has occurred, this and all later migrations canceled:
PG::DuplicateTable: ERROR: relation "active_storage_blobs" already exists
: CREATE TABLE "active_storage_blobs" ("id" bigserial primary key, "key" character varying NOT NULL, "filename" character varying NOT NULL, "content_type" character varying, "metadata" text, "byte_size" bigint NOT NULL, "checksum" character varying NOT NULL, "created_at" timestamp NOT NULL)
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in exec' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in
block (2 levels) in execute'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/dependencies/interlock.rb:48:in block in permit_concurrent_loads' /usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/concurrency/share_lock.rb:187:in
yield_shares'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/dependencies/interlock.rb:47:in permit_concurrent_loads' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in
block in execute'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:581:in block (2 levels) in log' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:580:in
block in log'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/notifications/instrumenter.rb:23:in instrument' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:571:in
log'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in execute' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in
create_table'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:871:in block in method_missing' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:840:in
block in say_with_time'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:840:in say_with_time' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:860:in
method_missing'
/app/spa/db/migrate/20170806125915_create_active_storage_tables.active_storage.rb:4:in change' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:814:in
exec_migration'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:798:in block (2 levels) in migrate' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:797:in
block in migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in with_connection' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:796:in
migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:977:in migrate' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1292:in
block in execute_migration_in_transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1343:in block in ddl_transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in
block in transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/transaction.rb:239:in block in within_new_transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/transaction.rb:236:in
within_new_transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/transactions.rb:212:in
transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1343:in ddl_transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1291:in
execute_migration_in_transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1263:in block in migrate_without_lock' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1262:in
each'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1262:in migrate_without_lock' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1210:in
block in migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1363:in with_advisory_lock' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1210:in
migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1036:in up' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1011:in
migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/tasks/database_tasks.rb:172:in migrate' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/railties/databases.rake:60:in
block (2 levels) in execute' /app/spa/lib/tasks/monitor_concurrent.rake:10:in
block (4 levels) in loop' /app/spa/lib/tasks/monitor_concurrent.rake:7:in
block (3 levels) in execute' /usr/local/bundle/ruby/2.6.0/gems/rake-13.0.6/exe/rake:27:in
<top (required)>'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:58:in load' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:58:in
kernel_load'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:23:in run' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli.rb:483:in
exec'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli.rb:31:in
dispatch'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli.rb:25:in
start'
/usr/local/bundle/gems/bundler-2.3.11/exe/bundle:48:in block in <top (required)>' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/friendly_errors.rb:103:in
with_friendly_errors'
/usr/local/bundle/gems/bundler-2.3.11/exe/bundle:36:in <top (required)>' /usr/local/bundle/bin/bundle:23:in
load'
/usr/local/bundle/bin/bundle:23:in `
Caused by:
ActiveRecord::StatementInvalid: PG::DuplicateTable: ERROR: relation "active_storage_blobs" already exists
: CREATE TABLE "active_storage_blobs" ("id" bigserial primary key, "key" character varying NOT NULL, "filename" character varying NOT NULL, "content_type" character varying, "metadata" text, "byte_size" bigint NOT NULL, "checksum" character varying NOT NULL, "created_at" timestamp NOT NULL)
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in exec' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in
block (2 levels) in execute'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/dependencies/interlock.rb:48:in block in permit_concurrent_loads' /usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/concurrency/share_lock.rb:187:in
yield_shares'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/dependencies/interlock.rb:47:in permit_concurrent_loads' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in
block in execute'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:581:in block (2 levels) in log' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:580:in
block in log'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/notifications/instrumenter.rb:23:in instrument' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:571:in
log'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in execute' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in
create_table'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:871:in block in method_missing' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:840:in
block in say_with_time'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:840:in say_with_time' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:860:in
method_missing'
/app/spa/db/migrate/20170806125915_create_active_storage_tables.active_storage.rb:4:in change' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:814:in
exec_migration'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:798:in block (2 levels) in migrate' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:797:in
block in migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in with_connection' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:796:in
migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:977:in migrate' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1292:in
block in execute_migration_in_transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1343:in block in ddl_transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in
block in transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/transaction.rb:239:in block in within_new_transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/transaction.rb:236:in
within_new_transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/transactions.rb:212:in
transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1343:in ddl_transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1291:in
execute_migration_in_transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1263:in block in migrate_without_lock' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1262:in
each'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1262:in migrate_without_lock' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1210:in
block in migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1363:in with_advisory_lock' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1210:in
migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1036:in up' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1011:in
migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/tasks/database_tasks.rb:172:in migrate' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/railties/databases.rake:60:in
block (2 levels) in execute' /app/spa/lib/tasks/monitor_concurrent.rake:10:in
block (4 levels) in loop' /app/spa/lib/tasks/monitor_concurrent.rake:7:in
block (3 levels) in execute' /usr/local/bundle/ruby/2.6.0/gems/rake-13.0.6/exe/rake:27:in
<top (required)>'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:58:in load' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:58:in
kernel_load'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:23:in run' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli.rb:483:in
exec'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli.rb:31:in
dispatch'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli.rb:25:in
start'
/usr/local/bundle/gems/bundler-2.3.11/exe/bundle:48:in block in <top (required)>' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/friendly_errors.rb:103:in
with_friendly_errors'
/usr/local/bundle/gems/bundler-2.3.11/exe/bundle:36:in <top (required)>' /usr/local/bundle/bin/bundle:23:in
load'
/usr/local/bundle/bin/bundle:23:in `
Caused by:
PG::DuplicateTable: ERROR: relation "active_storage_blobs" already exists
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in exec' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in
block (2 levels) in execute'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/dependencies/interlock.rb:48:in block in permit_concurrent_loads' /usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/concurrency/share_lock.rb:187:in
yield_shares'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/dependencies/interlock.rb:47:in permit_concurrent_loads' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in
block in execute'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:581:in block (2 levels) in log' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:580:in
block in log'
/usr/local/bundle/ruby/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/notifications/instrumenter.rb:23:in instrument' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract_adapter.rb:571:in
log'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in execute' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in
create_table'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:871:in block in method_missing' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:840:in
block in say_with_time'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:840:in say_with_time' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:860:in
method_missing'
/app/spa/db/migrate/20170806125915_create_active_storage_tables.active_storage.rb:4:in change' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:814:in
exec_migration'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:798:in block (2 levels) in migrate' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:797:in
block in migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in with_connection' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:796:in
migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:977:in migrate' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1292:in
block in execute_migration_in_transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1343:in block in ddl_transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in
block in transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/transaction.rb:239:in block in within_new_transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/transaction.rb:236:in
within_new_transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/transactions.rb:212:in
transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1343:in ddl_transaction' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1291:in
execute_migration_in_transaction'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1263:in block in migrate_without_lock' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1262:in
each'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1262:in migrate_without_lock' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1210:in
block in migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1363:in with_advisory_lock' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1210:in
migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1036:in up' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/migration.rb:1011:in
migrate'
/usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/tasks/database_tasks.rb:172:in migrate' /usr/local/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/railties/databases.rake:60:in
block (2 levels) in execute' /app/spa/lib/tasks/monitor_concurrent.rake:10:in
block (4 levels) in loop' /app/spa/lib/tasks/monitor_concurrent.rake:7:in
block (3 levels) in execute' /usr/local/bundle/ruby/2.6.0/gems/rake-13.0.6/exe/rake:27:in
<top (required)>'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:58:in load' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:58:in
kernel_load'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli/exec.rb:23:in run' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli.rb:483:in
exec'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli.rb:31:in
dispatch'
/usr/local/bundle/gems/bundler-2.3.11/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/cli.rb:25:in
start'
/usr/local/bundle/gems/bundler-2.3.11/exe/bundle:48:in block in <top (required)>' /usr/local/bundle/gems/bundler-2.3.11/lib/bundler/friendly_errors.rb:103:in
with_friendly_errors'
/usr/local/bundle/gems/bundler-2.3.11/exe/bundle:36:in <top (required)>' /usr/local/bundle/bin/bundle:23:in
load'
/usr/local/bundle/bin/bundle:23:in `
Similar problem
Hello, everytime I try running the Docker project on my RPI3/4 , I have the following error :
The very same issue happen with another server (amd64). Config used in my
.env
:I can change the DB to whatever I want, the problem will say the same thing every time.