Giter Site home page Giter Site logo

eventstore / eventstore Goto Github PK

View Code? Open in Web Editor NEW
5.2K 5.2K 637.0 316.93 MB

EventStoreDB, the event-native database. Designed for Event Sourcing, Event-Driven, and Microservices architectures

Home Page: https://eventstore.com

License: Other

Shell 0.12% C# 99.59% PowerShell 0.03% HTML 0.01% JavaScript 0.21% Batchfile 0.01% Dockerfile 0.03% Smalltalk 0.01%
cqrs database event-sourcing event-store eventsourcing eventstore

eventstore's Introduction

EventStoreDB

EventStoreDB is the event-native database, where business events are immutably stored and streamed. Designed for event-sourced, event-driven, and microservices architectures

What is EventStoreDB

EventStoreDB is a new category of operational database that has evolved from the Event Sourcing community. Powered by the state-transition data model, events are stored with the context of why they have happened. Providing flexible, real-time data insights in the language your business understands.

Download the latest version. For more product information visit the website.

What is Event Store Cloud?

Event Store Cloud is a fully managed cloud offering that's designed to make it easy for developers to build and run highly available and secure applications that incorporate EventStoreDB without having to worry about managing the underlying infrastructure. You can provision EventStoreDB clusters in AWS, Azure, and GCP, and connect these services securely to your own cloud resources.

For more details visit the website.

Licensing

View Event Store Ltd's licensing information.

Docs

For guidance on installation, development, deployment, and administration, see the User Documentation.

Getting started with EventStoreDB

Follow the getting started guide.

Getting started with Event Store Cloud

Event Store can manage EventStoreDB for you, so you don't have to run your own clusters. See the online documentation: Getting started with Event Store Cloud.

Client libraries

This guide shows you how to get started with EventStoreDB by setting up an instance or cluster and configuring it. EventStoreDB supports two protocols: gRPC and TCP(legacy).

EventStoreDB supported gRPC clients

Community supported gRPC clients

Read more in the documentation.

Legacy TCP Clients (support ends with 23.10 LTS)

Deployment

Communities

Contributing

Development is done on the master branch. We attempt to do our best to ensure that the history remains clean and to do so, we generally ask contributors to squash their commits into a set or single logical commit.

If you want to switch to a particular release, you can check out the release branch for that particular release. For example:
git checkout release/oss-v22.10

Building EventStoreDB

EventStoreDB is written in a mixture of C# and JavaScript. It can run on Windows, Linux and macOS (using Docker) using the .NET Core runtime.

Prerequisites

Once you've installed the prerequisites for your system, you can launch a Release build of EventStore as follows:

dotnet build -c Release src

The build scripts: build.sh and build.ps1 are also available for Linux and Windows respectively to simplify the build process.

To start a single node, you can then run:

dotnet ./src/EventStore.ClusterNode/bin/x64/Release/net8.0/EventStore.ClusterNode.dll --dev --db ./tmp/data --index ./tmp/index --log ./tmp/log

Running the tests

You can launch the tests as follows:

dotnet test src/EventStore.sln

Build EventStoreDB Docker image

You can also build a Docker image by running the command:

docker build --tag myeventstore . \
--build-arg CONTAINER_RUNTIME={container-runtime}
--build-arg RUNTIME={runtime}

For instance:

docker build --tag myeventstore . \
--build-arg CONTAINER_RUNTIME=bookworm-slim \
--build-arg RUNTIME=linux-x64

Note: Because of the Docker issue, if you're building a Docker image on Windows, you may need to set the DOCKER_BUILDKIT=0 environment variable. For instance, running in PowerShell:

$env:DOCKER_BUILDKIT=0; docker build --tag myeventstore . `
--build-arg CONTAINER_RUNTIME=bookworm-slim `
--build-arg RUNTIME=linux-x64

Currently, we support the following configurations:

  1. Bookworm slim:
  • CONTAINER_RUNTIME=bookworm-slim
  • RUNTIME=linux-x64
  1. Jammy:
  • CONTAINER_RUNTIME=Jammy
  • RUNTIME=linux-x64
  1. Alpine:
  • CONTAINER_RUNTIME=alpine
  • RUNTIME=linux-musl-x64

You can verify the built image by running:

docker run --rm myeventstore --insecure --what-if

Need help?

eventstore's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eventstore's Issues

projection faulted due to 'js1'

Hi,

I'm running the ES 2.0.1.0 on Mono 3.2.7 on top of OSX 10.8.5. When I run the example query, I get the following message:

The projection faulted due to 'js1'

In the error log, I can see the following stacktrace:

System.DllNotFoundException: js1
at (wrapper managed-to-native) EventStore.Projections.Core.v8.Js1:CompilePrelude (string,string,EventStore.Projections.Core.v8.Js1/LoadModuleDelegate,EventStore.Projections.C
ore.v8.Js1/EnterCancellableRegionDelegate,EventStore.Projections.Core.v8.Js1/ExitCancellableRegionDelegate,EventStore.Projections.Core.v8.Js1/LogDelegate)
at EventStore.Projections.Core.v8.PreludeScript.CompileScript (System.String script, System.String fileName) [0x00000] in :0
at EventStore.Projections.Core.v8.PreludeScript..ctor (System.String script, System.String fileName, System.Func2 getModuleSourceAndFileName, System.Action2 cancelCallbackF
actory, System.Action1 logger) [0x00000] in <filename unknown>:0 at EventStore.Projections.Core.Services.v8.V8ProjectionStateHandler..ctor (System.String preludeName, System.String querySource, System.Func2 getModuleSource, System.Action 1 logger, System.Action2 cancelCallbackFactory) [0x00000] in :0
at EventStore.Projections.Core.Services.v8.DefaultV8ProjectionStateHandler..ctor (System.String query, System.Action1 logger, System.Action2 cancelCallbackFactory) [0x00000
] in :0
at EventStore.Projections.Core.Services.Management.ProjectionStateHandlerFactory.Create (System.String factoryType, System.String source, System.Action2 cancelCallbackFactor y, System.Action1 logger) [0x00000] in :0
at EventStore.Projections.Core.Services.Management.ManagedProjection+c__AnonStoreyE.<>m__16 () [0x00000] in :0

Google is speechless wrt this error message. Any hints would be greatly appreciated

poohsen

Cannot build on Ubuntu 12.04

I am getting this failure when trying to build EventStore in Ubuntu 12.04. Any pointers would be appreciated. I expect it is something simple that someone with more Linux experience will intuit to immediately.

ubuntu@localdev:~/github/EventStore/EventStore$ ./build.sh full
Action set to: full
Platform defaulted to: x64
Configuration defaulted to: release
Version defaulted to: 0.0.0.0
Running from base directory: /home/ubuntu/github/EventStore/EventStore
V8 repository already at revision 18454
Running make dependencies
make: *** No rule to make target `dependencies'. Stop.
FAILED. See earlier messages

These are the versions of the things mentioned required to build EventStore:
ubuntu@localdev:~/github/EventStore/EventStore$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise

ubuntu@localdev:~/github/EventStore/EventStore$ mono --version
Mono JIT compiler version 3.2.7 (master/28163fd Mon Jan 27 23:38:28 CST 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

ubuntu@localdev:~/github/EventStore/EventStore$ svn --version
svn, version 1.6.17 (r1128011)

ubuntu@localdev:~/github/EventStore/EventStore$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Creating a projection with a name of a deleted projections is not possible. Why?

Hi, today I am testing projections creation. So that I am doing some create/delete in my TDD cycle.

I have found that if I create a projection with name "test_projection" and I delete it then I am not able to re-create another projection (maybe later in time) with the name "test_projection".

Why is this happening? Is a projection name usable once in a lifetime?

Cheers,

Mirko

Object disposed exception while Flush

I get this error after some time running perfectly in production:

[PID:2604 2013.03.11 23:53:15.519 Error QueuedHandlerMRES 17]
Error while processing message EventStore.Core.Messages.StorageMessage+WritePrepares in queued handler 'StorageWriterQueue'.
System.ObjectDisposedException: Cannot access a closed file.
   at System.IO.FileStream.Flush(Boolean flushToDisk)
   at EventStore.Core.TransactionLog.Chunks.TFChunkWriter.Flush() in c:\Development\GitHub\EventStore\src\EventStore\EventStore.Core\TransactionLog\Chunks\TFChunkWriter.cs:line 127
   at EventStore.Core.Services.Storage.StorageWriterService.Flush() in c:\Development\GitHub\EventStore\src\EventStore\EventStore.Core\Services\Storage\StorageWriterService.cs:line 463
   at EventStore.Core.Services.Storage.StorageWriterService.EventStore.Core.Bus.IHandle<EventStore.Core.Messages.StorageMessage.WritePrepares>.Handle(WritePrepares message) in c:\Development\GitHub\EventStore\src\EventStore\EventStore.Core\Services\Storage\StorageWriterService.cs:line 198
   at EventStore.Core.Bus.MessageHandler`1.TryHandle(Message message) in c:\Development\GitHub\EventStore\src\EventStore\EventStore.Core\Bus\MessageHandler.cs:line 60
   at EventStore.Core.Bus.InMemoryBus.PublishByType(Message message, Type type) in c:\Development\GitHub\EventStore\src\EventStore\EventStore.Core\Bus\InMemoryBus.cs:line 133
   at EventStore.Core.Bus.InMemoryBus.DispatchByType(Message message) in c:\Development\GitHub\EventStore\src\EventStore\EventStore.Core\Bus\InMemoryBus.cs:line 105
   at EventStore.Core.Bus.QueuedHandlerMRES.ReadFromQueue(Object o) in c:\Development\GitHub\EventStore\src\EventStore\EventStore.Core\Bus\QueuedHandlerMRES.cs:line 136

Once its started, every other write operation fails with the same error.

Server (default configuration) crashes on default query run

  1. Run ES
  2. go to query page
  3. pres run.

It is stated in query comment that it should stop immediately. I guess queries should not crash a database :)

System:
Dev branch: 23be912
Mono JIT compiler version (EventStore patched build: ThreadPool.c) 3.0.12 ((no/d6c5db8 Thu Aug 8 23:36:41 EEST 2013) (EventStore build)

Log:
[03162,12,17:31:48.127] Creating an event distribution point at 'C:0/P:-1'
[03162,12,17:31:48.127] The 'aaad05f6-4f51-4f25-aef2-c70622e7aff8' projection subscribed to the '8fbd94a5-06cb-461a-bafd-8901cb5f845c' distribution point
[03162,12,17:31:48.218] SLOW BUS MSG [bus]: UnwrapEnvelopeMessage - 79ms. Handler: UnwrapEnvelopeHandler.
[03162,12,17:31:48.218] SLOW QUEUE MSG [Projection Core #0]: UnwrapEnvelopeMessage - 80ms. Q: 63/127.
[03162,12,17:31:48.249] The '0ec80c3c-e6b1-4f9e-8e25-912074a2d41d' subscription has unsubscribed (reader: ab8858db-4120-43f4-9bcc-f87b3f90491a)
[03162,12,17:31:48.250] The 'd61104f6-4a7a-45e7-9e5a-fd2d5c822858' subscription has unsubscribed (reader: 121b6f00-5415-40a5-932b-a52fa70d2ee7)
[03162,12,17:31:48.250] The 'ae6e64dd-f990-426b-9c37-6355fcd87133' subscription has unsubscribed (reader: cc0f9cf1-49f8-4e6f-b528-139d6265ee73)
[03162,12,17:31:48.250] The 'aaad05f6-4f51-4f25-aef2-c70622e7aff8' subscription has unsubscribed (reader: 8fbd94a5-06cb-461a-bafd-8901cb5f845c)
[03162,10,17:31:48.311] Created stats stream '$stats-127.0.0.1:2113', code = WrongExpectedVersion
[03162,06,17:31:54.581] Replying 404 for ==> /home/pi/d/EventStore/bin/eventstore/release/anycpu/singlenode-web
mono-sgen: symbol lookup error: /home/pi/d/EventStore/bin/eventstore/release/anycpu/libjs1.so: undefined symbol: _ZN2v82V818GlobalizeReferenceEPNS_8internal7IsolateEPPNS1_6ObjectE

can't build esquery on lubuntu mono mcs 3.0.12 and 3.2.3

both are outputting

/opt/mono/lib/mono/4.0/Microsoft.CSharp.targets (CoreCompile target) ->

    Program.cs(83,28): error CS1502: The best overloaded method match for `System.Net.NetworkCredential.NetworkCredential(string, string)' has some invalid arguments
    Program.cs(83,60): error CS1503: Argument `#2' cannot convert `System.Security.SecureString' expression to type `string'

seems like this is a recent commit.

Idempotency problem on the HTTP API with numeric StreamId

I am trying to understand idempotency of Event Store, so I am doing some tests such the one expressed in the tutorial;

[
  {
    "eventId": "fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4",
    "eventType": "event-type",
    "data": { "a": "1" }
  }
]

I try for the first time:

curl -i -d @test.js "http://192.168.56.20:2113/streams/newstream" -H "Content-Type:application/json"
HTTP/1.1 201 Created
Access-Control-Allow-Methods: POST, DELETE, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
Access-Control-Allow-Origin: *
Location: http://192.168.56.20:2113/streams/newstream/0
Content-Type: text/plain; charset: utf-8
Server: Mono-HTTPAPI/1.0
Date: Tue, 04 Mar 2014 16:30:41 GMT
Content-Length: 0
Keep-Alive: timeout=15,max=100

And for the second time:

curl -i -d @prova.js "http://192.168.56.20:2113/streams/newstream" -H "Content-Type:application/json"
HTTP/1.1 201 Created
Access-Control-Allow-Methods: POST, DELETE, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
Access-Control-Allow-Origin: *
Location: http://192.168.56.20:2113/streams/newstream/0
Content-Type: text/plain; charset: utf-8
Server: Mono-HTTPAPI/1.0
Date: Tue, 04 Mar 2014 16:30:41 GMT
Content-Length: 0
Keep-Alive: timeout=15,max=100

As you can see the Location Header is giving me the event url with the number 0. So it is not writing 2 times and the API is idempotent.

Now lets do it with another StreamId. Since I want to create 1 stream per aggregate I want to use the aggregateId (a MongoId in my case).

Let do the first call:

curl -i -d @prova.js "http://192.168.56.20:2113/streams/5315f65302536d8758000012" -H "Content-Type:application/json"
HTTP/1.1 201 Created
Access-Control-Allow-Methods: POST, DELETE, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
Access-Control-Allow-Origin: *
Location: http://192.168.56.20:2113/streams/5315f65302536d8758000012/0
Content-Type: text/plain; charset: utf-8
Server: Mono-HTTPAPI/1.0
Date: Tue, 04 Mar 2014 16:48:36 GMT
Content-Length: 0
Keep-Alive: timeout=15,max=100

Look at the Location Header. Event Store has appended the event number 0.

Now the second call with the same data:

curl -i -d @prova.js "http://192.168.56.20:2113/streams/5315f65302536d8758000012" -H "Content-Type:application/json"
HTTP/1.1 201 Created
Access-Control-Allow-Methods: POST, DELETE, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
Access-Control-Allow-Origin: *
Location: http://192.168.56.20:2113/streams/5315f65302536d8758000012/1
Content-Type: text/plain; charset: utf-8
Server: Mono-HTTPAPI/1.0
Date: Tue, 04 Mar 2014 16:51:29 GMT
Content-Length: 0
Keep-Alive: timeout=15,max=100

As you can see the Header Location is telling me that the inserted event has number 1.

Why the behaviour is different? The only thing that is changed is the StreamId.

Build fails on Linux (Debian 6/testing) due to the missing libs/libjs1.so

f5001dc (9.0) builds successfully
0f85206 (9.1) already doesn't (although there is a binary available for download)

> xbuild src/EventStore/EventStore.sln


Errors:

/home/dm3/dev/tools/eventstore/master/src/EventStore/EventStore.sln (default targets) ->
(Build target) ->
/home/dm3/dev/tools/eventstore/master/src/EventStore/EventStore.SingleNode/EventStore.SingleNode.csproj (default targets) ->
(BeforeBuild target) ->

    /home/dm3/dev/tools/eventstore/master/src/EventStore/EventStore.SingleNode/EventStore.SingleNode.csproj: error : Cannot copy /home/dm3/dev/tools/eventstore/master/src/EventStore/libs/libjs1.so to /home/dm3/dev/tools/eventstore/master/bin/eventstore/debug/anycpu/libjs1.so, as the source file doesn't exist.

/home/dm3/dev/tools/eventstore/master/src/EventStore/EventStore.sln (default targets) ->
(Build target) ->
/home/dm3/dev/tools/eventstore/master/src/EventStore/EventStore.Projections.Core.Tests/EventStore.Projections.Core.Tests.csproj (default targets) ->
(BeforeBuild target) ->

    /home/dm3/dev/tools/eventstore/master/src/EventStore/EventStore.Projections.Core.Tests/EventStore.Projections.Core.Tests.csproj: error : Cannot copy /home/dm3/dev/tools/eventstore/master/src/EventStore/libs/libjs1.so to /home/dm3/dev/tools/eventstore/master/bin/eventstore.tests/debug/anycpu/libjs1.so, as the source file doesn't exist.

     165 Warning(s)
     2 Error(s)

Time Elapsed 00:00:18.3937740

HTTP server reponds with 400 Bad Request when bound to 0.0.0.0

Http server bound to 0.0.0.0:2113 doesn't work, while TCP server on 0.0.0.0:1113 does.

curl -v http://192.168.33.10:2113
* About to connect() to 192.168.33.10 port 2113 (#0)
*   Trying 192.168.33.10...
* connected
* Connected to 192.168.33.10 (192.168.33.10) port 2113 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.26.0
> Host: 192.168.33.10:2113
> Accept: */*
> 
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 400 Bad Request
< Content-Type: text/html; charset=us-ascii
< Server: Mono-HTTPAPI/1.0
< Date: Thu, 14 Mar 2013 09:20:37 GMT
< Content-Length: 35
< Connection: close
< 
* Closing connection #0

192.168.33.10 is a virtualbox VM configured with a host-only interface.
Eventstore is started with /opt/eventstore/start.sh --ip 0.0.0.0.

Ambiguous DELETE behaviour

Hello, DELETE request is returning a very ambiguous behaviour.
To reproduce the issue:

curl -i -d @/tmp/prova.js "http://192.168.56.20:2113/streams/newstreamtest" -H "Content-Type:application/json"

Which correctly creates the stream

HTTP/1.1 201 Created
Access-Control-Allow-Methods: POST, DELETE, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
Access-Control-Allow-Origin: *
Location: http://192.168.56.20:2113/streams/newstreamtest/0
Content-Type: text/plain; charset: utf-8
Server: Mono-HTTPAPI/1.0
Date: Mon, 10 Mar 2014 14:42:47 GMT
Content-Length: 0
Keep-Alive: timeout=15,max=100

Then, when trying to DELETE it with following command:
curl -v -X DELETE http://192.168.56.20:2113/streams/newstreamtest

ES replies with http status 415:

* Connected to 192.168.56.20 (192.168.56.20) port 2113 (#0)
> DELETE /streams/newstreamtest HTTP/1.1
> User-Agent: curl/7.32.0
> Host: 192.168.56.20:2113
> Accept: */*
> 
< HTTP/1.1 415 Invalid or missing Content-Type
< Access-Control-Allow-Methods: 
< Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
< Access-Control-Allow-Origin: *
< Content-Type: 
* Server Mono-HTTPAPI/1.0 is not blacklisted
< Server: Mono-HTTPAPI/1.0
< Date: Mon, 10 Mar 2014 14:47:55 GMT
< Content-Length: 0
< Keep-Alive: timeout=15,max=100
< 
* Connection #0 to host 192.168.56.20 left intact

Note: The DELETE command was copy/pasted from the wiki.

The issue is sorted adding curl -v -X DELETE http://192.168.56.20:2113/streams/newstreamtest -H "Content-Type:application/xml"

> DELETE /streams/newstreamtest HTTP/1.1
> User-Agent: curl/7.32.0
> Host: 192.168.56.20:2113
> Accept: */*
> Content-Type:application/xml
> 
< HTTP/1.1 204 Stream deleted
< Access-Control-Allow-Methods: POST, DELETE, GET, OPTIONS
< Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
< Access-Control-Allow-Origin: *
< Content-Type: text/plain; charset: utf-8
* Server Mono-HTTPAPI/1.0 is not blacklisted
< Server: Mono-HTTPAPI/1.0
< Date: Mon, 10 Mar 2014 14:51:22 GMT
< Content-Length: 0
< Keep-Alive: timeout=15,max=100

If we then try to delete the stream again, here is how ES replies:

* Connected to 192.168.56.20 (192.168.56.20) port 2113 (#0)
> DELETE /streams/newstreamtest HTTP/1.1
> User-Agent: curl/7.32.0
> Host: 192.168.56.20:2113
> Accept: */*
> Content-Type:application/xml
> 
< HTTP/1.1 410 Stream deleted
< Access-Control-Allow-Methods: POST, DELETE, GET, OPTIONS
< Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
< Access-Control-Allow-Origin: *
< Content-Type: text/plain; charset: utf-8
* Server Mono-HTTPAPI/1.0 is not blacklisted
< Server: Mono-HTTPAPI/1.0
< Date: Mon, 10 Mar 2014 14:52:57 GMT
< Content-Length: 0
< Keep-Alive: timeout=15,max=100

Which is different from what mentioned in the wiki (400 should be returned).
Again, if i then try to re-add another stream with the same name:

curl -i -d @/tmp/prova.js "http://192.168.56.20:2113/streams/newstreamtest" -H "Content-Type:application/json"
HTTP/1.1 410 Stream deleted
Access-Control-Allow-Methods: POST, DELETE, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
Access-Control-Allow-Origin: *
Content-Type: text/plain; charset: utf-8
Server: Mono-HTTPAPI/1.0
Date: Mon, 10 Mar 2014 14:54:47 GMT
Content-Length: 0
Keep-Alive: timeout=15,max=100

parallel code readability issue

I am a second-year PhD student in computer science at the University of Illinois at Urbana-Champaign. I am working on a refactoring tool improving the parallel code readability. I have found out some opportunities in your project. I want to ask whether these kind of patches are useful for you.

(from MultiQueuedHandler.cs file)

        var stopTasks = new Task[Queues.Length];
        for (int i = 0; i < Queues.Length; ++i)
        {
            int queueNum = i;
            stopTasks[i] = Task.Factory.StartNew(() => Queues[queueNum].Stop());
        }
        Task.WaitAll(stopTasks);

can be converted to:

Parallel.ForEach (Queues, (queue) => queue.Stop());

Do you accept these kind of changes as patches? I am asking because one of the way demonstrating our tool is to show how many patches are accepted. Please let me know asap because it is really important for my research.

Thanks,
Semih Okur

Error reading drive name on Linux with long Filesystem name from df

Getting the following error in the logs:

Debug MonitoringService 6]
couldn't get drive name for directory /var/eventstore/data/ on linux
System.IndexOutOfRangeException: Array index is out of range.
at EventStore.Core.Services.Monitoring.Stats.EsDriveInfo.GetDirectoryRootInLinux

I ran the df command and seems that the Filesystem is long and causes the remaining columns to wrap to the next line.

Googled it and you can prevent the wrap with -P flag:

http://www.commandlinefu.com/commands/view/8268/df-without-line-wrap-on-long-fs-name

I will submit a pull request when I get a minute.

HTTP server startup fails when http urlacl permissions are inadequate

With EventStore 1.0.1 on a vanilla Win8 desktop I get the following error on startup

[02404,17,08:47:01.185] ========= SystemInit: SingleVNodeController =========
[02404,17,08:47:01.198] Starting HTTP server on [http://127.0.0.1:2113/]...
[02404,17,08:47:01.198] Failed to start http server
Access is denied
[02404,17,08:47:01.209] Error while processing message EventStore.Core.Messages.
SystemMessage+SystemInit in queued handler 'MainQueue'.
Cannot access a disposed object.
Object name: 'System.Net.HttpListener'.

There are two issues, really:

  1. The server is only partially started (the TCP interface started, but the HTTP did not), yet you have to look in the log to know. I would suggest to make failure explicit by shutting down the whole server, not just running without the HTTP API.

  2. The error message does not provide much information on how to resolve the issue.

The problem relates to class EventStore.Transport.Http.Server.HttpAsyncServer method TryStart where the error message can be improved.

How to grant these permissions

This may happen if the permissions to set up a HTTP server on that port have not been granted.

To add these permissions to run the HTTP server on localhost on port 2113 (the default) you need to the following command (replacing DOMAIN\user with your relevant service account):

netsh http add urlacl url=http://127.0.0.1:2113/ user=DOMAIN\user

To revoke the permissions, delete the URLACL entry like this:

netsh http del urlacl url=http://127.0.0.1:2113/

Stream names on UI are not URL encoded

If you have a stream name that has a "/" in it, you can't get to the stream on the UI.

Example:

"SomeThing/f6baee17-cf32-4c0d-bb93-5eaebd308c0d" is a stream name that I have.

If I go to the website and try to click on that stream name, it takes me to the URL:

/streams/Something/f6baee17-cf32-4c0d-bb93-5eaebd308c0d

Which gives me a 400 Bad Request

Fix should be to url encode the name and decode it on the other side.

Difference Behavior Writing Events from EventStoreConnection and Transaction

We just noticed something; on the EventStoreConnection there is an AppendToStream(..) method. But on the transaction there is a Write(...) method.

They seem to write events slightly differently; connection.AppendToStream writes the payload as JSON and we see JSON in the resulting stream over http:

{
  "eventStreamId": "Employee-MHMRASP-127",
  "eventNumber": 15,
  "eventType": "LeaveOfAbscenceEndCorrected",
  "data": {
    "NewEndDate": "2012-05-04T00:00:00",
    "EventTimeStamp": "2013-05-30T12:13:31.8643514-05:00",
    "User": "JJONES1",
    "Source": "WinflexOne",
    "AdmCode": "MHMRASP",
    "CoCode": "MHMRASP",
    "EmpNum": "519562523",
    "EmployeeId": 127,
    "LeaveOfAbscenceId": 18
  },
  "metadata": ""
}

But the transaction.Write writes the payload as text, as seen from the stream over http:

{
  "eventStreamId": "Employee-MHMRASP-127",
  "eventNumber": 14,
  "eventType": "LeaveOfAbscenceEndCorrected",
  "data": "{\"NewEndDate\":\"2013-06-03T00:00:00\",\"EventTimeStamp\":\"2013-05-30T12:03:29.4359456-05:00\",\"User\":\"JJONES1\",\"Source\":\"WinflexOne\",\"AdmCode\":\"MHMRASP\",\"CoCode\":\"MHMRASP\",\"EmpNum\":\"519562523\",\"EmployeeId\":127,\"LeaveOfAbscenceId\":22}",
  "metadata": ""
}

We have set isJason == true in the EventData - actually we are generating the same EventData envelope no matter which method we call.

XML output differs from JSON

Several attributes are only available in JSON (eventType, data, ... ). I'd expect the content to be identical as it's just a different representation of the same data structure. Or is this by intention? If so, this should be documented somewhere with a big exclamation point.

Example:

Request "http://127.0.0.1:2113/streams/chat-GeneralChat?embed=body" with header "Accept: application/json":

    {
      "eventType": "UserJoinedChat",
      "eventNumber": 0,
      "data": "{\r\n  \"time\": \"14:15:28\",\r\n  \"user\": \"John Smith\"\r\n}",
      "streamId": "chat-GeneralChat",
      "isJson": true,
      "isMetaData": false,
      "isLinkMetaData": false,
      "positionEventNumber": 0,
      "positionStreamId": "chat-GeneralChat",
      "title": "0@chat-GeneralChat",
      "id": "http://127.0.0.1:2113/streams/chat-GeneralChat/0",
      "updated": "2014-01-04T13:15:29.0288091Z",
      "author": {
        "name": "EventStore"
      },
      "summary": "UserJoinedChat",
      "links": [
        {
          "uri": "http://127.0.0.1:2113/streams/chat-GeneralChat/0",
          "relation": "edit"
        },
        {
          "uri": "http://127.0.0.1:2113/streams/chat-GeneralChat/0",
          "relation": "alternate"
        }
      ]
    }

Request "http://127.0.0.1:2113/streams/chat-GeneralChat?embed=body" with header "Accept: application/xml":

    <entry>
        <title>0@chat-GeneralChat</title>
        <id>http://127.0.0.1:2113/streams/chat-GeneralChat/0</id>
        <updated>2014-01-04T13:15:29.0288091Z</updated>
        <author>
            <name>EventStore</name>
        </author>
        <summary>UserJoinedChat</summary>
        <link href="http://127.0.0.1:2113/streams/chat-GeneralChat/0"
            rel="edit" />
        <link href="http://127.0.0.1:2113/streams/chat-GeneralChat/0"
            rel="alternate" />
    </entry>

Examples result in 400 Bad Request (Invalid host)

I'm attempting to get a single node EventStore instance up and running on Mono, and I'm running into some issues with the examples. I tried finding a relevant log message, command line option, or config var and came up empty.

sample-dev-env|master โ‡’ curl -i -H "Content-Type: application/json" -d "{'eventStreamId': 'testEventStream', 'metadata': ''}" http://localhost:2113/streams                                          
HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Mono-HTTPAPI/1.0
Date: Mon, 22 Jul 2013 23:03:16 GMT
Content-Length: 35
Connection: close

<h1>Bad Request (Invalid host)</h1>%   
vagrant@eventstore:~$ uname -a
Linux eventstore 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
vagrant@eventstore:~$ mono --version
Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       altstack
    Notifications: epoll
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            Included Boehm (with typed GC and Parallel Mark)

Send two ScavengeDatabase at the time

Hi, when I send two ScavengeDatabase at the same time, I'm receiving reply on the first one only. Correlation ids are different.

Expected behaviour: receive Scavenge InProgress as reply to the second message.

Projections created from WebUI don't have correct name

When I try create projection from webui and specify same name ("test" for example) this is ignored and projection name is set to some guid.
I use compiled binaries of eventstore, Chrome Verze 22.0.1229.94 m on Windows 7

Murmur3AUnsafe buffer overflow

The implementation of MurmurHash3 in the class Murmur3AUnsafe access data over the end of the buffer.
This lead in changing hash value depending on the data following hashed buffer.

The problem is in the tail block.
block[2], block[1] and block[0] dont access to bytes as expected, but to uint32 (with offset *4)
So block[2] reads a uint32 with an offset of 8 !

I don't provide a fix yet since the class is not in use. and I could not find test vectors to check implementation change.

Remove it or test + fix it !

HTTP API - 500 Internal Server Error without eventId

After some testing on my PHP Proxy to EventStore I have found this behaviour.

Given this JSON with the event to send to ES:

[
  {
    eventType: "some-event-type",
    data: {
      a: 1
    }
  }
]

I perform this POST:

curl -v -d @/tmp/test.js "http://192.168.56.20:2113/streams/newstream" -H "Content-Type:application/json" -X POST
* About to connect() to 192.168.56.20 port 2113 (#0)
*   Trying 192.168.56.20... connected
> POST /streams/pippo HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: 192.168.56.20:2113
> Accept: */*
> Content-Type:application/json
> Content-Length: 96
> 
* upload completely sent off: 96out of 96 bytes
< HTTP/1.1 500 Internal Server Error
< Server: Mono-HTTPAPI/1.0
< Date: Mon, 03 Mar 2014 13:41:10 GMT
< Content-Length: 0
< Connection: close
< 
* Closing connection #0

ArgumentNullException in TcpPackage.AsByteArray() when sending about 25 Mb at once

First call to method

connection.AppendToStreamAsync("my-stream", -2, evts);

with events having 90000 items of average size 150 bytes leads to exception

System.ArgumentNullException was unhandled
  Message=Value cannot be null.
Parameter name: src
  Source=mscorlib
  ParamName=src
  StackTrace:
       at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
       at EventStore.ClientAPI.Defines.TcpPackage.AsByteArray() in D:\dev\lokad\sandbox\EventStore\src\EventStore\EventStore.ClientAPI\Defines\TcpPackage.cs:line 70
       at EventStore.ClientAPI.EventStoreConnection.Send(WorkItem workItem, ITaskCompletionWrapper wrapper) in D:\dev\lokad\sandbox\EventStore\src\EventStore\EventStore.ClientAPI\EventStoreConnection.cs:line 416
       at EventStore.ClientAPI.EventStoreConnection.MonitoringLoop() in D:\dev\lokad\sandbox\EventStore\src\EventStore\EventStore.ClientAPI\EventStoreConnection.cs:line 328
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

workItem.TcpPackage
{EventStore.ClientAPI.Defines.TcpPackage}
    Command: 0
    CorrelationId: {91327175-f9e1-4828-9dbe-9e3c9516bc87}
    Data: {System.ArraySegment<byte>}
workItem.TcpPackage.Data
{System.ArraySegment<byte>}
    Array: null
    Count: 0
    Offset: 0

As far as I understand client recived reply message in EventStoreConnection.OnPackageReceived and
result.Status == ProcessResultStatus.Retry, so wrapper.UpdateForNextAttempt() will be called.
WriteTaskCompletionWrapper.UpdateForNextAttempt uses SentPackage as an origin for creating new TcpPackage but SentPackage has not been initialized at this moment yet.
As a result empty message goes to EventStoreConnection._sendQueue and being poped from the queue by EventStoreConnection.MonitoringLoop method.

Adding line

taskWrapper.SentPackage = package;

after

var taskWrapper = new WriteTaskCompletionWrapper(taskCompletionSource);

in AppendToStreamAsync.EventStoreConnection solves the problem

Wrong "charset" parameter format for "Content-Type"

The "charset" parameter for the returned for the "Content-Type" is not according to the HTTP specification because it contains a colon instead an equal sign.

The value returned by the event store looks like this:

Content-Type: text/xml; charset: utf-8

But it should look like this:

Content-Type: text/xml; charset=utf-8

According to the HTTP/1.1 Header Field Definition (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) the parameters behind the mime type should use the format "key=value" and not "key: value".

See "14.17 Content-Type" for an example:

Content-Type: text/html; charset=ISO-8859-4

This causes problems when parsing the response for example in Java:

// Fails with "MimeTypeParseException: Couldn't find the '=' that separates a parameter name from its value."
new javax.activation.MimeType("text/xml; charset: utf-8");

// OK
new javax.activation.MimeType("text/xml; charset=utf-8");

Chat sample not working with Mozilla

At this Url "http://127.0.0.1:2113/web/chat.htm" in Mozilla it's not working. Chat messages stored but it is not reflected on UI.

Request and Response Headers are as follows;

Request:
POST /streams/chat-GeneralChat2 HTTP/1.1
Host: 127.0.0.1:2113
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0
Accept: application/json
Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Content-Type: application/json; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://127.0.0.1:2113/web/chat.htm
Content-Length: 257
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache

Response:
HTTP/1.1 415 Content-Type MUST be set for POST, PUT and DELETE.
Content-Length: 0
Server: Microsoft-HTTPAPI/2.0
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-PINGOTHER
Access-Control-Allow-Origin: *
Date: Tue, 19 Mar 2013 22:31:35 GMT

subscriptions doesn't work (using cluster nodes) if last node alive wasn't master

Test environment:

  • 3 nodes in cluster;
  • subscribed to master

Steps to reproduce:

  1. Kill master node -> new master is elected -> subscriber reconnected to new master -> all OK
  2. Kill master node again -> one node left -> subscriber reconnected to last alive node -> Event store in read only mode -> everything works as expected
  3. Bring new node again -> Event store back online -> Subscriber is already connected -> ERROR - new events are not received by subscriber

This only happens only when master node is killed when two nodes are alive. Otherwise subscriber works fine and is able to handle recovered ES events;

After step 2 I receive exception thrown by ClientAPI:

System.AggregateException: One or more errors occurred. ---> EventStore.ClientAPI.Exceptions.RetriesLimitReachedException: Item Operation ReadAllEventsForwardOperation ({8245b240-3a54-4e6f-a2d9-e186d0c02865}): Position: 965359254/965359254, MaxCount: 500, ResolveLinkTos: False, RequireMaster: True, retry count: 10, created: 17:40:08.491, last updated: 17:40:25.844 reached retries limit : 10

Creating an emitting one-time projection without checkpoints breaks Projection Manager

This is from the binary release 2.0.1 running on windows7 64bit.
padmin used was from the source build (commit : 8ef23af )

Tried creating the following projection (which had been previously verified without the emit)
fromStream('enquiry').
when({
$init : function() { return { totalcount : 0, count : 0, faultevents : { }, previousid : 0, previousevent : {} } },
$any: function(s,e) {
var currentid = e.metadata.EventId; // 100% had previously been verified to have this property.
if (s.previousid + 1 != currentid) {
s.count += 1;
}
s.totalcount += 1;
s.doubleprevious = s.previousevent;
s.previousid = currentid;
s.previousevent = e;
var subarray = [];
for (var i = s.previousid + 1; i < currentid; i++) { subarray.push(i); }
emit("MissingRecords","MissingRecordSet", { top : s.previousevent, tail : s.doubleprevious, missingSubCount : subarray.length, missingSubArray : subarray }, { topMetadata : s.previousevent.metadata, tailMetadata : s.doubleprevious.metadata })
return s;
}
})fromStream('enquiry').
when({
$init : function() { return { totalcount : 0, count : 0, faultevents : { }, previousid : 0, previousevent : {} } },
$any: function(s,e) {
var currentid = e.metadata.EventId; // 100% had previously been verified to have this property.
if (s.previousid + 1 != currentid) {
s.count += 1;
}
s.totalcount += 1;
s.doubleprevious = s.previousevent;
s.previousid = currentid;
s.previousevent = e;
var subarray = [];
for (var i = s.previousid + 1; i < currentid; i++) { subarray.push(i); }
emit("MissingRecords","MissingRecordSet", { top : s.previousevent, tail : s.doubleprevious, missingSubCount : subarray.length, missingSubArray : subarray }, { topMetadata : s.previousevent.metadata, tailMetadata : s.doubleprevious.metadata })
return s;
}
})

As a One-Time mode of projection, with
Emit Enabled
and was immediately Enabled.

This then errors, but doesn't become visible in the web console ( but is listed via padmin ).

The log gives the following error:
[06052,14,12:02:08.438] Error while processing message WRITE COMPLETED: CorrelationId: 49409e56-0227-4590-ac84-c0151d0b5558, Result: Success, Message: , FirstEventNumber: 6 in queued handler 'Projections Master'.
Emit requires checkpoints

and then

[06052,14,12:02:55.997] Error while processing message EventStore.Projections.Core.Messages.ProjectionManagementMessage+Delete in queued handler 'Projections Master'.
Cannot stop a projection in the 'Creating' state

Padmin gives the following exception
.\padmin.exe delete TheFourPercent admin changeit
Loading config values...
Deleting TheFourPercent...
padmin execution failed : System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at EventStore.ClientAPI.Transport.Http.WebRequestExtensions.EndGetResponseExtended(WebRequest request, IAsyncResult asyncResult) in c:\Dev\external\EventStore\src\EventStore\EventStore.ClientAPI\Transport.Http\WebRequestExtensions.cs:line 48
at EventStore.ClientAPI.Transport.Http.HttpAsyncClient.ResponseAcquired(IAsyncResult ar) in c:\Dev\external\EventStore\src\EventStore\EventStore.ClientAPI\Transport.Http\HttpAsyncClient.cs:line 175
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at EventStore.Padmin.Command.Delete(ProjectionsManager manager, String[] commandArgs) in c:\Dev\external\EventStore\src\EventStore\EventStore.Padmin\Command.cs:line 177
at EventStore.Padmin.Program.Execute(ProjectionsManager manager, String[] args) in c:\Dev\external\EventStore\src\EventStore\EventStore.Padmin\Program.cs:line 98
at EventStore.Padmin.Program.TryExecute(Dictionary`2 config, String[] args) in c:\Dev\external\EventStore\src\EventStore\EventStore.Padmin\Program.cs:line 81
---> (Inner Exception #0) System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at EventStore.ClientAPI.Transport.Http.WebRequestExtensions.EndGetResponseExtended(WebRequest request, IAsyncResult asyncResult) in c:\Dev\external\EventStore\src\EventStore\EventStore.ClientAPI\Transport.Http\WebRequestExtensions.cs:line 48
at EventStore.ClientAPI.Transport.Http.HttpAsyncClient.ResponseAcquired(IAsyncResult ar) in c:\Dev\external\EventStore\src\EventStore\EventStore.ClientAPI\Transport.Http\HttpAsyncClient.cs:line 175<---

(prior to setup had created a stream with a metadata field of 'EventId' that is a sequentially incrementing long value)

InvalidOperationException - Collection modified in Client API

Hi,

Just got an InvalidOperationException in AppendToStreamOperation in CreateNetworkPackage. Happens on line 98 (_events.Select ...). Seems easily reproducible by just hammering AppendToStreamAsync. All calls being made to AppendToStreamAsync are on the same thread. This was in the latest dev branch.

Stack trace is:

at System.Collections.Generic.List1.Enumerator.MoveNextRare() at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at EventStore.ClientAPI.ClientOperations.AppendToStreamOperation.CreateNetworkPackage()
at EventStore.ClientAPI.EventStoreConnection.Send(WorkItem workItem)
at EventStore.ClientAPI.EventStoreConnection.MainLoop()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Cheers

Data alteration when commiting a date to EventStore

Hi everybody !

I'm currently facing an odd problem with EventStore. When commiting ISO dates with milliseconds set to .000, milliseconds are removed from the stored event. As the library I use to deserialize my dates expects milliseconds to be there, this is quite annoying :-(

Here is an example event I've used to reproduce the problem :

[
{
"eventId" : "ccf58146-f4d5-428c-bb45-ed2873316fee",
"eventType" : "BirthDateChanged",
"isJson" : true,
"data" : {
"event":{
"BirthDate":"1987-11-07T00:00:00.000+01:00",
"context":{"date":"2014-02-03T14:05:22.041+01:00"}
}
}
}
]

When querying EventStore after having commited this event, here is the data I get :

{
"title": "24@my-stream",
"id": "http://127.0.0.1:2113/streams/my-stream/24",
"updated": "2014-02-03T12:22:46.523367Z",
"author": {
"name": "EventStore"
},
"summary": "BirthDateChanged",
"content": {
"eventStreamId": "my-stream",
"eventNumber": 24,
"eventType": "BirthDateChanged",
"data": {
"event": {
"BirthDate": "1987-11-07T00:00:00+01:00",
"context": {
"date": "2014-02-03T14:05:22.041+01:00"
}
}
},
"metadata": ""
},
"links": [
{
"uri": "http://127.0.0.1:2113/streams/my-stream/24",
"relation": "edit"
},
{
"uri": "http://127.0.0.1:2113/streams/my-stream/24",
"relation": "alternate"
}
]
}

The interesting part here is the "BirthDate". field. As you can see, it's lacking its milliseconds in the EventStore answer while the "date" field still has it.

Is this behaviour known or expected ? Is there any workaround ?

That being said, I must add that we're using EventStore since some weeks now and things are going pretty well. Thanks for the good work, so !

Best wishes,

Alexis.

PS : I originally wanted to post this message on the google groups forum... but the "Publish" button never worked. As I think I'm talking about a bug, I consider it is meaningful to post it here too.

EventStore.Client 1.1.0 binaries ILMerged against .NET 4.5

The distributed (Nuget) 1.1.0 RC binaries of client API are, unlike 1.0.x, ILMerged against .NET 4.5.

From 1.0.0 disassembly:
.custom instance void [System.Core]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )

From 1.1.0 disassembly:
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )

The distributed binaries should either be merged on a machine with no .NET 4.5 installed or the ILMerge script fixed to target the correct version of the framework (e.g. %programfiles(x86)%\reference assemblies\microsoft\framework.netframework\v4.0 on Win x64 installation).

Running EventStore in embedded mode

Anybody know what might cause this exception?

System.AggregateException : One or more errors occurred.
----> EventStore.ClientAPI.Exceptions.CommandNotExpectedException : Expected    : ReadAllEventsForwardCompleted. Actual : BadRequest.
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at EventStore.ClientAPI.EventStoreConnection.ReadAllEventsForward(Position position, Int32 maxCount, Boolean resolveLinkTos)
GEventStore\EventStoreConnectionExtensions.cs(8,0): at AggregateSource.GEventStore.EventStoreConnectionExtensions.DeleteAllStreams(EventStoreConnection connection)
GEventStore\RepositoryIntegrationTests.cs(43,0): at AggregateSource.GEventStore.RepositoryIntegrationTests.WithEmptyStoreAndEmptyUnitOfWork.SetUp()
--CommandNotExpectedException

The DeleteAllStreams EventStoreConnection extension method looks like this:

public static void DeleteAllStreams(this EventStoreConnection connection) {
  //Exception occurs on the following line.
  var slice = connection.ReadAllEventsForward(Position.Start, Int32.MaxValue, false);
  var streams = slice.Events.Select(@event => @event.OriginalStreamId).Distinct();
  foreach (var stream in streams) {
    connection.DeleteStream(stream, ExpectedVersion.Any);
  }
}

The DeleteAllStreams is repeatedly called in the setup of integration tests. Stream names are, however, unique.

Should request elevate and add HTTP ACL on Windows if not running as admin

A lot of people run into the problem of:

[01848,15,15:10:37.036] ========= SystemInit: SingleVNodeController =========
[01848,15,15:10:37.051] Starting HTTP server on [http://127.0.0.1:2113/]...
[01848,15,15:10:37.051] Failed to start http server
Access is denied
[01848,15,15:10:37.098] Error while processing message EventStore.Core.Messages.SystemMessage+SystemInit in queued handl
er 'MainQueue'.
Cannot access a disposed object.
Object name: 'System.Net.HttpListener'.
[01848,15,15:10:37.161] ========= SystemStart: SingleVNodeController =========
[01848,15,15:10:37.192] Starting TCP listening on TCP endpoint: 127.0.0.1:1113.
[01848,15,15:10:37.192] [127.0.0.1:2113] IS WORKING!!! SPARTA!!!111

When they aren't running as an admin on Windows. A more developer friendly approach to this might be to request elevation and then add to the HTTP ACL for the current user.

link_to error

Hi,
after reading some discussion on google group, I'd like to try use link_to function,
but without luck.

I try this basic code

fromAll().whenAny(function(s,e) { link_to(e.correlationId, e); }); 

I also try some others, but I hope this should work on every event.

When I try post it as "Post New" projection:

The 2e11a06f-4c5c-4b8f-97f5-c1b2adebd07a projection failed to process an event.
Handler: EventStore.Projections.Core.Services.v8.DefaultV8ProjectionStateHandler
Event Position: 189/0

Message:

ReferenceError: link_to is not defined

And when I try "Create Standard Projection", error:

Cannot create a projection state handler.

Handler type: native:EventStore.Projections.Core.Standard.IndexStreams
Query:

fromAll().whenAny(function(s,e) { link_to(e.correlationId, e); }); 

Message:

Exception has been thrown by the target of an invocation.

I use downloaded binary version.

Any idea?

Missing Timestamp in ResolvedEvent

I'm using the API to get events for a stream.

ReadStreamEventsForward(stream, start, count, resolveToTos)

I get the expected events returned as as array of ResolvedEvent.

My problem is that I really need the Timestamp for this event, and it is not a property in ResolvedEvent.

Is there a way to get the Timestamp in another way, or would it be possible to add the timestamp as a property to ResolvedEvent?

Standard projection disapear when upgrading v2

Standard projections ($stream_by_category, etc...) do not show up and run in v2 after an upgrade.

Steps to reproduce:

  1. Create a store in v1.1:
    .\EventStore_v1.1\EventStore.SingleNode.exe -d c:\TestEvents --run-projections
  2. Enable projections in the UI
  3. Run a store in v2 on it:
    .\EventStore_v2\EventStore.SingleNode.exe -d c:\TestEvents --run-projections=all
  4. Notice that only $users appears in the UI

406 code in chat example on Windows 7

Hello,
I just tried to run the chat room example, after following the basic setup docs in GitHub.

I installed the binaries for 2.0, the server started just fine, but when I try the demo, I see this in Chrome:

Failed to load resource: the server responded with a status of 406 (Requested URI is not available in requested format)

Here's the details:

Request URL:http://127.0.0.1:2113/streams/chat-CoderDojoPS/3/forward/20?embed=content
Request Method:GET
Status Code:406 Requested URI is not available in requested format
Request Headersview source
Accept:vnd.eventstore.atom+json
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Host:127.0.0.1:2113
Referer:http://127.0.0.1:2113/web/chat.htm
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36
X-Requested-With:XMLHttpRequest
Query String Parametersview sourceview URL encoded
embed:content
Response Headersview source
Access-Control-Allow-Headers:Content-Type, X-Requested-With, X-PINGOTHER
Access-Control-Allow-Methods:
Access-Control-Allow-Origin:*
Content-Length:0
Date:Mon, 29 Jul 2013 18:35:52 GMT
Server:Microsoft-HTTPAPI/2.0

When I browse to that same URL (in other words, without the additional HTTP headers), it returns me a rendered page with a UserJoinedChat and ChatMessage history.

Under 2.0, when I started a new tab, and join the chat, I can see the previous messages, but sending messages does not result in new message appearing live.

I don't see same 406 message if I run the chat room under 1.0.1 in the Chrome console messages, but I do not see any of the chat messages appear.

Anything else I can do to help diagnose or assist?

Cannot start EventStore.sh

I am getting an exception from NLog on startup

Missing method .ctor in assembly /home/benny/code/csharp/eventstore/NLog.dll, type System.ServiceModel.ServiceContractAttribute
Can't find custom attr constructor image: /home/benny/code/csharp/eventstore/NLog.dll mtoken: 0x0a0002f7
Missing method .ctor in assembly /home/benny/code/csharp/eventstore/NLog.dll, type System.ServiceModel.ServiceContractAttribute
Can't find custom attr constructor image: /home/benny/code/csharp/eventstore/NLog.dll mtoken: 0x0a0002f7
Missing method .ctor in assembly /home/benny/code/csharp/eventstore/NLog.dll, type System.ServiceModel.ServiceContractAttribute
Can't find custom attr constructor image: /home/benny/code/csharp/eventstore/NLog.dll mtoken: 0x0a0002f7
Missing method .ctor in assembly /home/benny/code/csharp/eventstore/NLog.dll, type System.ServiceModel.ServiceContractAttribute
Can't find custom attr constructor image: /home/benny/code/csharp/eventstore/NLog.dll mtoken: 0x0a0002f7
Missing method .ctor in assembly /home/benny/code/csharp/eventstore/NLog.dll, type System.ServiceModel.ServiceContractAttribute
Can't find custom attr constructor image: /home/benny/code/csharp/eventstore/NLog.dll mtoken: 0x0a0002f7
Missing method .ctor in assembly /home/benny/code/csharp/eventstore/NLog.dll, type System.ServiceModel.ServiceContractAttribute
Can't find custom attr constructor image: /home/benny/code/csharp/eventstore/NLog.dll mtoken: 0x0a0002f7
Missing method .ctor in assembly /home/benny/code/csharp/eventstore/NLog.dll, type System.Runtime.Serialization.DataContractAttribute
Can't find custom attr constructor image: /home/benny/code/csharp/eventstore/NLog.dll mtoken: 0x0a0002fd
Missing method .ctor in assembly /home/benny/code/csharp/eventstore/NLog.dll, type System.Runtime.Serialization.DataContractAttribute
Can't find custom attr constructor image: /home/benny/code/csharp/eventstore/NLog.dll mtoken: 0x0a0002fd
Missing method .ctor in assembly /home/benny/code/csharp/eventstore/NLog.dll, type System.Runtime.Serialization.CollectionDataContractAttribute
Can't find custom attr constructor image: /home/benny/code/csharp/eventstore/NLog.dll mtoken: 0x0a000310
Missing method .ctor in assembly /home/benny/code/csharp/eventstore/NLog.dll, type System.ServiceModel.ServiceContractAttribute
Can't find custom attr constructor image: /home/benny/code/csharp/eventstore/NLog.dll mtoken: 0x0a0002f7
Unhandled exception while starting application: NLog.NLogConfigurationException: Exception occurred when loading configuration from /home/benny/code/csharp/eventstore/NLog.config ---> System.ArgumentException: Target cannot be found: 'File'
at NLog.Config.Factory2[NLog.Targets.Target,NLog.Targets.TargetAttribute].CreateInstance (System.String name) [0x00000] in <filename unknown>:0 at NLog.Config.XmlLoggingConfiguration.ParseTargetsElement (NLog.Config.NLogXmlElement targetsElement) [0x00000] in <filename unknown>:0 at NLog.Config.XmlLoggingConfiguration.ParseNLogElement (NLog.Config.NLogXmlElement nlogElement, System.String baseDirectory) [0x00000] in <filename unknown>:0 at NLog.Config.XmlLoggingConfiguration.ParseTopLevel (NLog.Config.NLogXmlElement content, System.String baseDirectory) [0x00000] in <filename unknown>:0 at NLog.Config.XmlLoggingConfiguration.Initialize (System.Xml.XmlReader reader, System.String fileName, Boolean ignoreErrors) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at NLog.Config.XmlLoggingConfiguration.Initialize (System.Xml.XmlReader reader, System.String fileName, Boolean ignoreErrors) [0x00000] in <filename unknown>:0 at NLog.Config.XmlLoggingConfiguration..ctor (System.String fileName) [0x00000] in <filename unknown>:0 at NLog.LogFactory.get_Configuration () [0x00000] in <filename unknown>:0 at NLog.LogFactory.GetLogger (NLog.LoggerCacheKey cacheKey) [0x00000] in <filename unknown>:0 at NLog.LogFactory.GetLogger (System.String name) [0x00000] in <filename unknown>:0 at NLog.LogManager.GetLogger (System.String name) [0x00000] in <filename unknown>:0 at EventStore.Common.Log.NLogger..ctor (System.String name) [0x00000] in <filename unknown>:0 at EventStore.Common.Log.LogManager+<GetLogger>c__AnonStorey2.<>m__1 () [0x00000] in <filename unknown>:0 at System.Lazy1[EventStore.Common.Log.ILogger].InitValue () [0x00000] in :0
~/code/csharp/eventstore

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.