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

system crash when checkout multiple products #87

Open
toreal opened this issue Aug 18, 2017 · 0 comments
Open

system crash when checkout multiple products #87

toreal opened this issue Aug 18, 2017 · 0 comments

Comments

@toreal
Copy link

toreal commented Aug 18, 2017

The error messages is as following.

look like MapSet has duplicate keys.

Parameters: %{}
15:36:14.367 [info] Replied cart:1 :ok
15:36:17.178 request_id=prhal3stab9270g36cpl80v9ibjl97o4 [info] POST /checkout/next
15:36:17.187 request_id=prhal3stab9270g36cpl80v9ibjl97o4 [info] Sent 500 in 0繕s
15:36:17.188 [error] #PID<0.636.0> running Nectar.Endpoint terminated
Server: localhost:443 (https)
Request: POST /checkout/next
** (exit) an exception was raised:
** (ArgumentError) error when merging the following Ecto.Multi structs:

%Ecto.Multi{names: #MapSet<[:variant_acquire_stock]>, operations: [variant_acquire_stock: {:changeset, #Ecto.Changeset<action: :update, changes: %{bought_quantity: 1, buy_count: 1}, errors: [], data: #Nectar.Variant<>, valid?: true>, []}]}

%Ecto.Multi{names: #MapSet<[:variant_acquire_stock]>, operations: [variant_acquire_stock: {:changeset, #Ecto.Changeset<action: :update, changes: %{bought_quantity: 1, buy_count: 1}, errors: [], data: #Nectar.Variant<>, valid?: true>, []}]}

both declared operations: [:variant_acquire_stock]

    (ecto) lib/ecto/multi.ex:171: Ecto.Multi.do_merge/3
    (elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
    (nectar) web/workflows/checkout/payment.ex:39: Nectar.Workflow.Checkout.Payment.post_transition/3
    (ecto) lib/ecto/multi.ex:386: Ecto.Multi.apply_operation/5
    (elixir) lib/enum.ex:1755: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ecto) lib/ecto/multi.ex:376: anonymous fn/5 in Ecto.Multi.apply_operations/5
    (ecto) lib/ecto/adapters/sql.ex:508: anonymous fn/3 in Ecto.Adapters.SQL.do_transaction/3
    (db_connection) lib/db_connection.ex:1275: DBConnection.transaction_run/4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant