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.

Subscribing to a stream containing links to deleted events crashes StreamSubscriptionActor

See original GitHub issue

When subscribing with resolveLinkTos=true to a stream that contains event links to events that have been deleted, the StreamSubscriptionActor will terminate with an IllegalArgumentException when the event in question is parsed from the protobuf.

Exception text:

ERROR eventstore.StreamSubscriptionActor - eventstore.CommandNotExpectedException: Expected: ReadStreamEventsCompleted, actual: java.lang.IllegalArgumentException: requirement failed: streamId must not be empty

I can reliably reproduce the exception by writing an event of type “TestType” to a random stream in an ES instance with projections enabled, then deleting said stream and subscribing to “$et-TestType”.

The problem seems to be that EventStore, upon encountering an unresolvable event, will create a ResolvedEvent instance as shown below (excerpt from EventStore.Core/Data/ResolvedEvent.cs):

public static ResolvedEvent ForFailedResolvedLink(EventRecord link, ReadEventResult resolveResult, long? commitPosition = null)
        {
            return new ResolvedEvent(null, link, commitPosition, resolveResult);
        }

The JVM client does not handle this case and just crashes when it encounters a ResolvedEvent that does not, in fact, contain a resolved event.

I would expect the subscription actor to simply ignore any events that are “unresolvable because deleted”, at least when resolveLinkTos is enabled.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Konfuzzyuscommented, May 31, 2016

Verified to work on our system. Thanks for the quick resolution.

0reactions
t3hnarcommented, May 30, 2016

Fixed in v2.2.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Event Store - Filter out any deleted streams from projections
When subscribing to streams, which contain links, like category streams, you need to set resolveLinkTos to true . If you, however, subscribe to ......
Read more >
Event streams - EventStoreDB Documentation
When a stream is soft-deleted, all events from the stream get scavenged during the next scavenging run. It means that you can reopen...
Read more >
cdc-debezium-source-kafka crashes at incoming delete event #6
When deleting a row the source crashes. Steps to reproduce (what i did): Build the cdc-debezium-source-kafka-jar according to the readme (tested on newest ......
Read more >
If you deleted iCloud calendars or events from Mac
If you accidentally deleted iCloud calendars or events, you can use iCloud.com to restore them, together with your reminders, from an earlier version...
Read more >
EventStore.delete_stream - HexDocs
A soft deleted stream cannot be read nor appended to. Subscriptions to the deleted stream will not receive any events but subscriptions containing...
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