Migrating DB schemas #1049

Closed
opened 2019-07-01 19:12:56 +00:00 by fastidious · 4 comments
Member

Getting:

root@pub:/opt/pleroma# su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate"
19:11:17.392 [info] == Running 20170522160642 Pleroma.Repo.Migrations.CaseInsensivtivity.up/0 forward
19:11:17.394 [info] execute "create extension if not exists citext"
19:11:17.395 [info] extension "citext" already exists, skipping
19:11:17.395 [info] alter table users
** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "users_email_index" already exists
    (ecto_sql) lib/ecto/adapters/sql.ex:618: Ecto.Adapters.SQL.raise_sql_call_error/1
    (elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
    (ecto_sql) lib/ecto/adapters/sql.ex:705: Ecto.Adapters.SQL.execute_ddl/4
    (ecto_sql) lib/ecto/migration/runner.ex:302: Ecto.Migration.Runner.log_and_execute_ddl/3
    (ecto_sql) lib/ecto/migration/runner.ex:111: anonymous fn/5 in Ecto.Migration.Runner.flush/0
    (elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ecto_sql) lib/ecto/migration/runner.ex:110: Ecto.Migration.Runner.flush/0
    (stdlib) timer.erl:166: :timer.tc/1

Instance is up, but can't register. Using mix pleroma.user new... from command line renders ** (Mix) The task "pleroma.user" could not be found.

Getting: ``` root@pub:/opt/pleroma# su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate" 19:11:17.392 [info] == Running 20170522160642 Pleroma.Repo.Migrations.CaseInsensivtivity.up/0 forward 19:11:17.394 [info] execute "create extension if not exists citext" 19:11:17.395 [info] extension "citext" already exists, skipping 19:11:17.395 [info] alter table users ** (Postgrex.Error) ERROR 42P07 (duplicate_table) relation "users_email_index" already exists (ecto_sql) lib/ecto/adapters/sql.ex:618: Ecto.Adapters.SQL.raise_sql_call_error/1 (elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2 (ecto_sql) lib/ecto/adapters/sql.ex:705: Ecto.Adapters.SQL.execute_ddl/4 (ecto_sql) lib/ecto/migration/runner.ex:302: Ecto.Migration.Runner.log_and_execute_ddl/3 (ecto_sql) lib/ecto/migration/runner.ex:111: anonymous fn/5 in Ecto.Migration.Runner.flush/0 (elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3 (ecto_sql) lib/ecto/migration/runner.ex:110: Ecto.Migration.Runner.flush/0 (stdlib) timer.erl:166: :timer.tc/1 ``` Instance is up, but can't register. Using `mix pleroma.user new...` from command line renders `** (Mix) The task "pleroma.user" could not be found`.
Member

@fastidious The above migration is from May 2017. Are you sure you're running the latest codebase? mix pleroma.user new... works for me locally with the most recent codebase.

@fastidious The above migration is from May 2017. Are you sure you're running the latest codebase? `mix pleroma.user new...` works for me locally with the most recent codebase.
Author
Member

@i1t I followed installation instructions from here: https://docs.pleroma.social/otp_en.html. It downloads and installs (based on my "flavour"):

curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/master/download?job=amd64' -o /tmp/pleroma.zip
unzip /tmp/pleroma.zip -d /tmp/
@i1t I followed installation instructions from here: https://docs.pleroma.social/otp_en.html. It downloads and installs (based on my "flavour"): ``` curl 'https://git.pleroma.social/api/v4/projects/2/jobs/artifacts/master/download?job=amd64' -o /tmp/pleroma.zip unzip /tmp/pleroma.zip -d /tmp/ ```
Member

Known issue, fixed by #4733. In the meantime, just drop the index in the postgres console by executing DROP INDEX users_email_index on the pleroma database and resume the migrations

Known issue, fixed by #4733. In the meantime, just drop the index in the postgres console by executing `DROP INDEX users_email_index` on the pleroma database and resume the migrations
Member

Related MR: #4756

Related MR: https://git.pleroma.social/pleroma/pleroma/pulls/4756
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma#1049
No description provided.