Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RpcException When Using AppendToStreamAsync From Windows #299

Closed
robbytarigan opened this issue May 2, 2024 · 14 comments
Closed

RpcException When Using AppendToStreamAsync From Windows #299

robbytarigan opened this issue May 2, 2024 · 14 comments

Comments

@robbytarigan
Copy link

robbytarigan commented May 2, 2024

Describe the bug
RpcException When Using AppendToStreamAsync From Windows.

To Reproduce
Steps to reproduce the behavior:

  1. Use Windows 11 OS
  2. Use latest package at the time of writing which is EventStore.Client.Streams version 23.2.1
  3. Run the quick start example from https://github.com/EventStore/EventStore-Client-Dotnet/blob/master/samples/quick-start/Program.cs

Expected behavior
The stream is appended

Actual behavior
RpcException was thrown with error below:

Grpc.Core.RpcException: Status(StatusCode="DeadlineExceeded", Detail="")
   at EventStore.Client.Interceptors.TypedExceptionInterceptor.<>c__DisplayClass1_0.<.ctor>b__0(RpcException rpcEx)
   at EventStore.Client.Interceptors.RpcExceptionConversionExtensions.<>c__DisplayClass1_0`1.<Apply>b__0(Task`1 t)
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at EventStore.Client.GrpcServerCapabilitiesClient.GetAsync(CallInvoker callInvoker, CancellationToken cancellationToken)
   at EventStore.Client.EventStoreClientBase.GetChannelInfoExpensive(ReconnectionRequired reconnectionRequired, Action`1 onReconnectionRequired, IChannelSelector channelSelector, CancellationToken cancellationToken)
   at EventStore.Client.SharingProvider`2.FillBoxAsync(TaskCompletionSource`1 box, TInput input)
   at EventStore.Client.TaskExtensions.WithCancellation[T](Task`1 task, CancellationToken cancellationToken)
   at EventStore.Client.EventStoreClientBase.GetChannelInfo(CancellationToken cancellationToken)
   at EventStore.Client.EventStoreClient.<CreateStreamAppender>g__GetCall|17_0()
   at EventStore.Client.EventStoreClient.StreamAppender.Receive()
   at EventStore.Client.EventStoreClient.AppendToStreamAsync(String streamName, StreamState expectedState, IEnumerable`1 eventData, Action`1 configureOperationOptions, Nullable`1 deadline, UserCredentials userCredentials, CancellationToken cancellationToken)
   at Program.<Main>$(String[] args)

Config/Logs/Screenshots
The event store server was run using docker with command below

docker run --rm --name esdb-node -it -p 2113:2113 -p 1113:1113 eventstore/eventstore:latest --insecure --run-projections=All --enable-atom-pub-over-http

EventStore details

  • EventStore server version: 24.2.0

  • Operating system: Windows 11

  • EventStore client version 23.2.1

Additional context
Add any other context about the problem here.

@w1am
Copy link
Contributor

w1am commented May 3, 2024

Does this happen constantly? I'm on Windows 11 too and unable to reproduce this error. Which target framework are you on?

@bartelink
Copy link
Contributor

bartelink commented May 3, 2024

Also worth mentioning whether other operations work etc - i.e. is it simply a firewall-driven timeout due to how your environment is configured?
ESDB is not a low usage system so it's not a matter of SELECT being broken.
Are you sure you'e configuring the server to serve on the correct ports (for gRPC, which your code is using; not TCP, which is dead)?

@robbytarigan
Copy link
Author

robbytarigan commented May 3, 2024

I'm not sure about what configuration available. I follow the docker run instruction which use arguments
--insecure--run-projections=All --enable-atom-pub-over-http and the port is mapped the same into my local machine.

I've tried the read operation ReadStreamAsync which also failed with similar error

Grpc.Core.RpcException: Status(StatusCode="DeadlineExceeded", Detail="")

@robbytarigan
Copy link
Author

robbytarigan commented May 3, 2024

Does this happen constantly? I'm on Windows 11 too and unable to reproduce this error. Which target framework are you on?

This happen constantly. I target .NET 8.0

The project content is below

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>Exe</OutputType>
        <TargetFramework>net8.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
    </PropertyGroup>

    <ItemGroup>
      <PackageReference Include="EventStore.Client.Grpc.Streams" Version="23.2.1" />
    </ItemGroup>

</Project>

@josephcummings
Copy link
Contributor

Hi @robbytarigan, I have tried this too and have been unable to recreate the problem.

Would it be possible for you to provide a small reproducible example via a public GitHub repository? Preferably using docker compose.

Thanks in advance!

@robbytarigan
Copy link
Author

Hi @josephcummings

I don't think I can reproduce it using docker compose because it does not support mixed windows and linux containers. I even cannot keep the evenstore server running when I switched into windows container. Probably I will need a bit more complex setup to make it reproducible, so need to think different idea.

@josephcummings
Copy link
Contributor

@robbytarigan no problem, if it is just the sample you are running as-is then my request for a composable reproducible example likely won't prove useful - I misread the second bullet point in the repro steps and assumed you may have a custom application where you are experiencing the issue, too, my apologies.

Regarding Windows vs Linux containers, the eventstore:latest image is a linux image so your Docker would need to be configured to run linux containers on windows desktop for the docker run ... command you are using to work.

Please can you try running the same docker run command but in detached mode as per below, then monitor the health of the container and let me know if you can see the container reach healthy status?

docker run -d --rm --name esdb-node -it -p 2113:2113 -p 1113:1113 eventstore/eventstore:latest --insecure --run-projections=All --enable-atom-pub-over-http

Assuming everything is OK, you should see something like the below:

image

If possible, it would be handy to have a dump of the container/server logs? Healthy or not.

@robbytarigan
Copy link
Author

robbytarigan commented May 5, 2024

The eventstore server is healthy. Please see the screenshot below
image

Please also see the server logs attached.
server.log

@w1am
Copy link
Contributor

w1am commented May 6, 2024

@robbytarigan Does the event appear in the stream browser?

@robbytarigan
Copy link
Author

@w1am No, the event does not appear

@w1am
Copy link
Contributor

w1am commented May 7, 2024

@robbytarigan I suggest testing a simple operation using a different client, such as the Node.js client or with a different server version (lts). If you continue to encounter the same issue, the problem is likely with your environment.

Have you also considered increasing the timeout to see if it makes a difference?

var settings = EventStoreClientSettings.Create(connectionString); 
settings.ConnectivitySettings.KeepAliveTimeout = TimeSpan.FromMinutes(1); 

@robbytarigan
Copy link
Author

robbytarigan commented May 8, 2024

@w1am I followed your suggestion to use NodeJS client example, and there is no problem with it. I put the screenshot for this operation here

image

I also try KeepAliveTimeout settings as suggested and it still gives the same error.

@w1am
Copy link
Contributor

w1am commented May 9, 2024

@robbytarigan Can you try with this connection string in the dotnet client instead

esdb://admin:changeit@127.0.0.1:2113?tls=false&tlsVerifyCert=false

The difference is that I replaced localhost with 127.0.0.1

Remove the previous keepAliveTimeout option I proposed initially

@robbytarigan
Copy link
Author

@w1am I cannot believe it works by replacing localhost with 127.0.0.1. I can see the stream is stored too now. I'll use 127.0.0.1 during local development then. Thank you!

@w1am w1am closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants