I'm new with all of these. can someone please point out what I'm doing wrong. Connecting redis from .net framework 4.7.2 - redisSessionStateProvider using TLS mutual auth and getting the below error.
Server Error in '/' Application.
Timeout performing EVAL (6000ms), inst: 0, qu: 1, qs: 0, aw: False, bw: SpinningDown, serverEndpoint: serverName:6379, mc: 1/1/0, mgr: 10 of 10 available, clientName: SessionStateProvider, IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=1,Free=32766,Min=2,Max=32767), v: 2.6.48.48654 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: StackExchange.Redis.RedisTimeoutException: Timeout performing EVAL (6000ms), inst: 0, qu: 1, qs: 0, aw: False, bw: SpinningDown, serverEndpoint: serverName:6379, mc: 1/1/0, mgr: 10 of 10 available, clientName: SessoinStateProvider, IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=1,Free=32766,Min=2,Max=32767), v: 2.6.48.48654 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)
Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[RedisTimeoutException: Timeout performing EVAL (6000ms), inst: 0, qu: 1, qs: 0, aw: False, bw: SpinningDown, serverEndpoint: serverName:6379, mc: 1/1/0, mgr: 10 of 10 available, clientName: SessionStateProvider, IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=1,Free=32766,Min=2,Max=32767), v: 2.6.48.48654 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)]
StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl(Message message, ResultProcessor1 processor, ServerEndPoint server, T defaultValue) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:1854 StackExchange.Redis.RedisDatabase.ScriptEvaluate(String script, RedisKey[] keys, RedisValue[] values, CommandFlags flags) in /_/src/StackExchange.Redis/RedisDatabase.cs:1501 Microsoft.Web.Redis.<>c__DisplayClass7_0.<Eval>b__0() in C:\TeamCity\buildAgent\work\59b31e8e4035fd30\src\Shared\StackExchangeClientConnection.cs:68 Microsoft.Web.Redis.StackExchangeClientConnection.OperationExecutor(Func
1 redisOperation) in C:\TeamCity\buildAgent\work\59b31e8e4035fd30\src\Shared\StackExchangeClientConnection.cs:95 Microsoft.Web.Redis.StackExchangeClientConnection.RetryLogic(Func`1 redisOperation) in C:\TeamCity\buildAgent\work\59b31e8e4035fd30\src\Shared\StackExchangeClientConnection.cs:122 Microsoft.Web.Redis.StackExchangeClientConnection.Eval(String script, String[] keyArgs, Object[] valueArgs) in C:\TeamCity\buildAgent\work\59b31e8e4035fd30\src\Shared\StackExchangeClientConnection.cs:68 Microsoft.Web.Redis.RedisConnectionWrapper.Set(ISessionStateItemCollection data, Int32 sessionTimeout) in C:\TeamCity\buildAgent\work\59b31e8e4035fd30\src\RedisSessionStateProvider\RedisConnectionWrapper.cs:137 Microsoft.Web.Redis.d__25.MoveNext() in C:\TeamCity\buildAgent\work\59b31e8e4035fd30\src\RedisSessionStateProvider\RedisSessionStateProvider.cs:433 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.AspNet.SessionState.d__80.MoveNext() +812 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.AspNet.SessionState.d__82.MoveNext() +323 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.AspNet.SessionState.TaskAsyncHelper.EndTask(IAsyncResult ar) +58 System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +417 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +158
Web.config:
<add settingsClassName="RedisConfig" settingsMethodName="GetConnectionString" name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" ssl="true" accessKey="somelengthypassword"/>
RedisConfig.cs:
static RedisConfig()
{
try
{
var options = new ConfigurationOptions
{
EndPoints = { "serverName:6379" },
ClientName = "SessionStateProvider",
User = "acl-username",
Password = "somelengthypassword",
Ssl = true,
// SslProtocols = SslProtocols.Tls12,
AllowAdmin = true,
AbortOnConnectFail = false,
ConnectTimeout = 10000,
SyncTimeout = 6000,
ConnectRetry = 3,
CheckCertificateRevocation = false
};
options.CertificateSelection += delegate
{
var certificate = new X509Certificate2("C:\\temp\\myclientcert.pfx", "test");
return certificate;
};
conn = ConnectionMultiplexer.Connect(options);
}
catch (Exception)
{
throw;
}
}
public static string GetConnectionString()
{
var config = conn.Configuration;
return conn.Configuration;
}
Storing data: Index.aspx
protected void GreetButton_Click(object sender, EventArgs e)
{
string name = NameTextBox.Text;
Session.Add("MyName", name);
Session.Add("SessionTime", DateTime.Now);
Response.Redirect("~/Result.aspx");
}
Result.aspx:
public partial class Result : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
object name = Session["MyName"];
object time = Session["SessionTime"];
if (name != null && time != null)
NameLabel.Text = "Hi! " + (string)name + ", your last session state storing time was: " + time;
}
}