XTLS/Xray-core · error

failed to get hysteria user

Error message

failed to get hysteria user

What it means

Hysteria server constructor fails converting a configured user entry to a memory user (invalid account/key); the chained error identifies which user record is malformed, and the severity is set to error because the whole inbound cannot start.

Solutions

  1. Fix the user entry's auth settings
  2. Check the wrapped error for the specific user field
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at proxy/hysteria/server.go:43 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15). Data as JSON: /api/errors/5aad69f80e0683fe. Report an issue: GitHub.

Appendix: source

Thrown at proxy/hysteria/server.go:43

	config        *ServerConfig
	validator     *account.Validator
	policyManager policy.Manager
}

func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) {
	v := core.MustFromContext(ctx)
	p := v.GetFeature(policy.ManagerType()).(policy.Manager)

	streamSettings := session.StreamSettingsFromContext(ctx).(*internet.MemoryStreamConfig)
	if _, ok := streamSettings.ProtocolSettings.(*hysteria.Config); !ok {
		return nil, errors.New("not hysteria transport")
	}

	validator := account.NewValidator()
	for _, user := range config.Users {
		u, err := user.ToMemoryUser()
		if err != nil {
			return nil, errors.New("failed to get hysteria user").Base(err).AtError()
		}

		if err := validator.Add(u); err != nil {
			return nil, errors.New("failed to add user").Base(err).AtError()
		}
	}

	return &Server{
		config:        config,
		validator:     validator,
		policyManager: p,
	}, nil
}

func (s *Server) HysteriaInboundValidator() *account.Validator {
	return s.validator
}

View on GitHub (pinned to 7d214f8b09)