qhwa

qhwa

Commanded framework, how to recover from {:error, :wrong_expected_version}

I have an application with these Commanded related packages installed,

$mix hex.outdated | grep commanded

commanded                     1.2.0    1.2.0                    
commanded_ecto_projections    1.2.0    1.2.0                    
commanded_eventstore_adapter  1.2.0    1.2.0

Everything worked fine but recently I found a lot of errors like:

Failed to append events to stream "new-quest-xxxxxx:yyyy:20201005004" due to: :wrong_expected_version

and

duplicate key value violates unique constraint \"ix_stream_events\"

I checked the document but still have no idea why it appears and therefore how to recover from it.

Any advice would be appreciated, thanks!

@slashdotdash Do you have any guidance on troubleshooting this issue? Do I need to check something specific?

First Post!

slashdotdash

slashdotdash

Are you using :any_version as the expected version argument? There was an issue I fixed (#209) which sounds very similar. That hasn’t yet been released to Hex, but it will be soon!

Last Post!

qhwa

qhwa

Thank you for the update and sorry for the delay in response, @slashdotdash !

Where can I get this configuration?

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 131117 1222
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

We're in Beta

About us Mission Statement