StackExchange / StackExchange/StackExchange.Redis

Error message improvement when we're unable to reconnect

Open
#2,881 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

We've been trying to debug an intermittent issue where our application gets disconnected from Azure Redis and we're seeing dead scokets detected with a lot of timeouts.

In addition to that, we're also seeing the below message which confused me at first. The first part of the message seems to indicate an authentication failure but it seems to be an IOException issue where the application isn't able to connect to redis.

Can the message be made clearer since it's not an issue with the passwords, but there was something else going on which prevented a reconnect?

Perhaps we can update this to check for IOExceptions and return a different message?

Error: [StackExchange.Redis.ConnectionMultiplexer] It was not possible to connect to the redis server(s) server:1234/Interactive. There was an authentication failure; check that passwords (or client certificates) are configured correctly: (IOException) Unable to read data from the transport connection: Operation canceled. ConnectTimeout

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/StackExchange.Redis/ExceptionFactory.cs around line 395, where the misleading connection message is identified. Inspect how IOException failures are handled and make the resulting reconnect error distinguish transport failures from authentication failures, with wording that matches the shown timeout case.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, redis
Domain
backend, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.