Files
n8n/packages/testing/containers/docker-image-not-found-error.ts
alighasami 3d5eaf9445
Some checks failed
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
first commit
2026-03-17 16:22:57 +03:30

25 lines
997 B
TypeScript

import { TEST_CONTAINER_IMAGES } from './test-containers';
// Custom error class for when the Docker image is not found locally/remotely
// This can happen when using the "n8nio/n8n:local" image, which is not available on Docker Hub
// This image is available after running `pnpm build:docker` at the root of the repository
export class DockerImageNotFoundError extends Error {
constructor(containerName: string, originalError?: Error) {
const dockerImage = TEST_CONTAINER_IMAGES.n8n;
const message = `Failed to start container ${containerName}: Docker image '${dockerImage}' not found locally!
This is likely because the image is not available locally.
To fix this, you can either:
1. Build the image by running: pnpm build:docker at the root
2. Use a different image by setting: TEST_IMAGE_N8N=<image-tag>
Example with different image:
TEST_IMAGE_N8N=n8nio/n8n:latest npm run stack`;
super(message);
this.name = 'DockerImageNotFoundError';
this.cause = originalError;
}
}