theonedev/onedev · error · ExplicitException
Storage not found for project: ${path}
Error message
Storage not found for project: ${path} What it means
OneDev throws this ExplicitException when a project's storage cannot be located on any active server. Project.getStorage() (or similar accessor) resolves the active server via ProjectService.getActiveServer(); if none is found and the caller demands existence (mustExist=true), it aborts with this message. It typically means the project's data directory is missing or the cluster state is inconsistent.
Source
Thrown at server-core/src/main/java/io/onedev/server/model/Project.java:2048
Blob blob = getBlob(blobIdent, true);
if (blob.getLfsPointer() != null) {
return new LfsObject(getId(), blob.getLfsPointer().getObjectId())
.detectMediaType(blobIdent.getName());
} else {
return blob.getMediaType();
}
}
@Nullable
public String getActiveServer(boolean mustExist) {
if (activeServer == null) {
activeServer = Optional.fromNullable(
getProjectService().getActiveServer(getId(), false));
}
if (activeServer.isPresent())
return activeServer.get();
else if (mustExist)
throw new ExplicitException("Storage not found for project: " + getPath());
else
return null;
}
@Nullable
public String findExcludedAiReviewFiles() {
Project current = this;
do {
if (current.getAiSetting().getExcludedReviewFiles() != null)
return current.getAiSetting().getExcludedReviewFiles();
current = current.getParent();
} while (current != null);
return null;
}
public String findCodeAnalysisFiles() {
Project current = this;View on GitHub (pinned to d44925c47c)
Solutions
- Verify the project's storage directory exists under the server's site storage dir (server product dir /projects/...) and restore it if missing
- Check cluster/server status: ensure the server that hosts this project's storage is running and registered as active
- Re-run OneDev's storage consistency check / re-import the project, or delete and recreate the project if data is unrecoverable
- If the project was renamed or moved externally, revert the change and use OneDev's own project move/rename feature
Example fix
// before (accessing storage of a possibly missing project)
byte[] bytes = project.getStorage();
// after
var storage = project.getStorage(false);
if (storage == null) {
logger.warn("Storage missing for project " + project.getPath());
return;
} Defensive patterns
Strategy: try-catch
Validate before calling
// Java: check storage presence before access
var server = OneDev.getInstance(ProjectService.class).getActiveServer(project.getId(), false);
if (server == null) { /* skip or restore storage */ } Type guard
boolean hasStorage(Project p) {
return OneDev.getInstance(ProjectService.class).getActiveServer(p.getId(), false) != null;
} Try / catch
try {
var storage = project.getStorage();
} catch (ExplicitException e) {
logger.error("Project storage missing: {}", project.getPath(), e);
} Prevention
- Never delete or move project directories on disk directly; use OneDev UI/CLI
- Keep DB and storage backups in sync when restoring
- Monitor cluster node health to avoid orphaned storages
When it happens
Trigger: Calling any project API that accesses storage (e.g. getStorage()) when getActiveServer(getId(), false) returns absent and mustExist=true — i.e. no server currently hosts the project's repository storage.
Common situations: Project directory deleted/moved on disk while DB record remains; after restoring a database backup without the corresponding storage directories; cluster node taken out of service without migrating storages; project path changes not reflected on disk.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Unable to find project to import build spec: {0}
- Project not found:
- Not authorized
- Project not found or inaccessible: ${path}
- Storage directory not found for project id %s
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/a01e04bddf3bc374.
Report an issue: GitHub.