Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Postgres conflict_target bug #211

Closed
eliasdarruda opened this issue Jul 8, 2023 · 0 comments · Fixed by #212
Closed

[BUG] Postgres conflict_target bug #211

eliasdarruda opened this issue Jul 8, 2023 · 0 comments · Fixed by #212
Labels
bug Something isn't working good first issue Good for newcomers proxy

Comments

@eliasdarruda
Copy link
Collaborator

eliasdarruda commented Jul 8, 2023

When using persistent lookups on postgres, as the "actor" column that is used for the conflict_target doesnt have a constraint, it errors. We should use id to match the constraint correctly

spawn-proxy-botserver_1  | 2023-07-08 00:19:42.526 [spawn_actors_node@127.0.0.1]:[pid=<0.2917.0> ]:[error]:GenServer #PID<0.2917.0> terminating
spawn-proxy-botserver_1  | ** (Postgrex.Error) ERROR 42P10 (invalid_column_reference) there is no unique or exclusion constraint matching the ON CONFLICT specification
spawn-proxy-botserver_1  |     (ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:913: Ecto.Adapters.SQL.raise_sql_call_error/1
spawn-proxy-botserver_1  |     (ecto 3.10.1) lib/ecto/repo/schema.ex:764: Ecto.Repo.Schema.apply/4
spawn-proxy-botserver_1  |     (ecto 3.10.1) lib/ecto/repo/schema.ex:377: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
spawn-proxy-botserver_1  |     (spawn_statestores_postgres 0.0.0-local.dev) lib/statestores/adapters/postgres_lookup_adapter.ex:55: Statestores.Adapters.PostgresLookupAdapter.set/3
spawn-proxy-botserver_1  |     (spawn 0.0.0-local.dev) lib/spawn/cluster/state_handoff/controllers/persistent_controller.ex:89: Spawn.Cluster.StateHandoff.Controllers.PersistentController.set/4
spawn-proxy-botserver_1  |     (spawn 0.0.0-local.dev) lib/spawn/cluster/state_handoff/manager.ex:113: Spawn.Cluster.StateHandoff.Manager.handle_info/2
spawn-proxy-botserver_1  |     (stdlib 5.0.2) gen_server.erl:1077: :gen_server.try_handle_info/3
spawn-proxy-botserver_1  |     (stdlib 5.0.2) gen_server.erl:1165: :gen_server.handle_msg/6

Saving state errors too

spawn-proxy-botserver_1  | ** (Postgrex.Error) ERROR 42P10 (invalid_column_reference) there is no unique or exclusion constraint matching the ON CONFLICT specification
spawn-proxy-botserver_1  |     (ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:913: Ecto.Adapters.SQL.raise_sql_call_error/1
spawn-proxy-botserver_1  |     (ecto 3.10.1) lib/ecto/repo/schema.ex:764: Ecto.Repo.Schema.apply/4
spawn-proxy-botserver_1  |     (ecto 3.10.1) lib/ecto/repo/schema.ex:377: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
spawn-proxy-botserver_1  |     (spawn_statestores_postgres 0.0.0-local.dev) lib/statestores/adapters/postgres_snapshot_adapter.ex:27: Statestores.Adapters.PostgresSnapshotAdapter.save/1
spawn-proxy-botserver_1  |     (elixir 1.14.5) lib/task/supervised.ex:89: Task.Supervised.invoke_mfa/2
spawn-proxy-botserver_1  |     (elixir 1.14.5) lib/task/supervised.ex:34: Task.Supervised.reply/4
spawn-proxy-botserver_1  |     (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers proxy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants