AlexxIT/go2rtc · error

user/pass not provided

Error message

user/pass not provided

What it means

RTSP client Do auth guard: the server answered 401 Unauthorized, the auth method is AuthNone, and ReadNone could not extract credentials from the response — combined with no user/pass having been supplied in the URL. The server demands authentication that the client cannot provide.

Solutions

  1. Add username:password to the RTSP URL (rtsp://user:pass@host/path)
  2. Check for typos in credentials — wrong credentials raise 'wrong user/pass' instead
  3. Use a source without auth if the camera allows anonymous access
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/rtsp/client.go:130 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07). Data as JSON: /api/errors/d0090d9924e07efa. Report an issue: GitHub.

Appendix: source

Thrown at pkg/rtsp/client.go:130

		c.uri = u.String() // so auth will be saved on reconnect

		_ = c.conn.Close()

		if err = c.Dial(); err != nil {
			return nil, err
		}

		req.URL = c.URL // because path was changed

		return c.Do(req)

	case http.StatusUnauthorized:
		switch c.auth.Method {
		case tcp.AuthNone:
			if c.auth.ReadNone(res) {
				return c.Do(req)
			}
			return nil, errors.New("user/pass not provided")
		case tcp.AuthUnknown:
			if c.auth.Read(res) {
				return c.Do(req)
			}
		default:
			return nil, errors.New("wrong user/pass")
		}
	}

	return res, fmt.Errorf("wrong response on %s", req.Method)
}

func (c *Conn) Options() error {
	req := &tcp.Request{Method: MethodOptions, URL: c.URL}

	res, err := c.Do(req)
	if err != nil {
		return err

View on GitHub (pinned to c245815e75)