bytebase/bytebase · error

issue label %q color invalid

Error message

issue label %q color invalid

What it means

validateIssueLabels iterates project issue labels and, when a label has a Color set, checks it is an opaque (fully opaque alpha) color via isOpaqueColor. A transparent or semi-transparent color string fails with 'issue label %q color invalid'.

Source

Thrown at backend/api/v1/project_service.go:1369

	validPrefixes := []string{
		common.UserBindingPrefix,
		common.GroupBindingPrefix,
		common.ServiceAccountBindingPrefix,
		common.WorkloadIdentityBindingPrefix,
	}
	for _, prefix := range validPrefixes {
		if strings.HasPrefix(member, prefix) && len(member[len(prefix):]) > 0 {
			return nil
		}
	}
	return errors.Errorf("invalid member %s", member)
}

func validateIssueLabels(labels []*v1pb.Label) error {
	for _, label := range labels {
		if label.Color != nil && !isOpaqueColor(label.Color) {
			return errors.Errorf("issue label %q color invalid", label.Value)
		}
	}
	return nil
}

View on GitHub (pinned to 1870550677)

Solutions

  1. Provide a fully opaque color, e.g. "#RRGGBB" (6-digit hex) or 8-digit hex with alpha FF
  2. Remove the alpha channel or set it to FF/1.0
  3. If transparency is not needed, omit the color field entirely
  4. Normalize colors client-side to opaque hex before sending

Example fix

// before
label.Color = "#FF573380" // 50% alpha
// after
label.Color = "#FF5733" // opaque
Defensive patterns

Strategy: validation

Validate before calling

func isOpaqueHex(c string) bool { if len(c)==7 && c[0]=='#' { return true }; if len(c)==9 && c[0]=='#' { return strings.EqualFold(c[7:9],"ff") }; return false }

Type guard

func isOpaqueColor(c *string) bool { return c != nil && (len(*c)==7 || (len(*c)==9 && strings.EqualFold((*c)[7:9],"ff"))) && c[0]=='#' }

Prevention

When it happens

Trigger: CreateProject or UpdateProject with a label whose color is e.g. "#RRGGBBAA" with alpha < FF, "transparent", or an rgba(...) value with alpha < 1.

Common situations: Picking a color from a palette that includes transparent variants; copying CSS colors with alpha channels; frontends sending rgba(...) values.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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