n8n-io/n8n · error

Failed to read

Error message

Failed to read ${resourceLabel(options).toLowerCase()} "${filePath}": ${formatErrorForLog(error)}

What it means

readWorkspaceFile caught an error from the filesystem provider that was NOT a missing-file condition (transient sandbox I/O included its own retry already). It deliberately rethrows a formatted error with the resource label and path instead of returning null, so provider outages are not misread as absent files.

Solutions

  1. Read the chained error to identify the provider failure
  2. Retry the read once sandbox/filesystem health is restored
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/@n8n/instance-ai/src/workspace/workspace-files.ts:80 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/e0f652f50c8ad229. Report an issue: GitHub.

Appendix: source

Thrown at packages/@n8n/instance-ai/src/workspace/workspace-files.ts:80

	const readFile = filesystem?.readFile;
	if (filesystem && readFile) {
		try {
			return decodeWorkspaceFileContent(
				await retryTransientSandboxIo(
					// .call preserves the provider's `this` binding (e.g. LazyRuntimeFilesystem).
					async () =>
						await readFile.call(filesystem, filePath, {
							encoding: 'utf-8',
							abortSignal: options?.abortSignal,
						}),
					filePath,
					options,
				),
			);
		} catch (error) {
			// A provider failure is not a missing file — surface it instead of reporting null.
			if (isTransientSandboxIoError(error)) {
				throw new Error(
					`Failed to read ${resourceLabel(options).toLowerCase()} "${filePath}": ${formatErrorForLog(error)}`,
					{ cause: error },
				);
			}
			options?.logger.debug(`${resourceLabel(options)} filesystem read missed`, {
				path: filePath,
				error: formatErrorForLog(error),
			});
			return null;
		}
	}

	if (!workspace.sandbox) return null;

	try {
		return await readFileViaSandbox(workspace, filePath, options);
	} catch (error) {
		if (isTransientSandboxIoError(error)) {

View on GitHub (pinned to 5ac6606e81)