microsoft / microsoft/aspire

AddRedis times out on Windows but works in WSL - Aspire 13.1.0 / .NET 10

Open
#14,175 0 comments 0 reactions 0 assignees View on GitHub
area-integrations redis
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

`AddRedis()` causes a 10-second timeout on Windows, but works correctly when running the same code from WSL. Interestingly, AddContainer("test", "redis") works fine on Windows - only AddRedis() fails.

The timeout occurs in ` DcpExecutor.UpdateWithEffectiveAddressInfo` while waiting for the Service endpoint address information.

Other Windows installations with the same setup work correctly, suggesting a machine-specific configuration issue that Aspire may not be handling gracefully.

This might be a similar situation as reported in https://github.com/dotnet/aspire/issues/9376, but in this case there is no dev drive on the machine.

### Expected Behavior

` AddRedis()` should work on Windows the same as it does in WSL, or provide a more descriptive error message indicating what’s wrong with the configuration.

### Steps To Reproduce

1. Create an Aspire AppHost with builder.AddRedis("redis-db")
2. Run from Windows PowerShell: dotnet run → times out after 10 seconds
3. Run from WSL: dotnet run → works

MVP

Program.cs

```
var builder = DistributedApplication.CreateBuilder(args);
var redis = builder.AddRedis("redis-db");
builder.Build().Run();
```

CSPROJ

```



Exe
net10.0
enable
enable




```

### Exceptions (if any)

```

fail: Microsoft.Extensions.Hosting.Internal.Host[11]
Hosting failed to start
Polly.Timeout.TimeoutRejectedException: The operation didn't complete within the allowed timeout of '00:00:10'.
---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
at k8s.Watcher`1.CreateWatchEventEnumerator(Func`1 streamReaderCreator, Action`1 onError, CancellationToken cancellationToken)+MoveNext()
at k8s.Watcher`1.CreateWatchEventEnumerator(Func`1 streamReaderCreator, Action`1 onError, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()
at Aspire.Hosting.Utils.PeriodicRestartAsyncEnumerable.CreateAsync[T](Func`3 enumerableFactory, TimeSpan restartInterval, CancellationToken cancellationToken)+MoveNext() in /_/src/Aspire.Hosting/Utils/PeriodicRestartAsyncEnumerable.cs:line 39
at Aspire.Hosting.Utils.PeriodicRestartAsyncEnumerable.CreateAsync[T](Func`3 enumerableFactory, TimeSpan restartInterval, CancellationToken cancellationToken)+MoveNext() in /_/src/Aspire.Hosting/Utils/PeriodicRestartAsyncEnumerable.cs:line 59
at Aspire.Hosting.Utils.PeriodicRestartAsyncEnumerable.CreateAsync[T](Func`3 enumerableFactory, TimeSpan restartInterval, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()
at Aspire.Hosting.Dcp.KubernetesService.WatchAsync[T](String namespaceParameter, CancellationToken cancellationToken)+MoveNext() in /_/src/Aspire.Hosting/Dcp/KubernetesService.cs:line 298
at Aspire.Hosting.Dcp.KubernetesService.WatchAsync[T](String namespaceParameter, CancellationToken cancellationToken)+MoveNext() in /_/src/Aspire.Hosting/Dcp/KubernetesService.cs:line 298
at Aspire.Hosting.Dcp.KubernetesService.WatchAsync[T](String namespaceParameter, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()
at Aspire.Hosting.Dcp.DcpExecutor.<>c__DisplayClass57_0.<b__0>d.MoveNext() in /_/src/Aspire.Hosting/Dcp/DcpExecutor.cs:line 781
--- End of stack trace from previous location ---
at Aspire.Hosting.Dcp.DcpExecutor.<>c__DisplayClass57_0.<b__0>d.MoveNext() in /_/src/Aspire.Hosting/Dcp/DcpExecutor.cs:line 781
--- End of stack trace from previous location ---
at Polly.ResiliencePipeline.<>c.<b__3_0>d.MoveNext()
--- End of inner exception stack trace ---
at Polly.Utils.ExceptionUtilities.TrySetStackTrace[T](T exception)
at Polly.Timeout.TimeoutResilienceStrategy.ExecuteCore[TResult,TState](Func`3 callback, ResilienceContext context, TState state)
...
at Aspire.Hosting.Dcp.DcpExecutor.UpdateWithEffectiveAddressInfo(IEnumerable`1 services, CancellationToken cancellationToken, Nullable`1 timeout) in /_/src/Aspire.Hosting/Dcp/DcpExecutor.cs:line 778
at Aspire.Hosting.Dcp.DcpExecutor.RunApplicationAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpExecutor.cs:line 174
at Aspire.Hosting.Orchestrator.ApplicationOrchestrator.RunApplicationAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs:line 452
at Aspire.Hosting.Orchestrator.OrchestratorHostService.StartAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Orchestrator/OrchestratorHostService.cs:line 41
at Microsoft.Extensions.Hosting.Internal.Host.b__14_1(IHostedService service, CancellationToken token)
at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)

```

### .NET Version info

10.0.101

### Anything else?

∙ OS: Windows 11
∙ .NET SDK: 10.0.101
∙ Aspire: 13.1.0
∙ Docker: 29.1.5
∙ Docker Desktop: Running with WSL2 backend

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.