hibiken/asynq · error

: path does not exist

Error message

%s: path does not exist

What it means

Guard in parseRedisSocketURI: a redis-socket: URI was given with an empty path, meaning no unix socket file was specified. Without a socket path there is no address to connect to, so ParseRedisURI fails with the 'asynq: could not parse redis socket uri' prefix.

Solutions

  1. Add a path component to the redis URI, e.g. 'redis-socket:/path/to/sock' instead of 'redis-socket:'
  2. Verify the URI string passed to ParseRedisURI includes the socket file path after the scheme
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at asynq.go:528 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hibiken/asynq@d135f1439b (2026-09-07). Data as JSON: /api/errors/ab50979fd52cd7bd. Report an issue: GitHub.

Appendix: source

Thrown at asynq.go:528

	if u.Scheme == "rediss" {
		h, _, err := net.SplitHostPort(u.Host)
		if err != nil {
			h = u.Host
		}
		redisConnOpt.TLSConfig = &tls.Config{ServerName: h}
	}

	redisConnOpt.Addr = u.Host
	redisConnOpt.Password = password
	redisConnOpt.DB = db

	return redisConnOpt, nil
}

func parseRedisSocketURI(u *url.URL) (RedisConnOpt, error) {
	const errPrefix = "asynq: could not parse redis socket uri"
	if len(u.Path) == 0 {
		return nil, fmt.Errorf("%s: path does not exist", errPrefix)
	}
	q := u.Query()
	var db int
	var err error
	if n := q.Get("db"); n != "" {
		db, err = strconv.Atoi(n)
		if err != nil {
			return nil, fmt.Errorf("%s: query param `db` should be a number", errPrefix)
		}
	}
	var password string
	if v, ok := u.User.Password(); ok {
		password = v
	}
	return RedisClientOpt{Network: "unix", Addr: u.Path, DB: db, Password: password}, nil
}

func parseRedisSentinelURI(u *url.URL) (RedisConnOpt, error) {

View on GitHub (pinned to d135f1439b)