albin
On a fresh project with ash_authentication installed, an insert into the user table triggers a rollback. However, it works fine for other simple resources.
[info] GET /register
[debug] Processing with AshAuthentication.Phoenix.SignInLive.register/2
Parameters: %{}
Pipelines: [:browser]
[info] Sent 200 in 3ms
[info] CONNECTED TO Phoenix.LiveView.Socket in 13µs
Transport: :websocket
Serializer: Phoenix.Socket.V2.JSONSerializer
Parameters: %{"_csrf_token" => "WQAnQHAKB3MZCgFGClQUGxkoFCQoK38L-qh2AgKDObo2MeZOoxywNRGA", "_live_referer" => "undefined", "_mount_attempts" => "0", "_mounts" => "0", "_track_static" => %{"0" => "http://localhost:4000/assets/app.css", "1" => "http://localhost:4000/assets/app.js"}, "vsn" => "2.0.0"}
[debug] MOUNT AshAuthentication.Phoenix.SignInLive
Parameters: %{}
Session: %{"_csrf_token" => "tqOr1mL7VhntG1NTvPmSfy8J", "auth_routes_prefix" => "/auth", "context" => nil, "gettext_fn" => nil, "otp_app" => nil, "overrides" => [AshEventsTestWeb.AuthOverrides, AshAuthentication.Phoenix.Overrides.Default], "path" => "/sign-in", "register_path" => "/register", "reset_path" => "/reset", "resources" => nil, "tenant" => nil}
[debug] Replied in 122µs
[debug] HANDLE PARAMS in AshAuthentication.Phoenix.SignInLive
Parameters: %{}
[debug] Replied in 11µs
[debug] HANDLE EVENT "change" in AshAuthentication.Phoenix.SignInLive
Component: AshAuthentication.Phoenix.Components.Password.RegisterForm
Parameters: %{"_csrf_token" => "JD57KkslfGQ1BDg7BHQ7GhMCOzxXGlEkPO4XzH0SclVOCEuNeRVo1cin", "_target" => ["user", "email"], "user" => %{"_unused_password" => "[FILTERED]", "_unused_password_confirmation" => "[FILTERED]", "email" => "haha@lol.", "password" => "[FILTERED]", "password_confirmation" => "[FILTERED]"}}
[debug] Replied in 1ms
[debug] HANDLE EVENT "change" in AshAuthentication.Phoenix.SignInLive
Component: AshAuthentication.Phoenix.Components.Password.RegisterForm
Parameters: %{"_csrf_token" => "JD57KkslfGQ1BDg7BHQ7GhMCOzxXGlEkPO4XzH0SclVOCEuNeRVo1cin", "_target" => ["user", "email"], "user" => %{"_unused_password" => "[FILTERED]", "_unused_password_confirmation" => "[FILTERED]", "email" => "haha@lol.com", "password" => "[FILTERED]", "password_confirmation" => "[FILTERED]"}}
[debug] Replied in 1ms
[debug] HANDLE EVENT "change" in AshAuthentication.Phoenix.SignInLive
Component: AshAuthentication.Phoenix.Components.Password.RegisterForm
Parameters: %{"_csrf_token" => "JD57KkslfGQ1BDg7BHQ7GhMCOzxXGlEkPO4XzH0SclVOCEuNeRVo1cin", "_target" => ["user", "password"], "user" => %{"_unused_password_confirmation" => "[FILTERED]", "email" => "haha@lol.com", "password" => "[FILTERED]", "password_confirmation" => "[FILTERED]"}}
[debug] Replied in 1ms
[debug] HANDLE EVENT "change" in AshAuthentication.Phoenix.SignInLive
Component: AshAuthentication.Phoenix.Components.Password.RegisterForm
Parameters: %{"_csrf_token" => "JD57KkslfGQ1BDg7BHQ7GhMCOzxXGlEkPO4XzH0SclVOCEuNeRVo1cin", "_target" => ["user", "password_confirmation"], "user" => %{"email" => "haha@lol.com", "password" => "[FILTERED]", "password_confirmation" => "[FILTERED]"}}
[debug] Replied in 1ms
[debug] HANDLE EVENT "submit" in AshAuthentication.Phoenix.SignInLive
Component: AshAuthentication.Phoenix.Components.Password.RegisterForm
Parameters: %{"_csrf_token" => "JD57KkslfGQ1BDg7BHQ7GhMCOzxXGlEkPO4XzH0SclVOCEuNeRVo1cin", "user" => %{"email" => "haha@lol.com", "password" => "[FILTERED]", "password_confirmation" => "[FILTERED]"}}
[debug] QUERY OK db=0.6ms idle=1283.2ms
begin []
↳ anonymous fn/3 in Ash.Changeset.with_hooks/3, at: lib/ash/changeset/changeset.ex:3760
[debug] QUERY OK db=0.5ms
SELECT pg_advisory_xact_lock($1) [2147483647]
[debug] QUERY OK source="events" db=2.0ms
INSERT INTO "events" ("data","version","metadata","resource","action","action_type","occurred_at","record_id") VALUES ($1,$2,$3,$4,$5,$6,$7,$8) RETURNING "user_id","record_id","occurred_at","system_actor","action_type","action","resource","metadata","version","data","id" [%{password: "asdfasdf", email: #Ash.CiString<"haha@lol.com">, password_confirmation: "asdfasdf"}, 1, %{}, AshEventsTest.Accounts.User, :register_with_password, :create, ~U[2025-05-24 16:13:04.472551Z], "f4e3ef2d-2f6d-48e5-ba52-7bc4a7c26017"]
↳ AshPostgres.DataLayer.bulk_create/3, at: lib/data_layer.ex:1979
[debug] QUERY OK db=0.5ms
rollback []
↳ anonymous fn/3 in Ash.Changeset.with_hooks/3, at: lib/ash/changeset/changeset.ex:3760
[debug] Replied in 15ms
To Reproduce
Here’s a minimal reproduction of the issue: GitHub - albinkc/ash_events_test · GitHub
Expected behavior
An Error stating the reason for the transaction rollback.
** Runtime
-
Erlang/OTP 27 [erts-15.2.7] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
-
Elixir 1.18.3 (compiled with Erlang/OTP 27)
-
MacOS 15.5
Additional context
FWIW, Tried on both PG 17 and 18
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
Are there any log messages showing warnings for unhandled errors?
zachdaniel
Definitely something strange.
zachdaniel
I will have to look in a few days. Does the error go away if you don’t use ash_events?
albin
yes, without ash_events, adding a user via /register or via ash_admin works as expected
zachdaniel
Interesting. Perhaps @Torkan will have a chance to look into this? Otherwise, I will look at the repro in a few days.
albin
nothing I could find in the logs. Here’s the full log:
albin
OK, when I clicked create on User resource in Ash Admin, the page froze for about 5-10 seconds and then gave me this error:
zachdaniel
froze for 5-10 seconds
wacky. That sounds like some kind of ash_admin error handling bug?
But this appears to be something we essentially just didn’t consider which is that ash_authentication depends on the name of the action lining up to do what it does.
I think we need to make two changes:
contextfrom the parent to the childchange set_context(%{strategy_name: :password})so that ash_authentication picks it up from the contextAshEvents is pretty young, so there may be interactions like this that need to be considered.
#1 is relatively straightforward to do if you’d like to try your hand at a PR. In the action wrappers:
albin
Here’s a draft PR I created. Please review.
https://github.com/ash-project/ash_events/pull/20
zachdaniel
LGTM, will let @Torkan review. It is a draft, would you prefer it not be merged? Does that PR resolve your issue?