goharbor/harbor · error

nil registration to update

Error message

nil registration to update

What it means

Guard in scanner basicManager.Update: the registration argument is nil, so there is no registration to update.

Solutions

  1. Pass the modified registration including its UUID
  2. Verify the API handler decoded the update request body
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/pkg/scan/scanner/manager.go:125 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/ce8c864b62d859fd. Report an issue: GitHub.

Appendix: source

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

		return nil, errors.New("empty uuid of registration")
	}

	r, err := scanner.GetRegistration(ctx, registrationUUID)
	if err != nil {
		return nil, err
	}
	if r != nil {
		if err := decryptCredential(r); err != nil {
			return nil, errors.Wrap(err, "decrypt credential: get registration")
		}
	}
	return r, nil
}

// Update ...
func (bm *basicManager) Update(ctx context.Context, registration *scanner.Registration) error {
	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")
	}

View on GitHub (pinned to 7b2fd08cc5)