Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(docker): report a failed container start as a start failure

Yudhi Armyndharisc0df715cd525
diff --git a/src/modules/docker/docker.service.spec.ts b/src/modules/docker/docker.service.spec.ts
index f218a30b6..322e9444c 100644
--- a/src/modules/docker/docker.service.spec.ts
+++ b/src/modules/docker/docker.service.spec.ts
@@ -757,7 +757,7 @@ describe('DockerService.orchestrateProfiles', () => {
expect(result.success).toBe(true);
expect(result.containersStarted).toEqual(['postgres']);
expect(result.errors).toEqual([
- "Service 'redis' container not found. It may need to be created first with docker-compose.",
+ "Failed to create or start the 'redis' container; see the server log for the Docker error.",
]);
expect(result.message).toBe(result.errors.join('; '));
});
diff --git a/src/modules/docker/docker.service.ts b/src/modules/docker/docker.service.ts
index d61efa8a9..1ccc40134 100644
--- a/src/modules/docker/docker.service.ts
+++ b/src/modules/docker/docker.service.ts
@@ -458,7 +458,7 @@ export class DockerService implements OnModuleInit {
const profile = serviceToProfile[service] || service;
if (!container) {
- // Container doesn't exist - create it using docker-compose
+ // Container doesn't exist - create it from the managed spec
this.logger.log(`Container for service '${service}' not found, creating...`);
return this.createService(profile);
}
@@ -595,9 +595,9 @@ export class DockerService implements OnModuleInit {
if (started) {
result.containersStarted.push(profile);
} else {
- // Container might not exist yet - this is expected for first-time setup
+ // startService creates a missing container, so false means the pull, create or start failed.
result.errors.push(
- `Service '${profile}' container not found. It may need to be created first with docker-compose.`,
+ `Failed to create or start the '${profile}' container; see the server log for the Docker error.`,
);
}
} catch (error) {