Almost all azure-cache-redis-samples does not work correctly

Salam 26 Reputation points
2022-06-27T09:14:04.967+00:00

Hi, Can you please double check if the samples can work correctly. Already, fo ASP sample, in VS 2022 after struggling with missing bundles/scripts not found virtual directory, it fails on the line 149 of
azure-cache-redis-samples of redisConnection.cs
I followed then instructions for "cache-web-app-aspnet-core-howto" it builds and run then when clicking on "Azure Cache for Redis Test", I get

info: Microsoft.Hosting.Lifetime[0]
Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\Projects\AzureDevOpsProjects\Redis\aspnet-core\ContosoTeamStats
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
StackExchange.Redis.RedisTimeoutException: The timeout was reached before the message could be written to the output buffer, and it was not sent, command=UNKNOWN, timeout: 5000, inst: 0, qu: 0, qs: 0, aw: False, bw: CheckingForTimeout, rs: NotStarted, ws: Initializing, in: 0, serverEndpoint: rediscodemagazine.redis.cache.windows.net:6380, mc: 1/1/0, mgr: 10 of 10 available, clientName: SALAM7(SE.Redis-v2.6.45.45955), IOCP: (Busy=0,Free=1000,Min=8,Max=1000), WORKER: (Busy=0,Free=32767,Min=8,Max=32767), POOL: (Threads=11,QueuedItems=0,CompletedItems=547), v: 2.6.45.45955 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute1T0,TRet
at ContosoTeamStats.Controllers.HomeController.<>c__DisplayClass8_0.<<RedisCache>b__0>d.MoveNext() in C:\Projects\AzureDevOpsProjects\Redis\aspnet-core\ContosoTeamStats\Controllers\HomeController.cs:line 50
--- End of stack trace from previous location ---
at ContosoTeamStats.RedisConnection.BasicRetryAsyncT in C:\Projects\AzureDevOpsProjects\Redis\aspnet-core\ContosoTeamStats\RedisConnection.cs:line 56
at ContosoTeamStats.Controllers.HomeController.RedisCache() in C:\Projects\AzureDevOpsProjects\Redis\aspnet-core\ContosoTeamStats\Controllers\HomeController.cs:line 50
at lambda_method20(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
info: Microsoft.Hosting.Lifetime[0]

Azure Cache for Redis
Azure Cache for Redis
An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.
232 questions
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 29,017 Reputation points Microsoft Employee
    2022-06-30T16:30:25.517+00:00

    Hi @Salam Thanks again for your finding we have updated the samples, please do retry and let us know if you are still facing any issues.

    Regards
    Geetha


1 additional answer

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 29,017 Reputation points Microsoft Employee
    2022-07-08T14:43:06.987+00:00

    Hi, anonymous user I am unable to replicate the issue on my machine. Please ensure your CacheSecrets.config file follows the following format:

    <appSettings>
    <add key="CacheConnection" value="<DNS_NAME>.redis.cache.windows.net:6380,password=<PASSWORD>,ssl=True,abortConnect=False"/>
    </appSettings>

    Regards
    Geetha

    0 comments No comments