{"record":{"id":"4fdbc8b4210bb57d","repo":"theonedev/onedev","slug":"workspace-not-found","errorCode":null,"errorMessage":"Workspace not found","messagePattern":"Workspace not found","errorType":"exception","errorClass":"EntityNotFoundException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailPage.java","lineNumber":108,"sourceCode":"\tprotected SettingService settingService;\n\n\tprivate Workspace.Status workspaceStatus;\n\n\tpublic WorkspaceDetailPage(PageParameters params) {\n\t\tsuper(params);\n\n\t\tString workspaceNumberString = params.get(PARAM_WOPKSPACE).toString();\n\t\tif (StringUtils.isBlank(workspaceNumberString))\n\t\t\tthrow new RestartResponseException(ProjectOverviewPage.class, ProjectOverviewPage.paramsOf(getProject().getId()));\n\n\t\tworkspaceModel = new LoadableDetachableModel<Workspace>() {\n\n\t\t\t@Override\n\t\t\tprotected Workspace load() {\n\t\t\t\tLong workspaceNumber = Long.parseLong(workspaceNumberString);\n\t\t\t\tWorkspace workspace = workspaceService.find(getProject(), workspaceNumber);\n\t\t\t\tif (workspace == null)\n\t\t\t\t\tthrow new EntityNotFoundException(_T(\"Workspace not found\"));\n\t\t\t\tif (!workspace.getProject().equals(getProject()))\n\t\t\t\t\tthrow new RestartResponseException(WorkspaceDefaultPage.class, paramsOf(workspace));\n\t\t\t\treturn workspace;\n\t\t\t}\n\n\t\t};\n\t}\n\n\tpublic Workspace getWorkspace() {\n\t\treturn workspaceModel.getObject();\n\t}\n\n\t@Override\n\tprotected boolean isPermitted() {\n\t\treturn SecurityUtils.canCreateWorkspaces(getProject());\n\t}\n\n\t@Override","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/page/project/workspaces/detail/WorkspaceDetailPage.java#L90-L126","documentation":"WorkspaceDetailPage's LoadableDetachableModel loads the workspace by project and workspace number. If workspaceService.find returns null (no workspace with that number in this project), it throws EntityNotFoundException with the localized message 'Workspace not found', which renders as an error page instead of showing the detail view.","triggerScenarios":"Visiting a WorkspaceDetailPage URL with a workspaceNumberString that does not resolve to a workspace under the current project — e.g. a stale bookmark after the workspace was deleted, or a mistyped/foreign workspace number.","commonSituations":"Bookmarked or shared workspace links pointing at a deleted workspace; URL copied from another project; number re-parse yielding a different workspace after data migration.","solutions":["Confirm the workspace still exists under Project > Workspaces and use its current number in the URL.","Recreate the workspace if it was deleted and you still need it.","Navigate from the workspace list page instead of a stale URL.","Check the URL's project path matches the project that owns the workspace number."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"Workspace ws = workspaceService.find(project, workspaceNumber);\nif (ws == null) { /* redirect to workspace list */ }","typeGuard":null,"tryCatchPattern":"try {\n  page = new WorkspaceDetailPage(params);\n} catch (EntityNotFoundException e) {\n  setResponsePage(WorkspaceListPage.class);\n}","preventionTips":["Generate workspace links dynamically, never hardcode numbers.","Handle deleted workspaces gracefully by linking to the list page.","Validate workspace number parameters before deep-linking.","Clean up bookmarks after workspace deletion."],"tags":["wicket","entity-not-found","workspace"],"backgroundTag":"entity-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}