vxcontrol/pentagi · warning

user is not ready

Error message

user is not ready

What it means

Users in UserStatusCreated (registered but not yet activated/approved) are rejected with 'user is not ready'. The middleware only accepts UserStatusActive; anything earlier in the lifecycle is denied until the account is activated (e.g. email verification or admin approval).

Source

Thrown at backend/pkg/server/auth/auth_middleware.go:170

	}

	// Verify user hash matches database
	userID := uid.(uint64)
	sessionHash := uhash.(string)

	dbHash, userStatus, err := p.userCache.GetUserHash(userID)
	if err != nil {
		if errors.Is(err, gorm.ErrRecordNotFound) {
			return authResultFail, errors.New("user has been deleted")
		}
		return authResultFail, fmt.Errorf("error checking user status: %w", err)
	}

	switch userStatus {
	case models.UserStatusBlocked:
		return authResultFail, errors.New("user has been blocked")
	case models.UserStatusCreated:
		return authResultFail, errors.New("user is not ready")
	case models.UserStatusActive:
	}

	if dbHash != sessionHash {
		return authResultFail, fmt.Errorf("%w - session invalid for this installation", errUserHashMismatch)
	}

	c.Set("prm", prms)
	c.Set("uid", userID)
	c.Set("uhash", sessionHash)
	c.Set("rid", rid.(uint64))
	c.Set("exp", exp.(int64))
	c.Set("gtm", gtm.(int64))
	c.Set("tid", tid.(string))
	c.Set("uname", uname.(string))

	if slices.Contains(prms, PrivilegeAutomation) {
		c.Set("cpt", "automation")

View on GitHub (pinned to ea665308ba)

Solutions

  1. Complete the activation step (verify email / wait for admin approval)
  2. Have an admin set the user's status to active in the users table or via admin tooling
  3. If provisioning users programmatically, ensure the status is set to active after creation
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await api.call();
} catch (e) {
  if (e.response?.status === 401 || e.response?.status === 403) {
    showError('Your account is not yet active. Complete verification or wait for approval.');
  }
}

Prevention

When it happens

Trigger: Logging in or calling authenticated APIs with an account that completed registration but has not been activated — pending email verification, pending admin approval, or a provisioning pipeline that left the user in 'created'.

Common situations: Self-registration flows where activation emails bounce or are never sent; staging environments where the approval step is skipped; importing users into the DB without setting status to active.

Related errors


AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01). Data as JSON: /api/errors/3d60939d4eee58d6. Report an issue: GitHub.