bytebase/bytebase · error

cannot found user %s

Error message

cannot found user %s

What it means

getUserByIdentifier resolves an issue assignee/creator by email. After looking the account up via store.GetAccountByEmail, a nil account means no user row matches that email; the code returns a plain (non-connect) error 'cannot found user %s'. It signals the referenced email does not correspond to any registered account.

Source

Thrown at backend/api/v1/issue_service.go:440

		return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to convert to issue"))
	}
	return connect.NewResponse(&v1pb.SearchIssuesResponse{
		Issues:        converted,
		NextPageToken: nextPageToken,
	}), nil
}

func (s *IssueService) getUserByIdentifier(ctx context.Context, identifier string) (*store.UserMessage, error) {
	email := strings.TrimPrefix(identifier, "users/")
	if email == "" {
		return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid empty creator identifier"))
	}
	account, err := s.store.GetAccountByEmail(ctx, email)
	if err != nil {
		return nil, connect.NewError(connect.CodeInternal, errors.Errorf(`failed to find user "%s" with error: %v`, email, err.Error()))
	}
	if account == nil {
		return nil, errors.Errorf("cannot found user %s", email)
	}
	return &store.UserMessage{
		Email:         account.Email,
		Name:          account.Name,
		Type:          account.Type,
		MemberDeleted: account.MemberDeleted,
	}, nil
}

// CreateIssue creates a issue.
func (s *IssueService) CreateIssue(ctx context.Context, req *connect.Request[v1pb.CreateIssueRequest]) (*connect.Response[v1pb.Issue], error) {
	if err := rejectMCPOriginatedGrantIssue(ctx, req.Msg.GetIssue().GetType()); err != nil {
		return nil, err
	}
	projectID, err := common.GetProjectID(req.Msg.Parent)
	if err != nil {
		return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("%v", err.Error()))
	}

View on GitHub (pinned to 1870550677)

Solutions

  1. Verify the email exists via the user list API or users table before referencing it
  2. Fix the typo/casing in the email in the issue payload
  3. Re-add or restore the user account if it was deleted
  4. Use the user's canonical login email (matching the account row) rather than an alias

Example fix

// before
assignee: "jane.doe@corp.com" // deleted user
// after
assignee: "jane.doe-new@corp.com" // existing account
Defensive patterns

Strategy: validation

Validate before calling

u, err := client.GetUser(ctx, email)
if err != nil || u == nil { return fmt.Errorf("user %s does not exist", email) }

Type guard

func userExists(u *store.UserMessage) bool { return u != nil && u.Email != "" }

Prevention

When it happens

Trigger: Calling CreateIssue/UpdateIssue with an assignee or creator email that does not exist in the user store; typo'd or stale email in the issue payload; user deleted from the workspace but still referenced.

Common situations: Offboarding: user removed from Bytebase but a pipeline/template still references their email; LDAP/SSO email casing mismatches; test fixtures with fabricated emails.

Understand the failure class

Background: "User not found", "Invalid user", and "does not exist": what missing-user lookup errors mean across Rocket.Chat, LiteLLM, Phabricator, rustfs, and pnpm — this error's family across 10 libraries.

Related errors


AI-assisted analysis of bytebase/bytebase@1870550677 (2026-09-06). Data as JSON: /api/errors/d672c7176646146b. Report an issue: GitHub.