matrix-org / matrix-org/matrix-hookshot

Connection to redis on a unix socket

Open
#1,060 1 comment 0 reactions 0 assignees View on GitHub
T-Enhancement
Dominant language
TypeScript
Stars
450
Forks
95
Avg merge
1d 2h
Merged PRs (30d)
23

Description

Hi, I'd like to use a unix socket to connect to a redis cache. With this configuration:

```yaml
cache:
redisUri: redis:///run/redis-matrix-hookshot/redis.sock
```

I get matrix-hookshot still attempting to connect to the default TCP host:

```text
May 24 17:23:11 testvm matrix-hookshot[4140]: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
```

I'm *guessing* that this is because `ioredis` doesn't itself correctly handle the uri when it contains a filepath, it seems to want an object specifying `{path: ...}`. It's a bit weird that it just defaults to the TCP path if it gets an "invalid" URI, but hey.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the cache.redisUri configuration is parsed before the ioredis client is created, and reproduce the issue with the shown Unix-socket configuration. Done means matrix-hookshot connects to /run/redis-matrix-hookshot/redis.sock instead of falling back to 127.0.0.1:6379.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.