Ghost event

I’ve just had the strangest experience with the db.

I’ve had an aggregate created with a deterministic guid (read that the algo doesn’t produce real guids though, but it’s always worked fine with ES). The guid was based on the same string every time. As the streams first event’s EventData instance was created, it got the aggregate id as id by accident. So this was my error that eluded me.

As result the event had one id in it’s data, and another in the EventData instance, as it was fed the (deterministic) guid id of the stream.

So, what happened?

A ghost event was appended to the stream. The same event every time. It had a time stamp of 9 days ago (always the exact same time), same id (not related to the ones I had generated above). And even more strange: as aggregate clr headers, and event clr headers, it was the name, not of the event being appended, but of namespaces that I used before (around 9 days ago), but not part of the current solution. I searched every reference in the solution, 100% not present. I changed name of the event. But it was the ghost event that was appended.

This ghost event came back every time, and I deleted the database every time, changed db directory, restarted the computer. Made sure there was one and only one db on the disk, one and only one instance of ES running. The only thing I didn’t do was reinstall ES.

So, the reason there was a problem was my error mentioned above. But the nature of this error was very strange to me. How is ES built? voodoo? :smiley:

ES knows nothing of your data its vector<byte> as far as its
concerned, it doesn't know namespaces etc. My guess is there is an
error in measurement somewhere.

Ah, I forgot to mention on of the most important parts: The real event was there in db, because it was picked up by a subscription to all stream.

It was in the browser ui that this ghost event appeared. Events of other types appended after that lost properties: also in the ui only.

Yeah I know it doesn’t know namepsaces, the metadata is converted to bytes. What I meant to say is that it’s strange that the data - so evidently not part of what I was feeding the db with - was suddenly there.

So, some caching error in chrome maybe? Just never seen that before. When I reloaded the UI after deleting, it was empty. It showed other streams correctly (where I hadn’t made that id mistake).

Yes there is caching see:

-DisableHTTPCaching

Try clearing cache.

In development you likely do not want caching but in production you do.

Cheers,

Greg

Ahh, thnx. :slight_smile:

Just to be sure:

Do I start the es instance with --DisableHTTPCaching as parameter? Could get it to start with that.

http://docs.geteventstore.com/server/3.3.0/command-line-arguments/

-DisableHTTPCaching

--disable-http-caching

I don’t get it…

When there is no db, starting with --disable-http-caching=false/true doesn’t work. When there is a db, starting with --disable-http-caching=false works, but not --disable-http-caching=true.

What’s the logic? What should I do to start it with caching disabled?

ah no, setting it to false wasn’t working either.
trying all sorts of combinations. I must be really stupid but it won’t work.

without your version its hard to say. --help helps a lot.

I’m curious as to how you are testing and validating that the flag doesn’t work.
If you can give us some curls, that might help to determine if the Cache Control header is incorrect. For instance, using the latest release 3.3.0 here are my results.

As noted in the docs, the head will by default no be cached.

Herewith my test results.

PS C:\EventStore-OSS-Win-v3.3.0> .\EventStore.ClusterNode.exe --disable-http-caching=false
[09968,01,05:27:29.622]

ES VERSION: 3.3.0.0 (release-v3.3.0/4923f4c0f427a85a275f362402e62645bca38c07, Wed, 7 Oct 2015 07:37:39 +0200)

OS: Windows (Microsoft Windows NT 6.2.9200.0)

RUNTIME: .NET 4.0.30319.42000 (64-bit)

GC: 3 GENERATIONS

LOGS: C:\EventStore-OSS-Win-v3.3.0\logs

MODIFIED OPTIONS:

    DISABLE HTTP CACHING:     false (Command Line)

curl -i http://localhost:2113/streams/accounts/0/forward/20

HTTP/1.1 200 OK

Cache-Control: max-age=31536000, public

Content-Length: 7505

Content-Type: application/atom+xml; charset=utf-8

PS C:\EventStore-OSS-Win-v3.3.0> .\EventStore.ClusterNode.exe --disable-http-caching=true

[07436,01,05:30:43.433]

ES VERSION: 3.3.0.0 (release-v3.3.0/4923f4c0f427a85a275f362402e62645bca38c07, Wed, 7 Oct 2015 07:37:39 +0200)

OS: Windows (Microsoft Windows NT 6.2.9200.0)

RUNTIME: .NET 4.0.30319.42000 (64-bit)

GC: 3 GENERATIONS

LOGS: C:\EventStore-OSS-Win-v3.3.0\logs

MODIFIED OPTIONS:

    DISABLE HTTP CACHING:     true (Command Line)

curl -i http://localhost:2113/streams/accounts/0/forward/20

HTTP/1.1 200 OK

Cache-Control: max-age=0, no-cache, must-revalidate

Content-Length: 7505

Content-Type: application/atom+xml; charset=utf-8

.

``

I’m sorry guys, I’ve not been clear. Gosh I hate when people just say “It won’t work” without proper background, and now I did it myself :stuck_out_tongue:

EventStore simply won’t start with that parameter.

Cmdline:

C:\DevPrograms\EventStore-OSS-Win-v3.2.2>EventStore.ClusterNode.exe --disable-http-caching=true

``

This gives me the documentation over command line arguments, but no ES starting.

try --help it lists the arguments I forget exactly when it changed
(version wise) without looking at the release notes.

3.3.0 has the --disable-http-caching flag and was part of the following PR https://github.com/EventStore/EventStore/issues/706
Before 3.3.0 disable http caching was part of the --development-mode flag. Setting this flag to true would disable http caching too.