theonedev/onedev · error · NotFoundException

Project not found or inaccessible: ${projectPath}

Error message

Project not found or inaccessible: ${projectPath}

What it means

Shared lookup helper getProject in TodResource: the given project path either matches no project or the current subject lacks read permission, so every tod endpoint that resolves a project aborts with this error.

Source

Thrown at server-core/src/main/java/io/onedev/server/ai/TodResource.java:217

    private Validator validator;

    @Inject
    private ServerConfig serverConfig;

	@Api(description = "Get tod version range compatible with this server")
	@Path("/check-version")
	@GET
	public VersionInfo checkVersion() {
        var versionInfo = new VersionInfo();
        versionInfo.serverVersion = OneDev.getInstance().getVersion();
        versionInfo.minRequiredTodVersion = "4.1.0";
        return versionInfo;
	}

    private Project getProject(String projectPath) {
        var project = projectService.findByPath(projectPath);
        if (project == null || !SecurityUtils.canAccessProject(project))
            throw new NotFoundException("Project not found or inaccessible: " + projectPath);
        return project;
    }

    private ProjectContext getProjectContext(String projectPath, String currentProjectPath) {
        if (projectPath == null) 
            projectPath = currentProjectPath;

        var projectContext = new ProjectContext();
        projectContext.project = getProject(projectPath);
        projectContext.currentProject = getProject(currentProjectPath);
        
        return projectContext;
    }

    private Map<String, Object> getFieldProperties(FieldSpec field) {
        var fieldProperties = new HashMap<>(IssueHelper.getFieldProperties(field));
        fieldProperties.put("description", escapeHtml5((String) fieldProperties.get("description")));
        return fieldProperties;

View on GitHub (pinned to d44925c47c)

Solutions

  1. Check the project path spelling and that the project exists.
  2. Authenticate as a user with read access to the project.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at server-core/src/main/java/io/onedev/server/ai/TodResource.java:217 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06). Data as JSON: /api/errors/85751395fda84274. Report an issue: GitHub.