thawke
I’m attempting to create a resource that has a :datetime attribute:
attribute :pickup_time, :datetime do
public? true
allow_nil? false
end
The resource is setup with AshEvents and is set to log the events with the following code:
events do
event_log(Api.Events.Event)
end
If I post to the creation endpoint with invalid data, like an integer for example, I get the expected error:
{
"errors": [
{
"code": "invalid_attribute",
"id": "6a24f1be-5c2c-497d-b860-246d8f7d0ecf",
"meta": {},
"status": "400",
"title": "InvalidAttribute",
"source": {
"pointer": "/data/attributes/pickup_time"
},
"detail": "Could not cast input to datetime"
}
],
"jsonapi": {
"version": "1.0"
}
}
However if I send "pickup_time": "2025-07-15" or "pickup_time": "2025-07-15 00:00:00" then it seems to pass validation but (ash_events 0.4.2) lib/events/action_wrapper_helpers.ex:23 appears to throw a match error. (Value returned from dump_to_embedded is :error)
Full stack trace:
[error] ** (Ash.Error.Unknown)
Bread Crumbs:
> Exception raised in: Api.Shipments.Shipment.create
Unknown Error
* ** (MatchError) no match of right hand side value: :error
(ash_events 0.4.2) lib/events/action_wrapper_helpers.ex:23: AshEvents.Events.ActionWrapperHelpers.dump_value/2
(ash_events 0.4.2) lib/events/action_wrapper_helpers.ex:54: anonymous fn/2 in AshEvents.Events.ActionWrapperHelpers.create_event!/4
(elixir 1.18.4) lib/enum.ex:1722: anonymous fn/3 in Enum.map/2
(stdlib 6.2.2.1) maps.erl:860: :maps.fold_1/4
(elixir 1.18.4) lib/enum.ex:2558: Enum.map/2
(ash_events 0.4.2) lib/events/action_wrapper_helpers.ex:47: AshEvents.Events.ActionWrapperHelpers.create_event!/4
(ash_events 0.4.2) lib/events/create_action_wrapper.ex:19: AshEvents.CreateActionWrapper.create/3
(ash 3.5.26) lib/ash/actions/create/create.ex:309: anonymous fn/6 in Ash.Actions.Create.commit/3
(ash 3.5.26) lib/ash/changeset/changeset.ex:4645: Ash.Changeset.run_around_actions/2
(ash 3.5.26) lib/ash/changeset/changeset.ex:4181: anonymous fn/3 in Ash.Changeset.with_hooks/3
(api 0.1.0) lib/api/repo.ex:2: anonymous fn/1 in Api.Repo."transaction (overridable 1)"/2
(ecto 3.13.2) lib/ecto/repo/transaction.ex:7: anonymous fn/2 in Ecto.Repo.Transaction.transact/4
(ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1458: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
(db_connection 2.8.0) lib/db_connection.ex:1753: DBConnection.run_transaction/4
(ash 3.5.26) lib/ash/changeset/changeset.ex:4179: anonymous fn/3 in Ash.Changeset.with_hooks/3
(ash 3.5.26) lib/ash/changeset/changeset.ex:4323: anonymous fn/2 in Ash.Changeset.transaction_hooks/2
(ash 3.5.26) lib/ash/changeset/changeset.ex:4166: Ash.Changeset.with_hooks/3
(ash 3.5.26) lib/ash/actions/create/create.ex:261: Ash.Actions.Create.commit/3
(ash 3.5.26) lib/ash/actions/create/create.ex:132: Ash.Actions.Create.do_run/4
(ash 3.5.26) lib/ash/actions/create/create.ex:50: Ash.Actions.Create.run/4
(ash_events 0.4.2) lib/events/action_wrapper_helpers.ex:23: AshEvents.Events.ActionWrapperHelpers.dump_value/2
(ash_events 0.4.2) lib/events/action_wrapper_helpers.ex:54: anonymous fn/2 in AshEvents.Events.ActionWrapperHelpers.create_event!/4
(elixir 1.18.4) lib/enum.ex:1722: anonymous fn/3 in Enum.map/2
(stdlib 6.2.2.1) maps.erl:860: :maps.fold_1/4
(elixir 1.18.4) lib/enum.ex:2558: Enum.map/2
(ash_events 0.4.2) lib/events/action_wrapper_helpers.ex:47: AshEvents.Events.ActionWrapperHelpers.create_event!/4
(ash_events 0.4.2) lib/events/create_action_wrapper.ex:19: AshEvents.CreateActionWrapper.create/3
(ash 3.5.26) lib/ash/actions/create/create.ex:309: anonymous fn/6 in Ash.Actions.Create.commit/3
(ash 3.5.26) lib/ash/changeset/changeset.ex:4645: Ash.Changeset.run_around_actions/2
(ash 3.5.26) lib/ash/changeset/changeset.ex:4181: anonymous fn/3 in Ash.Changeset.with_hooks/3
(api 0.1.0) lib/api/repo.ex:2: anonymous fn/1 in Api.Repo."transaction (overridable 1)"/2
(ecto 3.13.2) lib/ecto/repo/transaction.ex:7: anonymous fn/2 in Ecto.Repo.Transaction.transact/4
(ecto_sql 3.13.2) lib/ecto/adapters/sql.ex:1458: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
(db_connection 2.8.0) lib/db_connection.ex:1753: DBConnection.run_transaction/4
(ash 3.5.26) lib/ash/changeset/changeset.ex:4179: anonymous fn/3 in Ash.Changeset.with_hooks/3
(ash 3.5.26) lib/ash/changeset/changeset.ex:4323: anonymous fn/2 in Ash.Changeset.transaction_hooks/2
(ash 3.5.26) lib/ash/changeset/changeset.ex:4166: Ash.Changeset.with_hooks/3
(ash 3.5.26) lib/ash/actions/create/create.ex:261: Ash.Actions.Create.commit/3
(ash 3.5.26) lib/ash/actions/create/create.ex:132: Ash.Actions.Create.do_run/4
(ash 3.5.26) lib/ash/actions/create/create.ex:50: Ash.Actions.Create.run/4
I created a small reproduction repo: https://github.com/thenhawke/ash_events_reporoduction
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m aware of 2 such projects, are there others?
git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
How do I tell Hologram not to escape HTML when substituting into templates?
{Textile.render(@product.long_description)}
escapes the HTM...
New
I’d like to create a file with 600 permissions (rw-------), but there’s a race condition if I create it and then change the permissions. ...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
When I use Mix.install with a git dependency, using git@github.com:... how do I change the SSH identity used?
I’ve got two Github accoun...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
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
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #elixirconf-us
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #security
- #elixirconf-eu
- #api
- #forms
- #performance










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
ken-kost
It’s related to
Ash.Type.dump_to_embedded/3call.I was able to make this work:
dump_to_embedded:So not sure if this is even right. Should it be a string after the dump?
zachdaniel
@thawke please open an issue on
ash_events@Torkan is working on this area currently. In fact it may already be fixed inmain, would be worth checking.Torkan
Hi @thawke!
Like @zachdaniel suggested, this issue should already be resolved in
main.Can you try using the main branch instead of the latest published version, and see if that works?
thawke
Can confirm this works in the
mainbranch. Thanks!