goharbor/harbor · error

project %v not found

Error message

project %v not found

What it means

Error "project %v not found" thrown in goharbor/harbor.

Source

Thrown at src/core/api/base.go:121

		} else {
			b.SendError(err)
		}
		return false
	}

	if !hasPermission {
		b.SendPermissionError()
		return false
	}

	return true
}

// This should be called when a project is not found, if the caller is a system admin it returns 404.
// If it's regular user, it will render permission error
func (b *BaseController) handleProjectNotFound(projectIDOrName any) {
	if b.SecurityCtx.IsSysAdmin() {
		b.SendNotFoundError(fmt.Errorf("project %v not found", projectIDOrName))
	} else {
		b.SendPermissionError()
	}
}

// SendPermissionError is a shortcut for sending different http error based on authentication status.
func (b *BaseController) SendPermissionError() {
	if !b.SecurityCtx.IsAuthenticated() {
		b.SendUnAuthorizedError(errors.New("UnAuthorized"))
	} else {
		b.SendForbiddenError(errors.New(b.SecurityCtx.GetUsername()))
	}
}

// WriteJSONData writes the JSON data to the client.
func (b *BaseController) WriteJSONData(object any) {
	b.Data["json"] = object
	if err := b.ServeJSON(); err != nil {

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/core/api/base.go:121 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/65dfc7b9226eccd0. Report an issue: GitHub.