I am currently getting started with EventStore and I'm following the Getting Started guide. And I just got stuck at the first step and don't know what I'm doing wrong...
The version I'm using now is 20.6.0.
I'm trying to write an event using the .NET Core Client to my local instance (which is running because I can add events using the AdminUI). But I get an exception like One or more errors occurred. (Connection 'ES-41230054-2026-4cdb-b2bb-a35824779863' was closed.)'.
After a while trying to fix it, I went to the .Net Client guide and pasted the exact same piece of code:
public static void Main()
{
var conn = EventStoreConnection.Create(new Uri("tcp://admin:changeit@localhost:1113"));
conn.ConnectAsync().Wait();
var data = Encoding.UTF8.GetBytes("{\"a\":\"2\"}");
var metadata = Encoding.UTF8.GetBytes("{}");
var evt = new EventData(Guid.NewGuid(), "testEvent", true, data, metadata);
conn.AppendToStreamAsync("test-stream", ExpectedVersion.Any, evt).Wait();
var streamEvents = conn.ReadStreamEventsForwardAsync("test-stream", 0, 1, false).Result;
var returnedEvent = streamEvents.Events[0].Event;
Console.WriteLine("Read event with data: {0}, metadata: {1}",
Encoding.UTF8.GetString(returnedEvent.Data),
Encoding.UTF8.GetString(returnedEvent.Metadata));
}
}
But the same exception is thrown when I get to this line:
conn.AppendToStreamAsync("test-stream", ExpectedVersion.Any, evt).Wait();
I tried different approaches when creating the connection but none worked so far.
I am wondering if I'm missing some configuration... If anyone has experienced this issue and would shred some light to this for me I'd be greatly thankful.
Adding more info
After activating the logging, I've seen the following:
- When trying to append the event, I get this output:
[01,07:28:46.528,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': enqueueing message EventStore.ClientAPI.Internal.StartConnectionMessage..
[04,07:28:46.545,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': StartConnection.
[04,07:28:46.546,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': DiscoverEndPoint.
[04,07:28:46.549,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': enqueueing message EventStore.ClientAPI.Internal.EstablishTcpConnectionMessage..
[06,07:28:46.561,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': EstablishTcpConnection to [127.0.0.1:1113].
[05,07:28:46.582,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': enqueueing message EventStore.ClientAPI.Internal.StartOperationMessage..
[06,07:28:46.642,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': StartOperation enqueue AppendToStreamOperation, Stream: newstream, ExpectedVersion: -2, 10, 00:00:07..
[06,07:28:46.643,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': EnqueueOperation WAITING for Operation AppendToStreamOperation (a301f19c-bb92-4c53-a193-3a81582a49db): Stream: newstream, ExpectedVersion: -2, retry count: 0, created: 07:28:46.642, last updated: 07:28:46.642..
[08,07:28:48.702,DEBUG] TcpPackageConnection: connection to [127.0.0.1:1113, L, {69f92d44-54ab-4643-b540-23f89b796fcf}] failed. Error: ConnectionRefused.
[08,07:28:48.703,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': enqueueing message EventStore.ClientAPI.Internal.TcpConnectionClosedMessage..
[08,07:28:48.704,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': TCP connection to [127.0.0.1:1113, L, {69f92d44-54ab-4643-b540-23f89b796fcf}] closed..
[06,07:28:48.924,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': TimerTick checking reconnection....
[06,07:28:49.213,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': ExecuteOperation package WriteEvents, a301f19c-bb92-4c53-a193-3a81582a49db, Operation AppendToStreamOperation (a301f19c-bb92-4c53-a193-3a81582a49db): Stream: newstream, ExpectedVersion: -2, retry count: 0, created: 07:28:46.642, last updated: 07:28:48.935..
[06,07:28:49.229,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': DiscoverEndPoint.
[06,07:28:49.230,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': enqueueing message EventStore.ClientAPI.Internal.EstablishTcpConnectionMessage..
[04,07:28:49.231,DEBUG] EventStoreConnection 'ES-90357f8a-6c79-4638-909a-142c8ddb9a8b': EstablishTcpConnection to [127.0.0.1:1113].
So this seems to say that the problem is that the port is not open, I tried disabling the firewall completelly with no luck.
- Also when I execute the command
EventStore.ClusterNode.exe --db ./db --log ./logs --devI noticed this in the outpue:
If I do telnet 127.0.0.1 1113 it doesn't seem to be able to connect, but I'm not finding what's wrong. Any idea?

