chrisvel / wreeto_official

Wreeto is an open source note-taking, knowledge management and wiki system.
https://wreeto.com
GNU Affero General Public License v3.0
387 stars 13 forks source link

Environment issues as first installation #44

Closed Ch0wW closed 4 years ago

Ch0wW commented 4 years ago

Hello, everytime I try running the Docker project on my RPI3/4 , I have the following error :

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_1      ... done
Attaching to wreeto_official_redis_1, wreeto_official_postgres_1, wreeto_official_app_1
redis_1     | 1:C 20 Sep 2020 21:29:18.035 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1     | 1:C 20 Sep 2020 21:29:18.035 # Redis version=5.0.7, bits=32, commit=00000000, modified=0, pid=1, just started
redis_1     | 1:C 20 Sep 2020 21:29:18.035 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1     | 1:M 20 Sep 2020 21:29:18.041 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with 'noeviction' policy now.
redis_1     | 1:M 20 Sep 2020 21:29:18.042 * Running mode=standalone, port=6379.
redis_1     | 1:M 20 Sep 2020 21:29:18.043 # Server initialized
redis_1     | 1:M 20 Sep 2020 21:29:18.043 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1     | 1:M 20 Sep 2020 21:29:18.044 * Ready to accept connections
postgres_1  | The files belonging to this database system will be owned by user "postgres".
postgres_1  | This user must also own the server process.
postgres_1  |
postgres_1  | The database cluster will be initialized with locale "en_US.utf8".
postgres_1  | The default database encoding has accordingly been set to "UTF8".
postgres_1  | The default text search configuration will be set to "english".
postgres_1  |
postgres_1  | Data page checksums are disabled.
postgres_1  |
postgres_1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
postgres_1  | creating subdirectories ... ok
postgres_1  | selecting default max_connections ... 100
postgres_1  | selecting default shared_buffers ... 128MB
postgres_1  | selecting default timezone ... Etc/UTC
postgres_1  | selecting dynamic shared memory implementation ... posix
postgres_1  | creating configuration files ... ok
postgres_1  | running bootstrap script ... ok
postgres_1  | performing post-bootstrap initialization ... ok
postgres_1  | syncing data to disk ...
postgres_1  | WARNING: enabling "trust" authentication for local connections
postgres_1  | You can change this by editing pg_hba.conf or using the option -A, or
postgres_1  | --auth-local and --auth-host, the next time you run initdb.
postgres_1  | ok
postgres_1  |
postgres_1  | Success. You can now start the database server using:
postgres_1  |
postgres_1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
postgres_1  |
postgres_1  | waiting for server to start....2020-09-20 21:29:31.934 UTC [48] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1  | 2020-09-20 21:29:32.048 UTC [49] LOG:  database system was shut down at 2020-09-20 21:29:23 UTC
postgres_1  | 2020-09-20 21:29:32.079 UTC [48] LOG:  database system is ready to accept connections
postgres_1  |  done
postgres_1  | server started
postgres_1  | CREATE DATABASE
postgres_1  |
postgres_1  |
postgres_1  | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
postgres_1  |
postgres_1  | 2020-09-20 21:29:33.446 UTC [48] LOG:  received fast shutdown request
postgres_1  | waiting for server to shut down....2020-09-20 21:29:33.457 UTC [48] LOG:  aborting any active transactions
postgres_1  | 2020-09-20 21:29:33.465 UTC [48] LOG:  background worker "logical replication launcher" (PID 55) exited with exit code 1
postgres_1  | 2020-09-20 21:29:33.479 UTC [50] LOG:  shutting down
postgres_1  | 2020-09-20 21:29:33.591 UTC [48] LOG:  database system is shut down
postgres_1  |  done
postgres_1  | server stopped
postgres_1  |
postgres_1  | PostgreSQL init process complete; ready for start up.
postgres_1  |
postgres_1  | 2020-09-20 21:29:33.710 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres_1  | 2020-09-20 21:29:33.710 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres_1  | 2020-09-20 21:29:33.752 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1  | 2020-09-20 21:29:33.815 UTC [66] LOG:  database system was shut down at 2020-09-20 21:29:33 UTC
postgres_1  | 2020-09-20 21:29:33.859 UTC [1] LOG:  database system is ready to accept connections
postgres_1  | 2020-09-20 21:29:36.579 UTC [73] ERROR:  relation "active_storage_blobs" already exists
postgres_1  | 2020-09-20 21:29:36.579 UTC [73] STATEMENT:  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)
app_1       | rake aborted!
app_1       | StandardError: An error has occurred, this and all later migrations canceled:
app_1       |
app_1       | PG::DuplicateTable: ERROR:  relation "active_storage_blobs" already exists
app_1       | : 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)
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `exec'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:871:in `block in method_missing'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `block in say_with_time'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `say_with_time'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:860:in `method_missing'
app_1       | /app/wreeto/db/migrate/20200727110809_create_active_storage_tables.active_storage.rb:4:in `change'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:814:in `exec_migration'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:797:in `block in migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:796:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:977:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:212:in `transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `ddl_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `each'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `migrate_without_lock'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `block in migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1363:in `with_advisory_lock'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1036:in `up'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1011:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
app_1       | /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
app_1       | /usr/local/bundle/bin/bundle:23:in `load'
app_1       | /usr/local/bundle/bin/bundle:23:in `<main>'
app_1       |
app_1       | Caused by:
app_1       | ActiveRecord::StatementInvalid: PG::DuplicateTable: ERROR:  relation "active_storage_blobs" already exists
app_1       | : 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)
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `exec'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:871:in `block in method_missing'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `block in say_with_time'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `say_with_time'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:860:in `method_missing'
app_1       | /app/wreeto/db/migrate/20200727110809_create_active_storage_tables.active_storage.rb:4:in `change'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:814:in `exec_migration'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:797:in `block in migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:796:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:977:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:212:in `transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `ddl_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `each'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `migrate_without_lock'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `block in migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1363:in `with_advisory_lock'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1036:in `up'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1011:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
app_1       | /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
app_1       | /usr/local/bundle/bin/bundle:23:in `load'
app_1       | /usr/local/bundle/bin/bundle:23:in `<main>'
app_1       |
app_1       | Caused by:
app_1       | PG::DuplicateTable: ERROR:  relation "active_storage_blobs" already exists
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `exec'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
app_1       | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:871:in `block in method_missing'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `block in say_with_time'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `say_with_time'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:860:in `method_missing'
app_1       | /app/wreeto/db/migrate/20200727110809_create_active_storage_tables.active_storage.rb:4:in `change'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:814:in `exec_migration'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:797:in `block in migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:796:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:977:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:212:in `transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `ddl_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `each'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `migrate_without_lock'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `block in migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1363:in `with_advisory_lock'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1036:in `up'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1011:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
app_1       | /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
app_1       | /usr/local/bundle/bin/bundle:23:in `load'
app_1       | /usr/local/bundle/bin/bundle:23:in `<main>'
app_1       | Tasks: TOP => db:migrate
app_1       | (See full trace by running task with --trace)
app_1       | == 20200507150546 SquashMigration: migrating ==================================
app_1       | -- create_table(:users)
app_1       |    -> 0.0786s
app_1       | -- create_table(:active_storage_blobs)
app_1       |    -> 0.0887s
app_1       | -- create_table(:active_storage_attachments)
app_1       |    -> 0.0852s
app_1       | -- create_table(:categories)
app_1       |    -> 0.1155s
app_1       | -- create_table(:inventory_items)
app_1       |    -> 0.0928s
app_1       | -- create_table(:inventory_notes)
app_1       |    -> 0.0203s
app_1       | == 20200507150546 SquashMigration: migrated (0.4820s) =========================
app_1       |
app_1       | == 20200510161539 ChangeWrongIndex: migrating =================================
app_1       | -- remove_index(:categories, :slug)
app_1       |    -> 0.0260s
app_1       | -- add_index(:categories, [:slug, :user_id], {:unique=>true})
app_1       |    -> 0.0250s
app_1       | == 20200510161539 ChangeWrongIndex: migrated (0.0515s) ========================
app_1       |
app_1       | == 20200518081902 CreateTags: migrating =======================================
app_1       | -- create_table(:tags)
app_1       |    -> 0.0421s
app_1       | == 20200518081902 CreateTags: migrated (0.0423s) ==============================
app_1       |
app_1       | == 20200518104535 CreateTaggings: migrating ===================================
app_1       | -- create_table(:taggings)
app_1       |    -> 0.1112s
app_1       | == 20200518104535 CreateTaggings: migrated (0.1114s) ==========================
app_1       |
app_1       | == 20200518125026 AddUsersToTags: migrating ===================================
app_1       | -- add_reference(:tags, :user, {:foreign_key=>true})
app_1       |    -> 0.0373s
app_1       | == 20200518125026 AddUsersToTags: migrated (0.0376s) ==========================
app_1       |
app_1       | == 20200519193620 AddNotesTable: migrating ====================================
app_1       | -- create_table(:notes)
app_1       |    -> 0.1340s
app_1       | -- add_reference(:taggings, :note, {:foreign_key=>true})
app_1       |    -> 0.0338s
app_1       | == 20200519193620 AddNotesTable: migrated (0.1682s) ===========================
app_1       |
app_1       | == 20200519194032 AddNotesMigration: migrating ================================
app_1       | == 20200519194032 AddNotesMigration: migrated (0.0287s) =======================
app_1       |
app_1       | == 20200522151207 RemoveInventoryTables: migrating ============================
app_1       | -- remove_index(:taggings, {:name=>"index_taggings_on_inventory_note_id"})
app_1       |    -> 0.0028s
app_1       | -- remove_foreign_key(:taggings, :inventory_notes)
app_1       |    -> 0.0185s
app_1       | -- remove_column(:taggings, :inventory_note_id)
app_1       |    -> 0.0022s
app_1       | -- drop_table(:inventory_notes)
app_1       |    -> 0.0044s
app_1       | -- drop_table(:inventory_items)
app_1       |    -> 0.0096s
app_1       | == 20200522151207 RemoveInventoryTables: migrated (0.0386s) ===================
app_1       |
app_1       | == 20200724152539 AddUsernameToUsers: migrating ===============================
app_1       | -- add_column(:users, :username, :string)
app_1       |    -> 0.0030s
app_1       | -- add_index(:users, :username, {:unique=>true})
app_1       |    -> 0.0227s
app_1       | == 20200724152539 AddUsernameToUsers: migrated (0.0261s) ======================
app_1       |
app_1       | == 20200724152659 InitializeUsernameForUsers: migrating =======================
app_1       | == 20200724152659 InitializeUsernameForUsers: migrated (0.0209s) ==============
app_1       |
app_1       | == 20200727110809 CreateActiveStorageTables: migrating ========================
app_1       | -- create_table(:active_storage_blobs)
postgres_1  | 2020-09-20 21:29:49.802 UTC [74] ERROR:  database "wreeto_dev" already exists
postgres_1  | 2020-09-20 21:29:49.802 UTC [74] STATEMENT:  CREATE DATABASE "wreeto_dev" ENCODING = 'unicode'
app_1       | Database 'wreeto_dev' already exists
app_1       | rake aborted!
app_1       | ActiveRecord::NoEnvironmentInSchemaError:
app_1       |
app_1       | Environment data not found in the schema. To resolve this issue, run:
app_1       |
app_1       |         bin/rails db:environment:set RAILS_ENV=production
app_1       |
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1135:in `last_stored_environment'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:58:in `check_protected_environments!'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:13:in `block (2 levels) in <top (required)>'
app_1       | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:262:in `block (3 levels) in <top (required)>'
app_1       | /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
app_1       | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
app_1       | /usr/local/bundle/bin/bundle:23:in `load'
app_1       | /usr/local/bundle/bin/bundle:23:in `<main>'
app_1       | Tasks: TOP => db:schema:load => db:check_protected_environments
app_1       | (See full trace by running task with --trace)
wreeto_official_app_1 exited with code 1

The very same issue happen with another server (amd64). Config used in my .env :

POSTGRES_HOST=postgres
POSTGRES_USER=wreeto-user
POSTGRES_PASSWORD=*********************
POSTGRES_DB=wreeto_dev
POSTGRES_PORT=5432
RACK_ENV=production
RAILS_ENV=production
RAILS_MASTER_KEY=f21ab619787e22f6cb13d3884ca20d78
REDIS_HOST=localhost
REDIS_PASSWORD=
SMTP_USERNAME=
SMTP_PASSWORD=
WREETO_HOST=localhost
WREETO_PORT=8383

I can change the DB to whatever I want, the problem will say the same thing every time.

chrisvel commented 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.

cars10 commented 4 years ago

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 .

chrisvel commented 4 years ago

@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.

Ch0wW commented 4 years ago

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.

Log with docker-compose up only ```txt postgres_1 | The files belonging to this database system will be owned by user "postgres". postgres_1 | This user must also own the server process. postgres_1 | postgres_1 | The database cluster will be initialized with locale "en_US.utf8". postgres_1 | The default database encoding has accordingly been set to "UTF8". postgres_1 | The default text search configuration will be set to "english". postgres_1 | postgres_1 | Data page checksums are disabled. postgres_1 | postgres_1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok postgres_1 | creating subdirectories ... ok postgres_1 | selecting default max_connections ... 100 postgres_1 | selecting default shared_buffers ... 128MB postgres_1 | selecting default timezone ... Etc/UTC postgres_1 | selecting dynamic shared memory implementation ... posix postgres_1 | creating configuration files ... ok postgres_1 | running bootstrap script ... ok redis_1 | 1:C 21 Sep 2020 12:04:50.673 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo redis_1 | 1:C 21 Sep 2020 12:04:50.679 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=1, just started redis_1 | 1:C 21 Sep 2020 12:04:50.679 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf redis_1 | 1:M 21 Sep 2020 12:04:50.681 * Running mode=standalone, port=6379. redis_1 | 1:M 21 Sep 2020 12:04:50.681 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. redis_1 | 1:M 21 Sep 2020 12:04:50.681 # Server initialized redis_1 | 1:M 21 Sep 2020 12:04:50.681 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. redis_1 | 1:M 21 Sep 2020 12:04:50.682 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled. redis_1 | 1:M 21 Sep 2020 12:04:50.682 * Ready to accept connections postgres_1 | performing post-bootstrap initialization ... ok postgres_1 | syncing data to disk ... ok postgres_1 | postgres_1 | WARNING: enabling "trust" authentication for local connections postgres_1 | You can change this by editing pg_hba.conf or using the option -A, or postgres_1 | --auth-local and --auth-host, the next time you run initdb. postgres_1 | postgres_1 | Success. You can now start the database server using: postgres_1 | postgres_1 | pg_ctl -D /var/lib/postgresql/data -l logfile start postgres_1 | postgres_1 | waiting for server to start....2020-09-21 12:04:54.079 UTC [46] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres_1 | 2020-09-21 12:04:54.119 UTC [47] LOG: database system was shut down at 2020-09-21 12:04:53 UTC postgres_1 | 2020-09-21 12:04:54.132 UTC [46] LOG: database system is ready to accept connections postgres_1 | done postgres_1 | server started postgres_1 | CREATE DATABASE postgres_1 | postgres_1 | postgres_1 | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/* postgres_1 | postgres_1 | 2020-09-21 12:04:54.713 UTC [46] LOG: received fast shutdown request postgres_1 | waiting for server to shut down....2020-09-21 12:04:54.716 UTC [46] LOG: aborting any active transactions postgres_1 | 2020-09-21 12:04:54.728 UTC [46] LOG: background worker "logical replication launcher" (PID 53) exited with exit code 1 postgres_1 | 2020-09-21 12:04:54.729 UTC [48] LOG: shutting down postgres_1 | 2020-09-21 12:04:54.744 UTC [46] LOG: database system is shut down postgres_1 | done postgres_1 | server stopped postgres_1 | postgres_1 | PostgreSQL init process complete; ready for start up. postgres_1 | postgres_1 | 2020-09-21 12:04:54.845 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres_1 | 2020-09-21 12:04:54.846 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgres_1 | 2020-09-21 12:04:54.850 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres_1 | 2020-09-21 12:04:54.880 UTC [64] LOG: database system was shut down at 2020-09-21 12:04:54 UTC postgres_1 | 2020-09-21 12:04:54.890 UTC [1] LOG: database system is ready to accept connections postgres_1 | 2020-09-21 12:04:57.433 UTC [71] ERROR: relation "active_storage_blobs" already exists postgres_1 | 2020-09-21 12:04:57.433 UTC [71] STATEMENT: 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) app_1 | rake aborted! app_1 | StandardError: An error has occurred, this and all later migrations canceled: app_1 | app_1 | PG::DuplicateTable: ERROR: relation "active_storage_blobs" already exists app_1 | : 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) app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `exec' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:871:in `block in method_missing' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `block in say_with_time' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `say_with_time' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:860:in `method_missing' app_1 | /app/wreeto/db/migrate/20200727110809_create_active_storage_tables.active_storage.rb:4:in `change' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:814:in `exec_migration' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:797:in `block in migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:796:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:977:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:212:in `transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `ddl_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `each' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `migrate_without_lock' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `block in migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1363:in `with_advisory_lock' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1036:in `up' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1011:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in ' app_1 | /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start' app_1 | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in ' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors' app_1 | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `' app_1 | /usr/local/bundle/bin/bundle:23:in `load' app_1 | /usr/local/bundle/bin/bundle:23:in `
' app_1 | app_1 | Caused by: app_1 | ActiveRecord::StatementInvalid: PG::DuplicateTable: ERROR: relation "active_storage_blobs" already exists app_1 | : 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) app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `exec' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:871:in `block in method_missing' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `block in say_with_time' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `say_with_time' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:860:in `method_missing' app_1 | /app/wreeto/db/migrate/20200727110809_create_active_storage_tables.active_storage.rb:4:in `change' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:814:in `exec_migration' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:797:in `block in migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:796:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:977:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:212:in `transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `ddl_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `each' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `migrate_without_lock' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `block in migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1363:in `with_advisory_lock' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1036:in `up' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1011:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in ' app_1 | /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start' app_1 | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in ' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors' app_1 | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `' app_1 | /usr/local/bundle/bin/bundle:23:in `load' app_1 | /usr/local/bundle/bin/bundle:23:in `
' app_1 | app_1 | Caused by: app_1 | PG::DuplicateTable: ERROR: relation "active_storage_blobs" already exists app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `exec' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log' app_1 | /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:871:in `block in method_missing' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `block in say_with_time' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `say_with_time' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:860:in `method_missing' app_1 | /app/wreeto/db/migrate/20200727110809_create_active_storage_tables.active_storage.rb:4:in `change' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:814:in `exec_migration' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:797:in `block in migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:796:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:977:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:212:in `transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `ddl_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `each' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `migrate_without_lock' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `block in migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1363:in `with_advisory_lock' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1036:in `up' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1011:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:172:in `migrate' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:60:in `block (2 levels) in ' app_1 | /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start' app_1 | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in ' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors' app_1 | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `' app_1 | /usr/local/bundle/bin/bundle:23:in `load' app_1 | /usr/local/bundle/bin/bundle:23:in `
' app_1 | Tasks: TOP => db:migrate app_1 | (See full trace by running task with --trace) app_1 | == 20200507150546 SquashMigration: migrating ================================== app_1 | -- create_table(:users) app_1 | -> 0.0280s app_1 | -- create_table(:active_storage_blobs) app_1 | -> 0.0166s app_1 | -- create_table(:active_storage_attachments) app_1 | -> 0.0255s app_1 | -- create_table(:categories) app_1 | -> 0.0308s app_1 | -- create_table(:inventory_items) app_1 | -> 0.0257s app_1 | -- create_table(:inventory_notes) app_1 | -> 0.0053s app_1 | == 20200507150546 SquashMigration: migrated (0.1323s) ========================= app_1 | app_1 | == 20200510161539 ChangeWrongIndex: migrating ================================= app_1 | -- remove_index(:categories, :slug) app_1 | -> 0.0060s app_1 | -- add_index(:categories, [:slug, :user_id], {:unique=>true}) app_1 | -> 0.0060s app_1 | == 20200510161539 ChangeWrongIndex: migrated (0.0122s) ======================== app_1 | app_1 | == 20200518081902 CreateTags: migrating ======================================= app_1 | -- create_table(:tags) app_1 | -> 0.0109s app_1 | == 20200518081902 CreateTags: migrated (0.0110s) ============================== app_1 | app_1 | == 20200518104535 CreateTaggings: migrating =================================== app_1 | -- create_table(:taggings) app_1 | -> 0.0189s app_1 | == 20200518104535 CreateTaggings: migrated (0.0190s) ========================== app_1 | app_1 | == 20200518125026 AddUsersToTags: migrating =================================== app_1 | -- add_reference(:tags, :user, {:foreign_key=>true}) app_1 | -> 0.0120s app_1 | == 20200518125026 AddUsersToTags: migrated (0.0120s) ========================== app_1 | app_1 | == 20200519193620 AddNotesTable: migrating ==================================== app_1 | -- create_table(:notes) app_1 | -> 0.0326s app_1 | -- add_reference(:taggings, :note, {:foreign_key=>true}) app_1 | -> 0.0109s app_1 | == 20200519193620 AddNotesTable: migrated (0.0437s) =========================== app_1 | app_1 | == 20200519194032 AddNotesMigration: migrating ================================ app_1 | == 20200519194032 AddNotesMigration: migrated (0.0076s) ======================= app_1 | app_1 | == 20200522151207 RemoveInventoryTables: migrating ============================ app_1 | -- remove_index(:taggings, {:name=>"index_taggings_on_inventory_note_id"}) app_1 | -> 0.0008s app_1 | -- remove_foreign_key(:taggings, :inventory_notes) app_1 | -> 0.0075s app_1 | -- remove_column(:taggings, :inventory_note_id) app_1 | -> 0.0007s app_1 | -- drop_table(:inventory_notes) app_1 | -> 0.0014s app_1 | -- drop_table(:inventory_items) app_1 | -> 0.0026s app_1 | == 20200522151207 RemoveInventoryTables: migrated (0.0133s) =================== app_1 | app_1 | == 20200724152539 AddUsernameToUsers: migrating =============================== app_1 | -- add_column(:users, :username, :string) app_1 | -> 0.0009s app_1 | -- add_index(:users, :username, {:unique=>true}) app_1 | -> 0.0056s app_1 | == 20200724152539 AddUsernameToUsers: migrated (0.0067s) ====================== app_1 | app_1 | == 20200724152659 InitializeUsernameForUsers: migrating ======================= app_1 | == 20200724152659 InitializeUsernameForUsers: migrated (0.0092s) ============== app_1 | app_1 | == 20200727110809 CreateActiveStorageTables: migrating ======================== app_1 | -- create_table(:active_storage_blobs) postgres_1 | 2020-09-21 12:05:01.123 UTC [72] ERROR: database "wreeto_base" already exists postgres_1 | 2020-09-21 12:05:01.123 UTC [72] STATEMENT: CREATE DATABASE "wreeto_base" ENCODING = 'unicode' app_1 | Database 'wreeto_base' already exists app_1 | rake aborted! app_1 | ActiveRecord::NoEnvironmentInSchemaError: app_1 | app_1 | Environment data not found in the schema. To resolve this issue, run: app_1 | app_1 | bin/rails db:environment:set RAILS_ENV=production app_1 | app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1135:in `last_stored_environment' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:58:in `check_protected_environments!' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:13:in `block (2 levels) in ' app_1 | /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:262:in `block (3 levels) in ' app_1 | /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start' app_1 | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in ' app_1 | /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors' app_1 | /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `' app_1 | /usr/local/bundle/bin/bundle:23:in `load' app_1 | /usr/local/bundle/bin/bundle:23:in `
' app_1 | Tasks: TOP => db:schema:load => db:check_protected_environments app_1 | (See full trace by running task with --trace) wreeto_official_app_1 exited with code 1 ```

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 :

Log with docker-compose up run app bundle exec rake db:drop db:migrate db:setup ```txt 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 == 20200507150546 SquashMigration: migrating ================================== -- create_table(:users) -> 0.0705s -- create_table(:active_storage_blobs) -> 0.0235s -- create_table(:active_storage_attachments) -> 0.0224s -- create_table(:categories) -> 0.0425s -- create_table(:inventory_items) -> 0.0377s -- create_table(:inventory_notes) -> 0.0069s == 20200507150546 SquashMigration: migrated (0.2157s) ========================= == 20200510161539 ChangeWrongIndex: migrating ================================= -- remove_index(:categories, :slug) -> 0.0072s -- add_index(:categories, [:slug, :user_id], {:unique=>true}) -> 0.0060s == 20200510161539 ChangeWrongIndex: migrated (0.0162s) ======================== == 20200518081902 CreateTags: migrating ======================================= -- create_table(:tags) -> 0.0092s == 20200518081902 CreateTags: migrated (0.0108s) ============================== == 20200518104535 CreateTaggings: migrating =================================== -- create_table(:taggings) -> 0.0234s == 20200518104535 CreateTaggings: migrated (0.0251s) ========================== == 20200518125026 AddUsersToTags: migrating =================================== -- add_reference(:tags, :user, {:foreign_key=>true}) -> 0.0081s == 20200518125026 AddUsersToTags: migrated (0.0104s) ========================== == 20200519193620 AddNotesTable: migrating ==================================== -- create_table(:notes) -> 0.0269s -- add_reference(:taggings, :note, {:foreign_key=>true}) -> 0.0084s == 20200519193620 AddNotesTable: migrated (0.0386s) =========================== == 20200519194032 AddNotesMigration: migrating ================================ == 20200519194032 AddNotesMigration: migrated (0.0074s) ======================= == 20200522151207 RemoveInventoryTables: migrating ============================ -- remove_index(:taggings, {:name=>"index_taggings_on_inventory_note_id"}) -> 0.0008s -- remove_foreign_key(:taggings, :inventory_notes) -> 0.0079s -- remove_column(:taggings, :inventory_note_id) -> 0.0008s -- drop_table(:inventory_notes) -> 0.0012s -- drop_table(:inventory_items) -> 0.0025s == 20200522151207 RemoveInventoryTables: migrated (0.0194s) =================== == 20200724152539 AddUsernameToUsers: migrating =============================== -- add_column(:users, :username, :string) -> 0.0010s -- add_index(:users, :username, {:unique=>true}) -> 0.0082s == 20200724152539 AddUsernameToUsers: migrated (0.0121s) ====================== == 20200724152659 InitializeUsernameForUsers: migrating ======================= == 20200724152659 InitializeUsernameForUsers: migrated (0.0068s) ============== == 20200727110809 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/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `exec' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:871:in `block in method_missing' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `block in say_with_time' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `say_with_time' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:860:in `method_missing' /app/wreeto/db/migrate/20200727110809_create_active_storage_tables.active_storage.rb:4:in `change' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:814:in `exec_migration' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:797:in `block in migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:796:in `migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:977:in `migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction' /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/migration.rb:1343:in `ddl_transaction' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `each' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `migrate_without_lock' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `block in migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1363:in `with_advisory_lock' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1036:in `up' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1011:in `migrate' /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 ' /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `' /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 ' /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 `' /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/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `exec' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:871:in `block in method_missing' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `block in say_with_time' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `say_with_time' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:860:in `method_missing' /app/wreeto/db/migrate/20200727110809_create_active_storage_tables.active_storage.rb:4:in `change' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:814:in `exec_migration' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:797:in `block in migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:796:in `migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:977:in `migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction' /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/migration.rb:1343:in `ddl_transaction' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `each' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `migrate_without_lock' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `block in migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1363:in `with_advisory_lock' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1036:in `up' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1011:in `migrate' /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 ' /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `' /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 ' /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 `' /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/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `exec' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log' /usr/local/bundle/gems/activesupport-5.2.4.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:311:in `create_table' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:871:in `block in method_missing' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `block in say_with_time' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:840:in `say_with_time' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:860:in `method_missing' /app/wreeto/db/migrate/20200727110809_create_active_storage_tables.active_storage.rb:4:in `change' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:814:in `exec_migration' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:797:in `block in migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:796:in `migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:977:in `migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction' /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/migration.rb:1343:in `ddl_transaction' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `each' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1262:in `migrate_without_lock' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `block in migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1363:in `with_advisory_lock' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1210:in `migrate' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1036:in `up' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1011:in `migrate' /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 ' /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `' /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 ' /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 `' /usr/local/bundle/bin/bundle:23:in `load' /usr/local/bundle/bin/bundle:23:in `
' Tasks: TOP => db:migrate (See full trace by running task with --trace) Database 'wreeto_base' already exists rake aborted! ActiveRecord::NoEnvironmentInSchemaError: Environment data not found in the schema. To resolve this issue, run: bin/rails db:environment:set RAILS_ENV=production /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/migration.rb:1135:in `last_stored_environment' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/tasks/database_tasks.rb:58:in `check_protected_environments!' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:13:in `block (2 levels) in ' /usr/local/bundle/gems/activerecord-5.2.4.3/lib/active_record/railties/databases.rake:262:in `block (3 levels) in ' /usr/local/bundle/gems/rake-13.0.1/exe/rake:27:in `' /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 ' /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 `' /usr/local/bundle/bin/bundle:23:in `load' /usr/local/bundle/bin/bundle:23:in `
' Tasks: TOP => db:schema:load => db:check_protected_environments (See full trace by running task with --trace) ```
chrisvel commented 4 years ago

@Ch0wW can you try just docker-compose run app bundle exec rake db:migrate:reset ?

Ch0wW commented 4 years ago

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
chrisvel commented 4 years ago

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.

Ch0wW commented 4 years ago

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 ❤')
chrisvel commented 4 years ago

This is just a warning of Sidekiq, I guess it will go away If updated. Did you log in successfully ?

Ch0wW commented 4 years ago

I've restarted from scratch the database, created the steps once again, and it did work successfully.

image

chrisvel commented 4 years ago

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.

Ch0wW commented 4 years ago

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...

chrisvel commented 4 years ago

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.

gerlanmendes commented 5 months ago

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:inblock (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:inyield_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:inblock 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:inblock 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:inlog' /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:increate_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:inblock 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:inmethod_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:inexec_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:inblock 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:inmigrate' /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:inblock 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:inblock 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:inwithin_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:intransaction' /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:inexecute_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:ineach' /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:inblock 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:inmigrate' /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:inmigrate' /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:inblock (2 levels) in

' /usr/local/bundle/ruby/2.6.0/gems/airbrake-13.0.3/lib/airbrake/rake.rb:17:in execute' /app/spa/lib/tasks/monitor_concurrent.rake:10:inblock (4 levels) in
' /app/spa/lib/tasks/monitor_concurrent.rake:7:in loop' /app/spa/lib/tasks/monitor_concurrent.rake:7:inblock (3 levels) in
' /usr/local/bundle/ruby/2.6.0/gems/airbrake-13.0.3/lib/airbrake/rake.rb:17: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:inkernel_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:inexec' /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:ininvoke_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:indispatch' /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:instart' /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:inwith_friendly_errors' /usr/local/bundle/gems/bundler-2.3.11/exe/bundle:36:in <top (required)>' /usr/local/bundle/bin/bundle:23:inload' /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:inblock (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:inyield_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:inblock 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:inblock 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:inlog' /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:increate_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:inblock 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:inmethod_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:inexec_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:inblock 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:inmigrate' /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:inblock 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:inblock 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:inwithin_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:intransaction' /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:inexecute_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:ineach' /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:inblock 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:inmigrate' /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:inmigrate' /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:inblock (2 levels) in

' /usr/local/bundle/ruby/2.6.0/gems/airbrake-13.0.3/lib/airbrake/rake.rb:17:in execute' /app/spa/lib/tasks/monitor_concurrent.rake:10:inblock (4 levels) in
' /app/spa/lib/tasks/monitor_concurrent.rake:7:in loop' /app/spa/lib/tasks/monitor_concurrent.rake:7:inblock (3 levels) in
' /usr/local/bundle/ruby/2.6.0/gems/airbrake-13.0.3/lib/airbrake/rake.rb:17: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:inkernel_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:inexec' /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:ininvoke_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:indispatch' /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:instart' /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:inwith_friendly_errors' /usr/local/bundle/gems/bundler-2.3.11/exe/bundle:36:in <top (required)>' /usr/local/bundle/bin/bundle:23:inload' /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:inblock (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:inyield_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:inblock 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:inblock 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:inlog' /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:increate_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:inblock 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:inmethod_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:inexec_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:inblock 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:inmigrate' /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:inblock 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:inblock 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:inwithin_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:intransaction' /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:inexecute_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:ineach' /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:inblock 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:inmigrate' /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:inmigrate' /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:inblock (2 levels) in

' /usr/local/bundle/ruby/2.6.0/gems/airbrake-13.0.3/lib/airbrake/rake.rb:17:in execute' /app/spa/lib/tasks/monitor_concurrent.rake:10:inblock (4 levels) in
' /app/spa/lib/tasks/monitor_concurrent.rake:7:in loop' /app/spa/lib/tasks/monitor_concurrent.rake:7:inblock (3 levels) in
' /usr/local/bundle/ruby/2.6.0/gems/airbrake-13.0.3/lib/airbrake/rake.rb:17: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:inkernel_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:inexec' /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:ininvoke_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:indispatch' /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:instart' /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:inwith_friendly_errors' /usr/local/bundle/gems/bundler-2.3.11/exe/bundle:36:in <top (required)>' /usr/local/bundle/bin/bundle:23:inload' /usr/local/bundle/bin/bundle:23:in `
' Tasks: TOP => db:migrate (See full trace by running task with --trace) /usr/local/bundle/ruby/2.6.0/gems/brdata-3.3.0/lib/brdata.rb:37: warning: already initialized constant FERIADOS_PATH /usr/local/bundle/ruby/2.6.0/gems/brdata-3.3.0/lib/brdata.rb:36: warning: previous definition of FERIADOS_PATH was here

gerlanmendes commented 5 months ago

Similar problem