Stream with MaxAge set, produces error on re-connect

We have started using the max age for a stream in our store to roll events off after a specified time period (for testing purposes a minute). Creating the stream and setting the metadata works great on the first run. We can pump data in, see events populate, etc.

If I disconnect from the event store and reconnect, I start seeing these messages in the in the EventStore logs:

Error while wrapping message EventStore.Core.Messages.ClientMessage+ReadAllEventsForwardComepleted

Object reference not set to an instance of an object

The reconnect is successful. Once I started adding new events into the system and I subscribe to the AllEvents stream, we start to see more errors

[08276,56,17:21:59.836] Error while processing message ReadStreamEventsBackward

InternalCorrId: 33de209a-ff67-4f56-9f86-1d87a7bbeced, CorrelationId: 33de209a-ff

67-4f56-9f86-1d87a7bbeced, EventStreamId: $streams, FromEventNumber: -1, MaxCoun

t: 50, ResolveLinkTos: True, RequireMaster: False, ValidationStreamVersion: 4 in

queued handler ‘StorageReaderQueue #1’.

link not in proper format.

The subscriptions don’t work, and the UI won’t even display existing streams. A start and restart of Event Store does not fix the issue, the only way I have solved the problem is to DELETE all the data and start over. It appears that all the Read Stream events, connections, etc. work as they return successful or not in a faulted state, (or at least I have not an error state yet).

If I remove the SetMetaData code, connect and reconnect work great. I can stop and start at will, subscriptions work as planned, etc. It is only when we set the metadata for a stream.

—Mickey Keenan—

Can you provide a test case that shows what you are seeing?

I think I have it somewhat isolated and it appears to be more a UI issue than a subscription issue, so it is probably not a huge concern. Using the attached project, after you start up your ES Cluster, start the application (events will start appending). Start up Projections, you should start seeing errors in the ES Console. Most of the time, the Subscription picks back up, but on occasion it takes a cycle to restart, but it appears to always work now, just not on the first try sometimes.

Let me know if this helps. As I said, it looks like the UI and projections are throwing the error when you try and check the stream (I wanted to make sure the events were dropping off according to the TimeSpan). And that appears to be working, so the bug is not as I expected.

EventStore.zip (688 KB)

Mickey,

Can you try pulling the latest UI down from the EventStore/EventStore.UI repository - you can run it from the file system if necessary (npm install - gulp html) - I think this may already be fixed.

Cheers,

James