AlexxIT/go2rtc · error

yandex: login error

Error message

yandex: login error: %s

What it means

Yandex session Login guard: the auth-step request transported and decoded fine, but auth.Status != 'ok' (status appended, e.g. 'error'). Yandex rejected the login step — expired OAuth token, wrong credentials, or a required additional auth factor per the returned status.

Solutions

  1. Refresh the Yandex OAuth token used as s.token
  2. Inspect the appended status/track_id via the track_id with Yandex support flows
  3. Re-run the full login sequence from a fresh session
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/yandex/session.go:69 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/f5061dedb5587cb8. Report an issue: GitHub.

Appendix: source

Thrown at pkg/yandex/session.go:69

	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
	req.Header.Set("Ya-Consumer-Authorization", "OAuth "+s.token)

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		return err
	}

	var auth struct {
		PassportHost string `json:"passport_host"`
		Status       string `json:"status"`
		TrackId      string `json:"track_id"`
	}
	if err = json.NewDecoder(res.Body).Decode(&auth); err != nil {
		return err
	}

	if auth.Status != "ok" {
		return errors.New("yandex: login error: " + auth.Status)
	}

	s.client = &http.Client{Timeout: 15 * time.Second}
	s.client.CheckRedirect = func(req *http.Request, via []*http.Request) error {
		return http.ErrUseLastResponse
	}
	s.client.Jar, _ = cookiejar.New(nil)

	res, err = s.client.Get(auth.PassportHost + "/auth/session/?track_id=" + auth.TrackId)
	if err != nil {
		return err
	}

	s.client.CheckRedirect = nil

	return nil
}

View on GitHub (pinned to c245815e75)