RocketChat/Rocket.Chat · error · Error
Invalid path configured for file system App storage
Error message
Invalid path configured for file system App storage
What it means
Thrown by `AppFileSystemSourceStorage.checkPath()` when `this.path` is falsy (never set). The file-system source storage needs a base directory to read/write app bundles; without it, `store`/`update`/`remove` cannot resolve a target filename. It is a configuration error: `setPath()` must be called before any storage operation.
Source
Thrown at apps/meteor/ee/server/apps/storage/AppFileSystemSourceStorage.ts:18
import { promises as fs } from 'node:fs';
import { join, normalize } from 'node:path';
import { AppSourceStorage } from '@rocket.chat/apps/dist/server/storage/AppSourceStorage';
import type { IAppStorageItem } from '@rocket.chat/apps/dist/server/storage/IAppStorageItem';
export class AppFileSystemSourceStorage extends AppSourceStorage {
private pathPrefix = 'fs:/';
private path: string;
public setPath(path: string): void {
this.path = path;
}
public checkPath(): void {
if (!this.path) {
throw new Error('Invalid path configured for file system App storage');
}
}
public async store(item: IAppStorageItem, zip: Buffer): Promise<string> {
this.checkPath();
const filePath = this.itemToFilename(item);
await fs.writeFile(filePath, zip);
return this.filenameToSourcePath(filePath);
}
public async fetch(item: IAppStorageItem): Promise<Buffer> {
if (!item.sourcePath) {
throw new Error('Invalid source path');
}
View on GitHub (pinned to f9d3ec372b)
Solutions
- Ensure the Apps storage path setting is set (e.g. `App_Source_Package_Storage_Path`) and non-empty before the orchestrator initializes storage.
- Call `storage.setPath(absolutePath)` in setup code before invoking any storage operation.
- Verify the directory exists and the process has read/write permissions to it.
Example fix
// before
const storage = new AppFileSystemSourceStorage();
await storage.store(item, zip); // throws: path not set
// after
const storage = new AppFileSystemSourceStorage();
storage.setPath('/var/rocket.chat/app-sources');
await storage.store(item, zip); Defensive patterns
Strategy: validation
Validate before calling
function hasStoragePath(storage: AppFileSystemSourceStorage): boolean {
// reflect on whether setPath was called; safest is to always set it in setup
return Boolean(process.env.APP_SOURCE_STORAGE_PATH);
} Type guard
null
Try / catch
if (!process.env.APP_SOURCE_STORAGE_PATH) {
throw new Error('APP_SOURCE_STORAGE_PATH must be configured');
}
storage.setPath(process.env.APP_SOURCE_STORAGE_PATH);
try {
await storage.store(item, zip);
} catch (e) {
if (e instanceof Error && e.message.includes('Invalid path configured')) {
// fix configuration then retry
}
throw e;
} Prevention
- Always call `setPath()` during storage initialization, before any operation.
- Validate the configured path exists and is writable at startup.
- Fail fast at boot if the Apps storage path setting is empty.
When it happens
Trigger: Invoking `store()`, `update()`, or `remove()` on an `AppFileSystemSourceStorage` instance before `setPath(path)` has been called, leaving `this.path` undefined.
Common situations: Misconfigured Apps engine storage (the `App_Source_Package_Storage_Path` setting is empty); a test or custom orchestrator constructing the storage directly without wiring the path; migration where the storage path env var was dropped.
Related errors
- Invalid source path
- App already exists.
- apps-engine-not-configured-correctly
- error-essential-app-disabled
- Invalid Api parameter provided, it must be a valid IApi obje
AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12).
Data as JSON: /api/errors/25c23faa5fc53d24.
Report an issue: GitHub.