question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hitting eventsourcing.exceptions.EventHashError

See original GitHub issue

Hi there, I’m currently playing around with the library and I’m hitting the following run time error when running two commands in a row and then attempting to look up the aggregate root id within app.repository:

python3.7/site-packages/eventsourcing/domain/model/events.py", line 139, in check_hash raise EventHashError() eventsourcing.exceptions.EventHashError

The code is available here https://github.com/AlanFoster/eventsourcing and the error is reproducible with:

pipenv shell
pipenv install
pipenv run python main.py

From what I can tell this might be a bug within the library, but I’m not sure just yet! I’d be keen to know your thoughts 👍

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AlanFostercommented, May 31, 2019

Thank you for looking into this! That’s helped clear up everything for me, thanks very much 👍

0reactions
johnbywatercommented, May 30, 2019

One more thing to watch out for, something which I feel is slightly deficient: if you use integer values for dict keys, as you do in your program, then you should be aware that they get converted to strings by JSON (at least the JSON module used by the library at the moment, which is the core Python json implementation) so when you look at a domain event object that has been reconstructed from a serialised record, then it can have string dict keys instead of integer dict keys. Then if you use these keys in a mutator to set values on an aggregate, and later try get values with integer keys, the value will appear to be missing. If you want to avoid this, then either make sure you just don’t use integer dict keys in the domain events, or make sure than you defensively convert to integers in the mutator. I’ve got no idea why the json module works this way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eventsourcing Documentation
This is a library for event sourcing in Python. At its core, this library supports storing and retrieving sequences of.
Read more >
Handling exceptions | laravel-event-sourcing - Spatie
The event-sourcing config file has a key, catch_exceptions , that determines what will happen should a projector or reactor throw an exception.
Read more >
laravel-event-sourcing/handling-exceptions.md at main - GitHub
The event-sourcing config file has a key, catch_exceptions , that determines what will happen should a projector or reactor throw an exception.
Read more >
Event Sourcing in .NET - Dealing with projection exceptions
It is based on the idea that every event will be processed by all projectors in a synchronous manner. As we use a...
Read more >
Some CQRS and Event Sourcing Pitfalls
However, in the synchronous case, if the projection of an event causes an exception (e.g., because of hitting a database unique constraint), this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found