goharbor/harbor · error

empty UUID to delete

Error message

empty UUID to delete

What it means

Guard in scanner basicManager.Delete: registrationUUID is empty, so no registration can be deleted without its UUID.

Solutions

  1. Pass the registration UUID from the API path
  2. Validate the path parameter earlier in the handler
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/pkg/scan/scanner/manager.go:142 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/72c0eb252d4a9555. Report an issue: GitHub.

Appendix: source

Thrown at src/pkg/scan/scanner/manager.go:142

	if registration == nil {
		return errors.New("nil registration to update")
	}

	if err := registration.Validate(true); err != nil {
		return errors.Wrap(err, "update registration")
	}

	if err := encryptCredential(registration); err != nil {
		return errors.Wrap(err, "encrypt credential: update registration")
	}

	return scanner.UpdateRegistration(ctx, registration)
}

// Delete ...
func (bm *basicManager) Delete(ctx context.Context, registrationUUID string) error {
	if len(registrationUUID) == 0 {
		return errors.New("empty UUID to delete")
	}

	return scanner.DeleteRegistration(ctx, registrationUUID)
}

// List ...
func (bm *basicManager) List(ctx context.Context, query *q.Query) ([]*scanner.Registration, error) {
	regs, err := scanner.ListRegistrations(ctx, query)
	if err != nil {
		return nil, err
	}
	for _, r := range regs {
		if err := decryptCredential(r); err != nil {
			return nil, errors.Wrap(err, "decrypt credential: list registrations")
		}
	}
	return regs, nil
}

View on GitHub (pinned to 7b2fd08cc5)