pentacent / keila

Open Source Newsletter Tool.
https://keila.io
GNU Affero General Public License v3.0
1.44k stars 81 forks source link

Can't Install, DB issue #294

Closed eyounelson closed 6 months ago

eyounelson commented 6 months ago

My first time using docker for anything serious.

I've been unsuccessfully trying to get the docker image running. I want to use a PostgreSQL instance on my local machine and so I have set DB_URL to postgres://root:password@localhost/kelia

docker run --name keila --env-file .env.test --platform linux/amd64 pentacent/keila throws the following:

16:22:52.077 [error] Postgrex.Protocol (#PID<0.2530.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
16:22:52.077 [error] Postgrex.Protocol (#PID<0.2529.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
16:22:53.353 [error] Postgrex.Protocol (#PID<0.2530.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
16:22:54.285 [error] Postgrex.Protocol (#PID<0.2529.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
16:22:55.081 [error] Could not create schema migrations table. This error usually happens due to the following:

  * The database does not exist
  * The "schema_migrations" table, which Ecto uses for managing
    migrations, was defined by another library
  * There is a deadlock while migrating (such as using concurrent
    indexes with a migration_lock)

To fix the first issue, run "mix ecto.create" for the desired MIX_ENV.

To address the second, you can run "mix ecto.drop" followed by
"mix ecto.create", both for the desired MIX_ENV. Alternatively you may
configure Ecto to use another table and/or repository for managing
migrations:

    config :keila, Keila.Repo,
      migration_source: "some_other_table_for_schema_migrations",
      migration_repo: AnotherRepoForSchemaMigrations

The full error report is shown below.

16:22:55.093 [notice] Application keila exited: exited in: Keila.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2997ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:

  1. Ensuring your database is available and that you can connect to it
  2. Tracking down slow queries and making sure they are running fast enough
  3. Increasing the pool_size (although this increases resource consumption)
  4. Allowing requests to wait longer by increasing :queue_target and :queue_interval

See DBConnection.start_link/2 for more information

            (ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:913: Ecto.Adapters.SQL.raise_sql_call_error/1
            (elixir 1.15.7) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
            (ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:1005: Ecto.Adapters.SQL.execute_ddl/4
            (ecto_sql 3.10.1) lib/ecto/migrator.ex:738: Ecto.Migrator.verbose_schema_migration/3
            (ecto_sql 3.10.1) lib/ecto/migrator.ex:552: Ecto.Migrator.lock_for_migrations/4
            (ecto_sql 3.10.1) lib/ecto/migrator.ex:428: Ecto.Migrator.run/4
            (ecto_sql 3.10.1) lib/ecto/migrator.ex:170: Ecto.Migrator.with_repo/3
            (keila 0.14.4) lib/keila/release_tasks.ex:28: Keila.ReleaseTasks.migrate/0
Kernel pid terminated (application_controller) ("{application_start_failure,keila,{bad_return,{{'Elixir.Keila.Application',start,[normal,[]]},{'EXIT',{#{message => <<\"connection not available and request was dropped from queue after 2997ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:\n\n  1. Ensuring your database is available and that you can connect to it\n  2. Tracking down slow queries and making sure they are running fast enough\n  3. Increasing the pool_size (although this increases resource consumption)\n  4. Allowing requests to wait longer by increasing :queue_target and :queue_interval\n\nSee DBConnection.start_link/2 for more information\n\">>,reason => queue_timeout,'__struct__' => 'Elixir.DBConnection.ConnectionError','__exception__' => true,severity => error},[{'Elixir.Ecto.Adapters.SQL',raise_sql_call_error,1,[{file,\"lib/ecto/adapters/sql.ex\"},{line,913},{error_info,#{module => 'Elixir.Exception'}}]},{'Elixir.Enum','-map

Crash dump is being written to: erl_crash.dump...done

I can connect to the database with:

psql -U root -d kelia -h localhost
wmnnd commented 6 months ago

A Docker container can't access the localhost of the host system because it has its own localhost. You’ll need to map the local IPs to connect from the container to the host system.

eyounelson commented 6 months ago

@wmnnd

figured that out, thanks.

There's another one though

...
16:35:51.771 [info] == Running 20211101230000 Keila.Repo.Migrations.AddContactCustomData.change/0 backward
16:35:51.771 [info] alter table contacts
16:35:51.771 [info] == Migrated 20211101230000 in 0.0s
16:35:51.773 [info] == Running 20210816142200 Keila.Repo.Migrations.DefaultContactStatus.change/0 backward
16:35:51.776 [notice] Application keila exited: exited in: Keila.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (Ecto.MigrationError) cannot reverse migration command: alter table contacts. You will need to explicitly define up/0 and down/0 in your migration
            (ecto_sql 3.10.1) lib/ecto/migration/runner.ex:213: Ecto.Migration.Runner.execute_in_direction/5
            (elixir 1.15.7) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
            (elixir 1.15.7) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
            (ecto_sql 3.10.1) lib/ecto/migration/runner.ex:290: Ecto.Migration.Runner.perform_operation/3
            (stdlib 5.2.2) timer.erl:270: :timer.tc/2
            (ecto_sql 3.10.1) lib/ecto/migration/runner.ex:25: Ecto.Migration.Runner.run/8
            (ecto_sql 3.10.1) lib/ecto/migrator.ex:362: Ecto.Migrator.attempt/8
Kernel pid terminated (application_controller) ("{application_start_failure,keila,{bad_return,{{'Elixir.Keila.Application',start,[normal,[]]},{'EXIT',{#{message => <<\"cannot reverse migration command: alter table contacts. You will need to explicitly define up/0 and down/0 in your migration\">>,'__struct__' => 'Elixir.Ecto.MigrationError','__exception__' => true},[{'Elixir.Ecto.Migration.Runner',execute_in_direction,5,[{file,\"lib/ecto/migration/runner.ex\"},{line,213}]},{'Elixir.Enum','-map/2-lists^map/1-1-',2,[{file,\"lib/enum.ex\"},{line,1693}]},{'Elixir.Enum','-map/2-lists^map/1-1-',2,[{file,\"lib/enum.ex\"},{line,1693}]},{'Elixir.Ecto.Migration.Runner',perform_operation,3,[{file,\"lib/ecto/migration/runner.ex\"},{line,290}]},{timer,tc,2,[{file,\"timer.erl\"},{line,270}]},{'Elixir.Ecto.Migration.Runner',run,8,[{file,\"lib/ecto/migration/runner.ex\"},{line,25}]},{'Elixir.Ecto.Migrator',attempt,8,[{file,\"lib/ecto/migrator.ex\"},{line,362}]}]}}}}}")

Crash dump is being written to: erl_crash.dump...done
wmnnd commented 6 months ago

What did it output before this? It looks like something else went wrong.

eyounelson commented 6 months ago

I removed the container and created a new one which seems to be working now.

However, this is the full migration log from my previous message:


16:35:50.722 [info] == Running 20201229080000 PreluApi.Repo.Migrations.Auth.change/0 forward
16:35:50.725 [info] create table users
16:35:50.737 [info] create index users_email_index
16:35:50.741 [info] create table tokens
16:35:50.749 [info] create table groups
16:35:50.752 [info] create table roles
16:35:50.756 [info] create table permissions
16:35:50.760 [info] create index permissions_name_index
16:35:50.761 [info] create table user_groups
16:35:50.765 [info] create index user_groups_user_id_group_id_index
16:35:50.766 [info] create table user_group_roles
16:35:50.770 [info] create index user_group_roles_user_group_id_role_id_index
16:35:50.771 [info] create table role_permissions
16:35:50.777 [info] create index role_permissions_role_id_permission_id_index
16:35:50.778 [info] == Migrated 20201229080000 in 0.0s
16:35:50.791 [info] == Running 20210104175000 Keila.Repo.Migrations.RootGroup.change/0 forward
16:35:50.791 [info] create index root_group
16:35:50.793 [info] == Migrated 20210104175000 in 0.0s
16:35:50.796 [info] == Running 20210105112000 Keila.Repo.Migrations.Projects.change/0 forward
16:35:50.796 [info] create table projects
16:35:50.799 [info] == Migrated 20210105112000 in 0.0s
16:35:50.802 [info] == Running 20210105164500 Keila.Repo.Migrations.ContactsMailings.change/0 forward
16:35:50.802 [info] create table contacts
16:35:50.808 [info] create index contacts_email_project_id_index
16:35:50.810 [info] create table contacts_forms
16:35:50.814 [info] create table mailings_senders
16:35:50.818 [info] create index mailings_senders_from_email_index
16:35:50.823 [info] create index mailings_senders_name_project_id_index
16:35:50.824 [info] create table mailings_campaigns
16:35:50.830 [info] create table mailings_recipients
16:35:50.834 [info] == Migrated 20210105164500 in 0.0s
16:35:50.837 [info] == Running 20210121100329 Keila.Repo.Migrations.AddObanJobsTable.up/0 forward
16:35:50.846 [info] execute "DO $$\nBEGIN\nIF NOT EXISTS (SELECT 1 FROM pg_type\n               WHERE typname = 'oban_job_state'\n                 AND typnamespace = 'public'::regnamespace::oid) THEN\n    CREATE TYPE \"public\".oban_job_state AS ENUM (\n      'available',\n      'scheduled',\n      'executing',\n      'retryable',\n      'completed',\n      'discarded'\n    );\n  END IF;\nEND$$;\n"
16:35:50.857 [info] create table if not exists public.oban_jobs
16:35:50.864 [info] create index if not exists public.oban_jobs_queue_index
16:35:50.865 [info] create index if not exists public.oban_jobs_state_index
16:35:50.866 [info] create index if not exists public.oban_jobs_scheduled_at_index
16:35:50.868 [info] execute "CREATE OR REPLACE FUNCTION \"public\".oban_jobs_notify() RETURNS trigger AS $$\nDECLARE\n  channel text;\n  notice json;\nBEGIN\n  IF (TG_OP = 'INSERT') THEN\n    channel = 'public.oban_insert';\n    notice = json_build_object('queue', NEW.queue, 'state', NEW.state);\n\n    -- No point triggering for a job that isn't scheduled to run now\n    IF NEW.scheduled_at IS NOT NULL AND NEW.scheduled_at > now() AT TIME ZONE 'utc' THEN\n      RETURN null;\n    END IF;\n  ELSE\n    channel = 'public.oban_update';\n    notice = json_build_object('queue', NEW.queue, 'new_state', NEW.state, 'old_state', OLD.state);\n  END IF;\n\n  PERFORM pg_notify(channel, notice::text);\n\n  RETURN NULL;\nEND;\n$$ LANGUAGE plpgsql;\n"
16:35:50.871 [info] execute "DROP TRIGGER IF EXISTS oban_notify ON \"public\".oban_jobs"
16:35:50.872 [info] trigger "oban_notify" for relation "public.oban_jobs" does not exist, skipping
16:35:50.872 [info] execute "CREATE TRIGGER oban_notify\nAFTER INSERT OR UPDATE OF state ON \"public\".oban_jobs\nFOR EACH ROW EXECUTE PROCEDURE \"public\".oban_jobs_notify();\n"
16:35:50.873 [info] drop index if exists public.oban_jobs_scheduled_at_index
16:35:50.875 [info] create index public.oban_jobs_scheduled_at_index
16:35:50.878 [info] create check constraint worker_length on table public.oban_jobs
16:35:50.879 [info] create check constraint queue_length on table public.oban_jobs
16:35:50.880 [info] execute "CREATE OR REPLACE FUNCTION \"public\".oban_wrap_id(value bigint) RETURNS int AS $$\nBEGIN\n  RETURN (CASE WHEN value > 2147483647 THEN mod(value, 2147483647) ELSE value END)::int;\nEND;\n$$ LANGUAGE plpgsql IMMUTABLE;\n"
16:35:50.881 [info] alter table public.oban_jobs
16:35:50.882 [info] execute "DROP FUNCTION IF EXISTS \"public\".oban_wrap_id(value bigint)"
16:35:50.883 [info] drop index if exists public.oban_jobs_scheduled_at_index
16:35:50.883 [info] drop index if exists public.oban_jobs_queue_index
16:35:50.884 [info] drop index if exists public.oban_jobs_state_index
16:35:50.885 [info] create index if not exists public.oban_jobs_queue_state_scheduled_at_id_index
16:35:50.886 [info] create index if not exists public.oban_jobs_attempted_at_id_index
16:35:50.888 [info] alter table public.oban_jobs
16:35:50.889 [info] alter table public.oban_jobs
16:35:50.891 [info] drop index if exists public.oban_jobs_queue_state_scheduled_at_id_index
16:35:50.892 [info] create index if not exists public.oban_jobs_state_queue_priority_scheduled_at_id_index
16:35:50.893 [info] execute "CREATE OR REPLACE FUNCTION \"public\".oban_jobs_notify() RETURNS trigger AS $$\nDECLARE\n  channel text;\n  notice json;\nBEGIN\n  IF NEW.state = 'available' THEN\n    channel = 'public.oban_insert';\n    notice = json_build_object('queue', NEW.queue);\n\n    PERFORM pg_notify(channel, notice::text);\n  END IF;\n\n  RETURN NULL;\nEND;\n$$ LANGUAGE plpgsql;\n"
16:35:50.894 [info] execute "DROP TRIGGER IF EXISTS oban_notify ON \"public\".oban_jobs"
16:35:50.895 [info] execute "CREATE TRIGGER oban_notify\nAFTER INSERT ON \"public\".oban_jobs\nFOR EACH ROW EXECUTE PROCEDURE \"public\".oban_jobs_notify();\n"
16:35:50.896 [info] alter table public.oban_jobs
16:35:50.897 [info] execute "DO $$\nDECLARE\n  version int;\n  already bool;\nBEGIN\n  SELECT current_setting('server_version_num')::int INTO version;\n  SELECT '{cancelled}' <@ enum_range(NULL::\"public\".oban_job_state)::text[] INTO already;\n\n  IF already THEN\n    RETURN;\n  ELSIF version >= 120000 THEN\n    ALTER TYPE \"public\".oban_job_state ADD VALUE IF NOT EXISTS 'cancelled';\n  ELSE\n    ALTER TYPE \"public\".oban_job_state RENAME TO old_oban_job_state;\n\n    CREATE TYPE \"public\".oban_job_state AS ENUM (\n      'available',\n      'scheduled',\n      'executing',\n      'retryable',\n      'completed',\n      'discarded',\n      'cancelled'\n    );\n\n    ALTER TABLE \"public\".oban_jobs RENAME column state TO _state;\n    ALTER TABLE \"public\".oban_jobs ADD state \"public\".oban_job_state NOT NULL default 'available';\n\n    UPDATE \"public\".oban_jobs SET state = _state::text::\"public\".oban_job_state;\n\n    ALTER TABLE \"public\".oban_jobs DROP column _state;\n    DROP TYPE \"public\".old_oban_job_state;\n  END IF;\nEND$$;\n"
16:35:50.898 [info] create index if not exists public.oban_jobs_state_queue_priority_scheduled_at_id_index
16:35:50.898 [info] relation "oban_jobs_state_queue_priority_scheduled_at_id_index" already exists, skipping
16:35:50.899 [info] alter table public.oban_jobs
16:35:50.902 [info] create check constraint priority_range on table public.oban_jobs
16:35:50.903 [info] create check constraint positive_max_attempts on table public.oban_jobs
16:35:50.904 [info] create check constraint attempt_range on table public.oban_jobs
16:35:50.904 [info] drop index if exists public.oban_jobs_args_vector
16:35:50.905 [info] index "oban_jobs_args_vector" does not exist, skipping
16:35:50.905 [info] drop index if exists public.oban_jobs_worker_gist
16:35:50.906 [info] index "oban_jobs_worker_gist" does not exist, skipping
16:35:50.906 [info] drop index if exists public.oban_jobs_attempted_at_id_index
16:35:50.907 [info] create index if not exists public.oban_jobs_args_index
16:35:50.910 [info] create index if not exists public.oban_jobs_meta_index
16:35:50.911 [info] create table if not exists public.oban_peers
16:35:50.914 [info] execute "ALTER TABLE \"public\".oban_peers SET UNLOGGED"
16:35:50.923 [info] execute "COMMENT ON TABLE \"public\".oban_jobs IS '11'"
16:35:50.924 [info] == Migrated 20210121100329 in 0.0s
16:35:50.930 [info] == Running 20210222154306 Keila.Repo.Migrations.AddDeliverAtToCampaigns.change/0 forward
16:35:50.930 [info] alter table mailings_campaigns
16:35:50.931 [info] create index scheduled_campaigns
16:35:50.932 [info] == Migrated 20210222154306 in 0.0s
16:35:50.934 [info] == Running 20210225161207 Keila.Repo.Migrations.UpgradeObanJobsToV10.up/0 forward
16:35:50.936 [info] == Migrated 20210225161207 in 0.0s
16:35:50.940 [info] == Running 20210311225200 Keila.Repo.Migrations.Templates.change/0 forward
16:35:50.940 [info] create table templates
16:35:50.946 [info] alter table mailings_campaigns
16:35:50.948 [info] == Migrated 20210311225200 in 0.0s
16:35:50.951 [info] == Running 20210319145300 Keila.Repo.Migrations.FormTimestamps.change/0 forward
16:35:50.951 [info] alter table contacts_forms
16:35:50.953 [info] == Migrated 20210319145300 in 0.0s
16:35:50.955 [info] == Running 20210428165000 Keila.Repo.Migrations.SharedSenders.change/0 forward
16:35:50.956 [info] create table mailings_shared_senders
16:35:50.961 [info] alter table mailings_senders
16:35:50.962 [info] == Migrated 20210428165000 in 0.0s
16:35:50.965 [info] == Running 20210616074300 Keila.Repo.Migrations.AccountsCredits.change/0 forward
16:35:50.966 [info] create table accounts
16:35:50.969 [info] create table accounts_credit_transactions
16:35:50.975 [info] == Migrated 20210616074300 in 0.0s
16:35:50.978 [info] == Running 20210623193000 Keila.Repo.Migrations.Billing.change/0 forward
16:35:50.979 [info] create table billing_subscriptions
16:35:50.984 [info] create index billing_subscriptions_account_id_index
16:35:50.985 [info] create index billing_subscriptions_paddle_subscription_id_index
16:35:50.986 [info] == Migrated 20210623193000 in 0.0s
16:35:50.990 [info] == Running 20210625202500 Keila.Repo.Migrations.Tracking.change/0 forward
16:35:50.990 [info] alter table mailings_recipients
16:35:50.991 [info] create table tracking_links
16:35:50.996 [info] create index tracking_links_url_campaign_id_index
16:35:50.997 [info] create table tracking_clicks
16:35:51.001 [info] == Migrated 20210625202500 in 0.0s
16:35:51.004 [info] == Running 20210630205000 PreluApi.Repo.Migrations.SubscriptionUpserts.up/0 forward
16:35:51.004 [info] alter table billing_subscriptions
16:35:51.005 [info] == Migrated 20210630205000 in 0.0s
16:35:51.008 [info] == Running 20210722042200 Keila.Repo.Migrations.AddContactSoftDelete.change/0 forward
16:35:51.008 [info] alter table contacts
16:35:51.009 [info] create table contacts_events
16:35:51.015 [info] create index contacts_events_contact_id_index
16:35:51.017 [info] == Migrated 20210722042200 in 0.0s
16:35:51.022 [info] == Running 20210809112000 Keila.Repo.Migrations.AddRecipeintReceipt.change/0 forward
16:35:51.022 [info] alter table mailings_recipients
16:35:51.023 [info] == Migrated 20210809112000 in 0.0s
16:35:51.025 [info] == Running 20210816142200 Keila.Repo.Migrations.DefaultContactStatus.change/0 forward
16:35:51.026 [info] alter table contacts
16:35:51.027 [info] == Migrated 20210816142200 in 0.0s
16:35:51.030 [info] == Running 20211101230000 Keila.Repo.Migrations.AddContactCustomData.change/0 forward
16:35:51.030 [info] alter table contacts
16:35:51.031 [info] == Migrated 20211101230000 in 0.0s
16:35:51.033 [info] == Running 20211116040700 Keila.Repo.Migrations.Segments.change/0 forward
16:35:51.034 [info] create table contacts_segments
16:35:51.043 [info] alter table mailings_campaigns
16:35:51.046 [info] == Migrated 20211116040700 in 0.0s
16:35:51.049 [info] == Running 20220114154000 Keila.Repo.Migrations.AddCampaignCustomData.change/0 forward
16:35:51.049 [info] alter table mailings_campaigns
16:35:51.050 [info] create check constraint max_data_size on table mailings_campaigns
16:35:51.051 [info] create check constraint max_data_size on table contacts
16:35:51.052 [info] == Migrated 20220114154000 in 0.0s
16:35:51.054 [info] == Running 20220324085800 Keila.Repo.Migrations.AddUserLocale.change/0 forward
16:35:51.054 [info] alter table users
16:35:51.055 [info] == Migrated 20220324085800 in 0.0s
16:35:51.058 [info] == Running 20220523235000 Keila.Repo.Migrations.AddFiles.change/0 forward
16:35:51.058 [info] create table files
16:35:51.062 [info] == Migrated 20220523235000 in 0.0s
16:35:51.065 [info] == Running 20220825151500 Keila.Repo.Migrations.UpgradeObanJobsToV11.up/0 forward
16:35:51.066 [info] == Migrated 20220825151500 in 0.0s
16:35:51.069 [info] == Running 20220905125000 Keila.Repo.Migrations.EmailsToCitext.up/0 forward
16:35:51.069 [info] execute "CREATE EXTENSION IF NOT EXISTS citext"
16:35:51.110 [info] alter table users
16:35:51.112 [info] alter table contacts
16:35:51.114 [info] == Migrated 20220905125000 in 0.0s
16:35:51.119 [info] == Running 20221227145500 Keila.Repo.Migrations.AddRecipientStates.change/0 forward
16:35:51.119 [info] alter table mailings_recipients
16:35:51.121 [info] alter table contacts_events
16:35:51.123 [info] == Migrated 20221227145500 in 0.0s
16:35:51.126 [info] == Running 20230104115500 Keila.Repo.Migrations.AddRecipientFailedAt.change/0 forward
16:35:51.126 [info] alter table mailings_recipients
16:35:51.127 [info] == Migrated 20230104115500 in 0.0s
16:35:51.131 [info] == Running 20230111222000 Keila.Repo.Migrations.AddCampaignJsonBody.change/0 forward
16:35:51.131 [info] alter table mailings_campaigns
16:35:51.132 [info] == Migrated 20230111222000 in 0.0s
16:35:51.135 [info] == Running 20230120223000 Keila.Repo.Migrations.AddSegmentDefaultFilter.change/0 forward
16:35:51.137 [info] == Migrated 20230120223000 in 0.0s
16:35:51.140 [info] == Running 20230308111500 Keila.Repo.Migrations.AddCampaignPreviewText.change/0 forward
16:35:51.140 [info] alter table mailings_campaigns
16:35:51.141 [info] == Migrated 20230308111500 in 0.0s
16:35:51.144 [info] == Running 20230324104000 Keila.Repo.Migrations.MigrateToHybridTemplateStyles.up/0 forward
16:35:51.146 [info] == Migrated 20230324104000 in 0.0s
16:35:51.149 [info] == Running 20230604141200 Keila.Repo.Migrations.AddContactsFormParams.change/0 forward
16:35:51.150 [info] create table contacts_form_params
16:35:51.155 [info] create check constraint max_data_size on table contacts_form_params
16:35:51.157 [info] == Migrated 20230604141200 in 0.0s
16:35:51.160 [info] == Running 20231203235509 Keila.Repo.Migrations.AddFormDoubleOptInSettings.change/0 forward
16:35:51.160 [info] alter table contacts_forms
16:35:51.164 [info] == Migrated 20231203235509 in 0.0s
16:35:51.166 [info] == Running 20231210140318 Keila.Repo.Migrations.AddContactDoubleOptInTimestamp.change/0 forward
16:35:51.167 [info] alter table contacts
16:35:51.168 [info] == Migrated 20231210140318 in 0.0s
warning: redefining module Keila.Repo.Migrations.AddContactDoubleOptInTimestamp (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20231210140318_add_contact_double_opt_in_timestamp.exs:1: Keila.Repo.Migrations.AddContactDoubleOptInTimestamp (module)

warning: redefining module Keila.Repo.Migrations.AddFormDoubleOptInSettings (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20231203235509_add_form_double_opt_in_settings.exs:1: Keila.Repo.Migrations.AddFormDoubleOptInSettings (module)

warning: redefining module Keila.Repo.Migrations.AddContactsFormParams (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20230604141200_add_contacts_form_params_table.exs:1: Keila.Repo.Migrations.AddContactsFormParams (module)

warning: redefining module Keila.Repo.Migrations.MigrateToHybridTemplateStyles (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20230324104000_migrate_to_hybrid_template_styles.exs:1: Keila.Repo.Migrations.MigrateToHybridTemplateStyles (module)

warning: redefining module Keila.Repo.Migrations.AddCampaignPreviewText (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20230308111500_add_campaign_preview_text.exs:1: Keila.Repo.Migrations.AddCampaignPreviewText (module)

warning: redefining module Keila.Repo.Migrations.AddSegmentDefaultFilter (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20230120223000_add_segment_default_filter.exs:1: Keila.Repo.Migrations.AddSegmentDefaultFilter (module)

warning: redefining module Keila.Repo.Migrations.AddCampaignJsonBody (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20230111222000_add_campaign_json_body.exs:1: Keila.Repo.Migrations.AddCampaignJsonBody (module)

warning: redefining module Keila.Repo.Migrations.AddRecipientFailedAt (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20230104115500_add_recipient_failed_at.exs:1: Keila.Repo.Migrations.AddRecipientFailedAt (module)

warning: redefining module Keila.Repo.Migrations.AddRecipientStates (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20221227145500_add_recipient_states.exs:1: Keila.Repo.Migrations.AddRecipientStates (module)

warning: redefining module Keila.Repo.Migrations.EmailsToCitext (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20220905125000_emails_to_citext.exs:1: Keila.Repo.Migrations.EmailsToCitext (module)

warning: redefining module Keila.Repo.Migrations.UpgradeObanJobsToV11 (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20220825151500_upgrade_oban_jobs_to_v11.exs:1: Keila.Repo.Migrations.UpgradeObanJobsToV11 (module)

warning: redefining module Keila.Repo.Migrations.AddFiles (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20220523235000_add_files.exs:1: Keila.Repo.Migrations.AddFiles (module)

warning: redefining module Keila.Repo.Migrations.AddUserLocale (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20220324085800_add_user_locale.exs:1: Keila.Repo.Migrations.AddUserLocale (module)

warning: redefining module Keila.Repo.Migrations.AddCampaignCustomData (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20220114154000_add_campaign_custom_data.exs:1: Keila.Repo.Migrations.AddCampaignCustomData (module)

warning: redefining module Keila.Repo.Migrations.Segments (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20211116040700_segmentations.exs:1: Keila.Repo.Migrations.Segments (module)

warning: redefining module Keila.Repo.Migrations.AddContactCustomData (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20211101230000_add_contact_custom_data.exs:1: Keila.Repo.Migrations.AddContactCustomData (module)

warning: redefining module Keila.Repo.Migrations.DefaultContactStatus (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210816142200_default_contact_status.exs:1: Keila.Repo.Migrations.DefaultContactStatus (module)

warning: redefining module Keila.Repo.Migrations.AddRecipeintReceipt (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210809112000_add_recipient_receipt.exs:1: Keila.Repo.Migrations.AddRecipeintReceipt (module)

warning: redefining module Keila.Repo.Migrations.AddContactSoftDelete (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210722042200_add_contact_status_and_log.exs:1: Keila.Repo.Migrations.AddContactSoftDelete (module)

warning: redefining module PreluApi.Repo.Migrations.SubscriptionUpserts (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210630205000_subscription_upserts.exs:1: PreluApi.Repo.Migrations.SubscriptionUpserts (module)

warning: redefining module Keila.Repo.Migrations.Tracking (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210625202500_tracking.exs:1: Keila.Repo.Migrations.Tracking (module)

warning: redefining module Keila.Repo.Migrations.Billing (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210623193000_billing.exs:1: Keila.Repo.Migrations.Billing (module)

warning: redefining module Keila.Repo.Migrations.AccountsCredits (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210616074300_accounts.exs:1: Keila.Repo.Migrations.AccountsCredits (module)

warning: redefining module Keila.Repo.Migrations.SharedSenders (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210428165000_shared_senders.exs:1: Keila.Repo.Migrations.SharedSenders (module)

warning: redefining module Keila.Repo.Migrations.FormTimestamps (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210319145300_form_timestamps.exs:1: Keila.Repo.Migrations.FormTimestamps (module)

warning: redefining module Keila.Repo.Migrations.Templates (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210311225200_templates.exs:1: Keila.Repo.Migrations.Templates (module)

warning: redefining module Keila.Repo.Migrations.UpgradeObanJobsToV10 (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210225161207_upgrade_oban_jobs_to_v10.exs:1: Keila.Repo.Migrations.UpgradeObanJobsToV10 (module)

warning: redefining module Keila.Repo.Migrations.AddDeliverAtToCampaigns (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210222154306_add_deliver_at_to_campaigns.exs:1: Keila.Repo.Migrations.AddDeliverAtToCampaigns (module)

warning: redefining module Keila.Repo.Migrations.AddObanJobsTable (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210121100329_add_oban_jobs_table.exs:1: Keila.Repo.Migrations.AddObanJobsTable (module)

warning: redefining module Keila.Repo.Migrations.ContactsMailings (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210105164500_contacts_mailings.exs:1: Keila.Repo.Migrations.ContactsMailings (module)

warning: redefining module Keila.Repo.Migrations.Projects (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210105112000_projects.exs:1: Keila.Repo.Migrations.Projects (module)

warning: redefining module Keila.Repo.Migrations.RootGroup (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20210104175000_root_group.exs:1: Keila.Repo.Migrations.RootGroup (module)

warning: redefining module PreluApi.Repo.Migrations.Auth (current version defined in memory)
  lib/keila-0.14.4/priv/repo/migrations/20201229080000_auth .exs:1: PreluApi.Repo.Migrations.Auth (module)

16:35:51.690 [info] == Running 20231210140318 Keila.Repo.Migrations.AddContactDoubleOptInTimestamp.change/0 backward
16:35:51.691 [info] alter table contacts
16:35:51.692 [info] == Migrated 20231210140318 in 0.0s
16:35:51.697 [info] == Running 20231203235509 Keila.Repo.Migrations.AddFormDoubleOptInSettings.change/0 backward
16:35:51.697 [info] alter table contacts_forms
16:35:51.699 [info] == Migrated 20231203235509 in 0.0s
16:35:51.702 [info] == Running 20230604141200 Keila.Repo.Migrations.AddContactsFormParams.change/0 backward
16:35:51.702 [info] drop constraint max_data_size from table contacts_form_params
16:35:51.703 [info] drop table contacts_form_params
16:35:51.704 [info] == Migrated 20230604141200 in 0.0s
16:35:51.708 [info] == Running 20230324104000 Keila.Repo.Migrations.MigrateToHybridTemplateStyles.down/0 forward
16:35:51.708 [info] == Migrated 20230324104000 in 0.0s
16:35:51.710 [info] == Running 20230308111500 Keila.Repo.Migrations.AddCampaignPreviewText.change/0 backward
16:35:51.710 [info] alter table mailings_campaigns
16:35:51.711 [info] == Migrated 20230308111500 in 0.0s
16:35:51.712 [info] == Running 20230120223000 Keila.Repo.Migrations.AddSegmentDefaultFilter.change/0 backward
16:35:51.712 [info] == Migrated 20230120223000 in 0.0s
16:35:51.715 [info] == Running 20230111222000 Keila.Repo.Migrations.AddCampaignJsonBody.change/0 backward
16:35:51.715 [info] alter table mailings_campaigns
16:35:51.716 [info] == Migrated 20230111222000 in 0.0s
16:35:51.718 [info] == Running 20230104115500 Keila.Repo.Migrations.AddRecipientFailedAt.change/0 backward
16:35:51.718 [info] alter table mailings_recipients
16:35:51.719 [info] == Migrated 20230104115500 in 0.0s
16:35:51.721 [info] == Running 20221227145500 Keila.Repo.Migrations.AddRecipientStates.change/0 backward
16:35:51.721 [info] alter table contacts_events
16:35:51.722 [info] alter table mailings_recipients
16:35:51.723 [info] == Migrated 20221227145500 in 0.0s
16:35:51.725 [info] == Running 20220905125000 Keila.Repo.Migrations.EmailsToCitext.down/0 forward
16:35:51.725 [info] alter table users
16:35:51.733 [info] alter table contacts
16:35:51.736 [info] == Migrated 20220905125000 in 0.0s
16:35:51.740 [info] == Running 20220825151500 Keila.Repo.Migrations.UpgradeObanJobsToV11.down/0 forward
16:35:51.742 [info] drop table public.oban_peers
16:35:51.743 [info] execute "COMMENT ON TABLE \"public\".oban_jobs IS '10'"
16:35:51.744 [info] == Migrated 20220825151500 in 0.0s
16:35:51.748 [info] == Running 20220523235000 Keila.Repo.Migrations.AddFiles.change/0 backward
16:35:51.748 [info] drop table files
16:35:51.750 [info] == Migrated 20220523235000 in 0.0s
16:35:51.753 [info] == Running 20220324085800 Keila.Repo.Migrations.AddUserLocale.change/0 backward
16:35:51.753 [info] alter table users
16:35:51.754 [info] == Migrated 20220324085800 in 0.0s
16:35:51.757 [info] == Running 20220114154000 Keila.Repo.Migrations.AddCampaignCustomData.change/0 backward
16:35:51.757 [info] drop constraint max_data_size from table contacts
16:35:51.758 [info] drop constraint max_data_size from table mailings_campaigns
16:35:51.759 [info] alter table mailings_campaigns
16:35:51.759 [info] == Migrated 20220114154000 in 0.0s
16:35:51.761 [info] == Running 20211116040700 Keila.Repo.Migrations.Segments.change/0 backward
16:35:51.761 [info] alter table mailings_campaigns
16:35:51.763 [info] drop table contacts_segments
16:35:51.764 [info] == Migrated 20211116040700 in 0.0s
16:35:51.771 [info] == Running 20211101230000 Keila.Repo.Migrations.AddContactCustomData.change/0 backward
16:35:51.771 [info] alter table contacts
16:35:51.771 [info] == Migrated 20211101230000 in 0.0s
16:35:51.773 [info] == Running 20210816142200 Keila.Repo.Migrations.DefaultContactStatus.change/0 backward
16:35:51.776 [notice] Application keila exited: exited in: Keila.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (Ecto.MigrationError) cannot reverse migration command: alter table contacts. You will need to explicitly define up/0 and down/0 in your migration
            (ecto_sql 3.10.1) lib/ecto/migration/runner.ex:213: Ecto.Migration.Runner.execute_in_direction/5
            (elixir 1.15.7) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
            (elixir 1.15.7) lib/enum.ex:1693: Enum."-map/2-lists^map/1-1-"/2
            (ecto_sql 3.10.1) lib/ecto/migration/runner.ex:290: Ecto.Migration.Runner.perform_operation/3
            (stdlib 5.2.2) timer.erl:270: :timer.tc/2
            (ecto_sql 3.10.1) lib/ecto/migration/runner.ex:25: Ecto.Migration.Runner.run/8
            (ecto_sql 3.10.1) lib/ecto/migrator.ex:362: Ecto.Migrator.attempt/8
Kernel pid terminated (application_controller) ("{application_start_failure,keila,{bad_return,{{'Elixir.Keila.Application',start,[normal,[]]},{'EXIT',{#{message => <<\"cannot reverse migration command: alter table contacts. You will need to explicitly define up/0 and down/0 in your migration\">>,'__struct__' => 'Elixir.Ecto.MigrationError','__exception__' => true},[{'Elixir.Ecto.Migration.Runner',execute_in_direction,5,[{file,\"lib/ecto/migration/runner.ex\"},{line,213}]},{'Elixir.Enum','-map/2-lists^map/1-1-',2,[{file,\"lib/enum.ex\"},{line,1693}]},{'Elixir.Enum','-map/2-lists^map/1-1-',2,[{file,\"lib/enum.ex\"},{line,1693}]},{'Elixir.Ecto.Migration.Runner',perform_operation,3,[{file,\"lib/ecto/migration/runner.ex\"},{line,290}]},{timer,tc,2,[{file,\"timer.erl\"},{line,270}]},{'Elixir.Ecto.Migration.Runner',run,8,[{file,\"lib/ecto/migration/runner.ex\"},{line,25}]},{'Elixir.Ecto.Migrator',attempt,8,[{file,\"lib/ecto/migrator.ex\"},{line,362}]}]}}}}}")

Crash dump is being written to: erl_crash.dump...done
wmnnd commented 6 months ago

Glad to hear it's working now!