Bulk create action Changeset Error

I'm using bulk create action with upsert and I'm tryong to test that not valid resources will not be created.
resources =
input.resources_attributes
|> MmsBiztalk.bulk_create!(
input.resource,
:create,
upsert?: true,
upsert_identity: :unique_esolver_id,
# for bulk actions upsert_fields must be specified
upsert_fields: hd(input.resources_attributes) |> Map.keys(),
return_stream?: false,
return_records?: true
)
|> Stream.map(fn
{:ok, created_resource} ->
created_resource |> input.resource.to_status!([:syncing, :synced])

_ ->
nil
end)
|> Enum.to_list()
resources =
input.resources_attributes
|> MmsBiztalk.bulk_create!(
input.resource,
:create,
upsert?: true,
upsert_identity: :unique_esolver_id,
# for bulk actions upsert_fields must be specified
upsert_fields: hd(input.resources_attributes) |> Map.keys(),
return_stream?: false,
return_records?: true
)
|> Stream.map(fn
{:ok, created_resource} ->
created_resource |> input.resource.to_status!([:syncing, :synced])

_ ->
nil
end)
|> Enum.to_list()
Using this code with a purposedly wrong changeset gives me this error:
** (FunctionClauseError) no function clause matching in anonymous fn/2 in Ash.Actions.Create.Bulk.do_run/5
(ash 2.9.10) anonymous fn(#Ash.Changeset<api: MmsBiztalk, action_type: :create, action: :create, attributes: %{...}, errors: [%Ash.Error.Changes.Required{field: :customer_id, type: :argument, resource: MmsBiztalk.InvoiceData, changeset: nil, query: nil, error_context: [], vars: [], path: [], stacktrace: #Stacktrace<>, class: :invalid}], data: #MmsBiztalk.InvoiceData<customer: #Ash.NotLoaded<:relationship>, data_in: #Ash.NotLoaded<:relationship>, __meta__: #Ecto.Schema.Metadata<:built, ...>, context: %{bulk_create: %{index: 0}}, valid?: false>, %{batch: [], count: 0, must_return_records?: false}) in Ash.Actions.Create.Bulk.do_run/5
** (FunctionClauseError) no function clause matching in anonymous fn/2 in Ash.Actions.Create.Bulk.do_run/5
(ash 2.9.10) anonymous fn(#Ash.Changeset<api: MmsBiztalk, action_type: :create, action: :create, attributes: %{...}, errors: [%Ash.Error.Changes.Required{field: :customer_id, type: :argument, resource: MmsBiztalk.InvoiceData, changeset: nil, query: nil, error_context: [], vars: [], path: [], stacktrace: #Stacktrace<>, class: :invalid}], data: #MmsBiztalk.InvoiceData<customer: #Ash.NotLoaded<:relationship>, data_in: #Ash.NotLoaded<:relationship>, __meta__: #Ecto.Schema.Metadata<:built, ...>, context: %{bulk_create: %{index: 0}}, valid?: false>, %{batch: [], count: 0, must_return_records?: false}) in Ash.Actions.Create.Bulk.do_run/5
I would expect errors to be "nilled"
28 Replies
tommasop#2001
tommasop#2001OP•2y ago
This is the full error stacktrace:
in Ash.Actions.Create.Bulk.do_run/5
(elixir 1.14.1) lib/stream.ex:989: Stream.do_transform_user/6
(elixir 1.14.1) lib/stream.ex:1811: Enumerable.Stream.do_each/4
(elixir 1.14.1) lib/enum.ex:4307: Enum.reduce/3
(ash 2.9.10) lib/ash/actions/create/bulk.ex:393: Ash.Actions.Create.Bulk.do_run/5
(ash 2.9.10) lib/ash/actions/create/bulk.ex:69: Ash.Actions.Create.Bulk.run/5
(ash 2.9.10) lib/ash/api/api.ex:1878: Ash.Api.bulk_create!/5
(mms_biztalk 0.1.0) lib/mms_biztalk/flows/steps/create_resource.ex:14: MmsBiztalk.Flows.Steps.CreateResource.run/3
(ash 2.9.10) lib/ash/flow/executor/ash_engine.ex:789: anonymous fn/7 in Ash.Flow.Executor.AshEngine.requests/5
(ash 2.9.10) lib/ash/engine/request.ex:1048: Ash.Engine.Request.do_try_resolve_local/4
(ash 2.9.10) lib/ash/engine/request.ex:458: Ash.Engine.Request.store_dependency/4
(ash 2.9.10) lib/ash/engine/request.ex:402: Ash.Engine.Request.send_field/3
(ash 2.9.10) lib/ash/engine/engine.ex:849: Ash.Engine.notify_local_request/4
(ash 2.9.10) lib/ash/engine/engine.ex:466: Ash.Engine.run_iteration/1
(ash 2.9.10) lib/ash/engine/engine.ex:307: Ash.Engine.run_to_completion/1
(ash 2.9.10) lib/ash/engine/engine.ex:252: Ash.Engine.do_run/2
(ash 2.9.10) lib/ash/engine/engine.ex:114: anonymous fn/3 in Ash.Engine.run/2
(ash 2.9.10) lib/ash/data_layer/data_layer.ex:288: Ash.DataLayer.transaction/4
(ash 2.9.10) lib/ash/data_layer/data_layer.ex:273: anonymous fn/5 in Ash.DataLayer.transaction/4
(ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:1203: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
in Ash.Actions.Create.Bulk.do_run/5
(elixir 1.14.1) lib/stream.ex:989: Stream.do_transform_user/6
(elixir 1.14.1) lib/stream.ex:1811: Enumerable.Stream.do_each/4
(elixir 1.14.1) lib/enum.ex:4307: Enum.reduce/3
(ash 2.9.10) lib/ash/actions/create/bulk.ex:393: Ash.Actions.Create.Bulk.do_run/5
(ash 2.9.10) lib/ash/actions/create/bulk.ex:69: Ash.Actions.Create.Bulk.run/5
(ash 2.9.10) lib/ash/api/api.ex:1878: Ash.Api.bulk_create!/5
(mms_biztalk 0.1.0) lib/mms_biztalk/flows/steps/create_resource.ex:14: MmsBiztalk.Flows.Steps.CreateResource.run/3
(ash 2.9.10) lib/ash/flow/executor/ash_engine.ex:789: anonymous fn/7 in Ash.Flow.Executor.AshEngine.requests/5
(ash 2.9.10) lib/ash/engine/request.ex:1048: Ash.Engine.Request.do_try_resolve_local/4
(ash 2.9.10) lib/ash/engine/request.ex:458: Ash.Engine.Request.store_dependency/4
(ash 2.9.10) lib/ash/engine/request.ex:402: Ash.Engine.Request.send_field/3
(ash 2.9.10) lib/ash/engine/engine.ex:849: Ash.Engine.notify_local_request/4
(ash 2.9.10) lib/ash/engine/engine.ex:466: Ash.Engine.run_iteration/1
(ash 2.9.10) lib/ash/engine/engine.ex:307: Ash.Engine.run_to_completion/1
(ash 2.9.10) lib/ash/engine/engine.ex:252: Ash.Engine.do_run/2
(ash 2.9.10) lib/ash/engine/engine.ex:114: anonymous fn/3 in Ash.Engine.run/2
(ash 2.9.10) lib/ash/data_layer/data_layer.ex:288: Ash.DataLayer.transaction/4
(ash 2.9.10) lib/ash/data_layer/data_layer.ex:273: anonymous fn/5 in Ash.DataLayer.transaction/4
(ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:1203: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
edwinofdawn
edwinofdawn•2y ago
Not sure what's going on here . maybe elixir

I'm using bulk create action with upsert and I'm tryong to test that not valid resources will not be created.

I'm using bulk create action with upsert and I'm tryong to test that not valid resources will not be created.
elixir upsert_identity: :unique_esolver_id, `` :unique_esolver_id should be unique_resolver_id`
tommasop#2001
tommasop#2001OP•2y ago
Thanks @edwinofdawn edwin, the problem is that the InvoiceData resource needs a customer_id but I would expect that I can manage those errors in the stream without destroying the bulk action.
tommasop#2001
tommasop#2001OP•2y ago
@core-team spotted this out but I don't know if I'm right or if it is connected with my error: https://github.com/ash-project/ash/blob/13f834ad09d42fa183095cb8cfd90bb2c7853181/lib/ash/actions/create/bulk.ex#L557 shouldn't it be: throw({:error, Ash.Error.to_error_class(changeset.errors), 0, []}) that is to say changeset.errors instead of changeset.error?
GitHub
ash/bulk.ex at 13f834ad09d42fa183095cb8cfd90bb2c7853181 · ash-proje...
A declarative and extensible framework for building Elixir applications. - ash/bulk.ex at 13f834ad09d42fa183095cb8cfd90bb2c7853181 · ash-project/ash
tommasop#2001
tommasop#2001OP•2y ago
Also this condition https://github.com/ash-project/ash/blob/13f834ad09d42fa183095cb8cfd90bb2c7853181/lib/ash/actions/create/bulk.ex#LL556C11-L556C11 if opts[:stop_on_error?] && !opts[:return_stream?] do as stop_on_error? is false by default means that it will always throw if return_stream? is true is this the wanted behavior? Or am I missing something?
GitHub
ash/bulk.ex at 13f834ad09d42fa183095cb8cfd90bb2c7853181 · ash-proje...
A declarative and extensible framework for building Elixir applications. - ash/bulk.ex at 13f834ad09d42fa183095cb8cfd90bb2c7853181 · ash-project/ash
ZachDaniel
ZachDaniel•2y ago
👋 thanks for all the details! There are a few issues w/ errors during bulk actions that have been on my list to resolve, let me take a look at what you've provided so far.
tommasop#2001
tommasop#2001OP•2y ago
you're very welcome bulk actions with upsert are cooooooool and I managed to simplify data import a lot with this new feature. Thanks a lot!
ZachDaniel
ZachDaniel•2y ago
When you mentioned that you provided invalid changesets on purpose, can you show me what you mean?
tommasop#2001
tommasop#2001OP•2y ago
this is the create action
create :create do
argument :data_in_id, :uuid do
allow_nil? false
end

argument :customer_id, :uuid do
allow_nil? false
end

change manage_relationship(:data_in_id, :data_in, type: :append_and_remove)
change manage_relationship(:customer_id, :customer, type: :append_and_remove)
end
create :create do
argument :data_in_id, :uuid do
allow_nil? false
end

argument :customer_id, :uuid do
allow_nil? false
end

change manage_relationship(:data_in_id, :data_in, type: :append_and_remove)
change manage_relationship(:customer_id, :customer, type: :append_and_remove)
end
I send a nil customer_id
ZachDaniel
ZachDaniel•2y ago
but you're sending a map in, not a changeset right?
tommasop#2001
tommasop#2001OP•2y ago
a list of maps with customer_id key set to nil
ZachDaniel
ZachDaniel•2y ago
okay, this should be fixed 🙂 in the latest versions of ash and ash_postgres
tommasop#2001
tommasop#2001OP•2y ago
unfortunately I keep having the same error 😓
ZachDaniel
ZachDaniel•2y ago
Huh. Okay, will look further today. Yeah, I guess your error does actually look different from the errors that other people have been facing @tommasop#2001 can you provide an updated stack traces with the new versions?
tommasop#2001
tommasop#2001OP•2y ago
Of course:
** (FunctionClauseError) no function clause matching in anonymous fn/2 in Ash.Actions.Create.Bulk.do_run/5
.....
Enum.reverse/1
(elixir 1.14.1) lib/enum.ex:3644: Enum.to_list/1
(mms_biztalk 0.1.0) lib/mms_biztalk/flows/steps/create_resource.ex:32: MmsBiztalk.Flows.Steps.CreateResource.run/3
(ash 2.9.11) lib/ash/flow/executor/ash_engine.ex:789: anonymous fn/7 in Ash.Flow.Executor.AshEngine.requests/5
(ash 2.9.11) lib/ash/engine/request.ex:1048: Ash.Engine.Request.do_try_resolve_local/4
(ash 2.9.11) lib/ash/engine/request.ex:458: Ash.Engine.Request.store_dependency/4
(ash 2.9.11) lib/ash/engine/request.ex:402: Ash.Engine.Request.send_field/3
(ash 2.9.11) lib/ash/engine/engine.ex:849: Ash.Engine.notify_local_request/4
(ash 2.9.11) lib/ash/engine/engine.ex:466: Ash.Engine.run_iteration/1
(ash 2.9.11) lib/ash/engine/engine.ex:307: Ash.Engine.run_to_completion/1
(ash 2.9.11) lib/ash/engine/engine.ex:252: Ash.Engine.do_run/2
(ash 2.9.11) lib/ash/engine/engine.ex:114: anonymous fn/3 in Ash.Engine.run/2
(ash 2.9.11) lib/ash/data_layer/data_layer.ex:288: Ash.DataLayer.transaction/4
(ash 2.9.11) lib/ash/data_layer/data_layer.ex:273: anonymous fn/5 in Ash.DataLayer.transaction/4
(ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:1203: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
** (FunctionClauseError) no function clause matching in anonymous fn/2 in Ash.Actions.Create.Bulk.do_run/5
.....
Enum.reverse/1
(elixir 1.14.1) lib/enum.ex:3644: Enum.to_list/1
(mms_biztalk 0.1.0) lib/mms_biztalk/flows/steps/create_resource.ex:32: MmsBiztalk.Flows.Steps.CreateResource.run/3
(ash 2.9.11) lib/ash/flow/executor/ash_engine.ex:789: anonymous fn/7 in Ash.Flow.Executor.AshEngine.requests/5
(ash 2.9.11) lib/ash/engine/request.ex:1048: Ash.Engine.Request.do_try_resolve_local/4
(ash 2.9.11) lib/ash/engine/request.ex:458: Ash.Engine.Request.store_dependency/4
(ash 2.9.11) lib/ash/engine/request.ex:402: Ash.Engine.Request.send_field/3
(ash 2.9.11) lib/ash/engine/engine.ex:849: Ash.Engine.notify_local_request/4
(ash 2.9.11) lib/ash/engine/engine.ex:466: Ash.Engine.run_iteration/1
(ash 2.9.11) lib/ash/engine/engine.ex:307: Ash.Engine.run_to_completion/1
(ash 2.9.11) lib/ash/engine/engine.ex:252: Ash.Engine.do_run/2
(ash 2.9.11) lib/ash/engine/engine.ex:114: anonymous fn/3 in Ash.Engine.run/2
(ash 2.9.11) lib/ash/data_layer/data_layer.ex:288: Ash.DataLayer.transaction/4
(ash 2.9.11) lib/ash/data_layer/data_layer.ex:273: anonymous fn/5 in Ash.DataLayer.transaction/4
(ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:1203: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
here it is let me know if I can help you
ZachDaniel
ZachDaniel•2y ago
thank you 😄 I'm working on a reproduction, will let you know if I have any other questions. Appreciate all the information 🙂 okay this is interesting so I did essentially the same exact thing you did leaving a required attribute as nil well, there are two issues. 1. it let me do that and I got a postgres error instead of a changeset error 2. it didn't get me the error that you have the top of the stacktrace would be better than the bottom in this case 😄 i.e whatever is here: ..... okay I think I found it don't have the issue reproduced yet though but found some suspicious code 🙂 okay, try main of ash 🙂
tommasop#2001
tommasop#2001OP•2y ago
still seeing the same error will post it here
** (Ash.Error.Unknown) Context: resolving data on Transaction :create_or_update_resources

Unknown Error

Context: resolving data on Run custom step :create_resource
* Context: resolving data on Run custom step :create_resource

** (FunctionClauseError) no function clause matching in anonymous fn/2 in Ash.Actions.Create.Bulk.do_run/5
** (Ash.Error.Unknown) Context: resolving data on Transaction :create_or_update_resources

Unknown Error

Context: resolving data on Run custom step :create_resource
* Context: resolving data on Run custom step :create_resource

** (FunctionClauseError) no function clause matching in anonymous fn/2 in Ash.Actions.Create.Bulk.do_run/5
(ash 2.9.11) anonymous fn(#Ash.Changeset<api: MmsBiztalk, action_type: :create, action: :create, attributes: %{amount: 22.75, amount_with_vat: 672.75, bank_code: 0, description:
"Canone di abbonamento per account MASTER X17 - rinnovo di 1 anno", discount: "0.00", document_type: "202", esolver_id: 114513, expense_vat_rate: "NI08", help_desk_id: 30, magic_id: 8
181, operation_type: "I17", paid_amount: 672.75, payment_condition: "ALI", price: 650.0, product_code: "MAGP0.6.2", quantity: "1.0000", registered_at: "2019-12-19", status: :not_synced
, user_esolver_id: 6166, validity_from: "2019-12-26", validity_to: "2020-12-26", vat_rate: "NI08", vat_territoriality: 2}, relationships: %{}, arguments: %{customer_id: nil, data_in_id
: "2c8b19c2-9147-49a0-8ca1-5dfc9d3c6344"}, errors: [%Ash.Error.Changes.Required{field: :customer_id, type: :argument, resource: MmsBiztalk.InvoiceData, changeset: nil, query: nil, erro
r_context: [], vars: [], path: [], stacktrace: #Stacktrace<>, class: :invalid}], data: #MmsBiztalk.InvoiceData<customer: #Ash.NotLoaded<:relationship>, data_in: #Ash.NotLoaded<:relatio
nship>, __meta__: #Ecto.Schema.Metadata<:built, "invoice_datas">, id: nil, registered_at: nil, help_desk_id: nil, esolver_id: nil, user_esolver_id: nil, payment_condition: nil, vat_ter
ritoriality: nil, amount: nil, expense_vat_rate: nil, amount_with_vat: nil, paid_amount: nil, operation_type: nil, product_code: nil, quantity: nil, price: nil, vat_rate: nil, validity
_from: nil, validity_to: nil, bank_code: nil, magic_id: nil, description: nil, document_type: nil, discount: nil, status: nil, inserted_at: nil, updated_at: nil, deleted_at: nil, data_
in_id: nil, customer_id: nil, aggregates: %{}, calculations: %{}, __order__: nil, ...>, context: %{bulk_create: %{index: 0}}, valid?: false>, %{batch: [], count: 0, must_return_records
?: false}) in Ash.Actions.Create.Bulk.do_run/5
(ash 2.9.11) anonymous fn(#Ash.Changeset<api: MmsBiztalk, action_type: :create, action: :create, attributes: %{amount: 22.75, amount_with_vat: 672.75, bank_code: 0, description:
"Canone di abbonamento per account MASTER X17 - rinnovo di 1 anno", discount: "0.00", document_type: "202", esolver_id: 114513, expense_vat_rate: "NI08", help_desk_id: 30, magic_id: 8
181, operation_type: "I17", paid_amount: 672.75, payment_condition: "ALI", price: 650.0, product_code: "MAGP0.6.2", quantity: "1.0000", registered_at: "2019-12-19", status: :not_synced
, user_esolver_id: 6166, validity_from: "2019-12-26", validity_to: "2020-12-26", vat_rate: "NI08", vat_territoriality: 2}, relationships: %{}, arguments: %{customer_id: nil, data_in_id
: "2c8b19c2-9147-49a0-8ca1-5dfc9d3c6344"}, errors: [%Ash.Error.Changes.Required{field: :customer_id, type: :argument, resource: MmsBiztalk.InvoiceData, changeset: nil, query: nil, erro
r_context: [], vars: [], path: [], stacktrace: #Stacktrace<>, class: :invalid}], data: #MmsBiztalk.InvoiceData<customer: #Ash.NotLoaded<:relationship>, data_in: #Ash.NotLoaded<:relatio
nship>, __meta__: #Ecto.Schema.Metadata<:built, "invoice_datas">, id: nil, registered_at: nil, help_desk_id: nil, esolver_id: nil, user_esolver_id: nil, payment_condition: nil, vat_ter
ritoriality: nil, amount: nil, expense_vat_rate: nil, amount_with_vat: nil, paid_amount: nil, operation_type: nil, product_code: nil, quantity: nil, price: nil, vat_rate: nil, validity
_from: nil, validity_to: nil, bank_code: nil, magic_id: nil, description: nil, document_type: nil, discount: nil, status: nil, inserted_at: nil, updated_at: nil, deleted_at: nil, data_
in_id: nil, customer_id: nil, aggregates: %{}, calculations: %{}, __order__: nil, ...>, context: %{bulk_create: %{index: 0}}, valid?: false>, %{batch: [], count: 0, must_return_records
?: false}) in Ash.Actions.Create.Bulk.do_run/5
(elixir 1.14.1) lib/stream.ex:989: Stream.do_transform_user/6
(elixir 1.14.1) lib/stream.ex:1811: Enumerable.Stream.do_each/4
(elixir 1.14.1) lib/stream.ex:942: Stream.do_transform/5
(elixir 1.14.1) lib/stream.ex:1811: Enumerable.Stream.do_each/4
(elixir 1.14.1) lib/enum.ex:4307: Enum.reverse/1
(elixir 1.14.1) lib/enum.ex:3644: Enum.to_list/1
(mms_biztalk 0.1.0) lib/mms_biztalk/flows/steps/create_resource.ex:32: MmsBiztalk.Flows.Steps.CreateResource.run/3
(ash 2.9.11) lib/ash/flow/executor/ash_engine.ex:789: anonymous fn/7 in Ash.Flow.Executor.AshEngine.requests/5
(ash 2.9.11) lib/ash/engine/request.ex:1048: Ash.Engine.Request.do_try_resolve_local/4
(ash 2.9.11) lib/ash/engine/request.ex:458: Ash.Engine.Request.store_dependency/4
(ash 2.9.11) lib/ash/engine/request.ex:402: Ash.Engine.Request.send_field/3
(ash 2.9.11) lib/ash/engine/engine.ex:849: Ash.Engine.notify_local_request/4
(ash 2.9.11) lib/ash/engine/engine.ex:466: Ash.Engine.run_iteration/1
(ash 2.9.11) lib/ash/engine/engine.ex:307: Ash.Engine.run_to_completion/1
(ash 2.9.11) lib/ash/engine/engine.ex:252: Ash.Engine.do_run/2
(ash 2.9.11) lib/ash/engine/engine.ex:114: anonymous fn/3 in Ash.Engine.run/2
(ash 2.9.11) lib/ash/data_layer/data_layer.ex:288: Ash.DataLayer.transaction/4
(ash 2.9.11) lib/ash/data_layer/data_layer.ex:273: anonymous fn/5 in Ash.DataLayer.transaction/4
(ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:1203: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
(elixir 1.14.1) lib/stream.ex:989: Stream.do_transform_user/6
(elixir 1.14.1) lib/stream.ex:1811: Enumerable.Stream.do_each/4
(elixir 1.14.1) lib/stream.ex:942: Stream.do_transform/5
(elixir 1.14.1) lib/stream.ex:1811: Enumerable.Stream.do_each/4
(elixir 1.14.1) lib/enum.ex:4307: Enum.reverse/1
(elixir 1.14.1) lib/enum.ex:3644: Enum.to_list/1
(mms_biztalk 0.1.0) lib/mms_biztalk/flows/steps/create_resource.ex:32: MmsBiztalk.Flows.Steps.CreateResource.run/3
(ash 2.9.11) lib/ash/flow/executor/ash_engine.ex:789: anonymous fn/7 in Ash.Flow.Executor.AshEngine.requests/5
(ash 2.9.11) lib/ash/engine/request.ex:1048: Ash.Engine.Request.do_try_resolve_local/4
(ash 2.9.11) lib/ash/engine/request.ex:458: Ash.Engine.Request.store_dependency/4
(ash 2.9.11) lib/ash/engine/request.ex:402: Ash.Engine.Request.send_field/3
(ash 2.9.11) lib/ash/engine/engine.ex:849: Ash.Engine.notify_local_request/4
(ash 2.9.11) lib/ash/engine/engine.ex:466: Ash.Engine.run_iteration/1
(ash 2.9.11) lib/ash/engine/engine.ex:307: Ash.Engine.run_to_completion/1
(ash 2.9.11) lib/ash/engine/engine.ex:252: Ash.Engine.do_run/2
(ash 2.9.11) lib/ash/engine/engine.ex:114: anonymous fn/3 in Ash.Engine.run/2
(ash 2.9.11) lib/ash/data_layer/data_layer.ex:288: Ash.DataLayer.transaction/4
(ash 2.9.11) lib/ash/data_layer/data_layer.ex:273: anonymous fn/5 in Ash.DataLayer.transaction/4
(ecto_sql 3.10.1) lib/ecto/adapters/sql.ex:1203: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
ZachDaniel
ZachDaniel•2y ago
and just to confirm you definitely updated both ash and ash_postgres to the latest main using mix deps.update ash ash_postgres?
tommasop#2001
tommasop#2001OP•2y ago
only updated ash not ash_postgres sssssorry
ZachDaniel
ZachDaniel•2y ago
that probably won't fix it so thats no problem updating ash was likely enough but lets just be sure and update ash_postgres too 😄 strange that there is no ash line/line number in that stacktrace you sent just now oh, there hasn't been this whole time I was using the wrong number when investigating
tommasop#2001
tommasop#2001OP•2y ago
confirmed updating also ash_postgres doesn't solve the problem
ZachDaniel
ZachDaniel•2y ago
So the only real lead we have is: in Ash.Actions.Create.Bulk.do_run/5 there is no line number that you can see that points at a line in an ash file?
tommasop#2001
tommasop#2001OP•2y ago
no, the first one is that in ash_engine 789
ZachDaniel
ZachDaniel•2y ago
found it okay, try main of ash 🙂
tommasop#2001
tommasop#2001OP•2y ago
WOHOOO solved thanks!
ZachDaniel
ZachDaniel•2y ago
🥳 thanks for bearing with me 😆
tommasop#2001
tommasop#2001OP•2y ago
no thank YOU for bearing with my specific problem really appreciate your support
ZachDaniel
ZachDaniel•2y ago
My pleasure 🙂

Did you find this page helpful?