The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
Fix embedded Postgres initdb failure in Docker slim containers
dotta5602576ae1a9
diff --git a/cli/src/__tests__/company-import-export-e2e.test.ts b/cli/src/__tests__/company-import-export-e2e.test.tsindex 82f1f1ca0d..27334105a3 100644--- a/cli/src/__tests__/company-import-export-e2e.test.ts+++ b/cli/src/__tests__/company-import-export-e2e.test.ts@@ -63,7 +63,7 @@ async function startTempDatabase() {password: "paperclip",port,persistent: true,- initdbFlags: ["--encoding=UTF8", "--locale=C"],+ initdbFlags: ["--encoding=UTF8", "--locale=C", "--lc-messages=C"],onLog: () => {},onError: () => {},});diff --git a/cli/src/commands/worktree.ts b/cli/src/commands/worktree.tsindex 877f6bddce..7a2bd127fd 100644--- a/cli/src/commands/worktree.ts+++ b/cli/src/commands/worktree.ts@@ -756,7 +756,7 @@ async function ensureEmbeddedPostgres(dataDir: string, preferredPort: number): Ppassword: "paperclip",port,persistent: true,- initdbFlags: ["--encoding=UTF8", "--locale=C"],+ initdbFlags: ["--encoding=UTF8", "--locale=C", "--lc-messages=C"],onLog: () => {},onError: () => {},});diff --git a/package.json b/package.jsonindex 0f5c23ad07..749cc8d0cf 100644--- a/package.json+++ b/package.json@@ -35,8 +35,8 @@"test:release-smoke:headed": "npx playwright test --config tests/release-smoke/playwright.config.ts --headed"},"devDependencies": {- "cross-env": "^10.1.0","@playwright/test": "^1.58.2",+ "cross-env": "^10.1.0","esbuild": "^0.27.3","typescript": "^5.7.3","vitest": "^3.0.5"@@ -44,5 +44,10 @@"engines": {"node": ">=20"},- "packageManager": "[email protected]"+ "packageManager": "[email protected]",+ "pnpm": {+ "patchedDependencies": {+ "[email protected]": "patches/[email protected]"+ }+ }}diff --git a/packages/db/src/client.test.ts b/packages/db/src/client.test.tsindex 9a86a7b38f..752fce157f 100644--- a/packages/db/src/client.test.ts+++ b/packages/db/src/client.test.ts@@ -67,7 +67,7 @@ async function createTempDatabase(): Promise<string> {password: "paperclip",port,persistent: true,- initdbFlags: ["--encoding=UTF8", "--locale=C"],+ initdbFlags: ["--encoding=UTF8", "--locale=C", "--lc-messages=C"],onLog: () => {},onError: () => {},});diff --git a/packages/db/src/migration-runtime.ts b/packages/db/src/migration-runtime.tsindex 3b5921b14d..921de612a3 100644--- a/packages/db/src/migration-runtime.ts+++ b/packages/db/src/migration-runtime.ts@@ -150,7 +150,7 @@ async function ensureEmbeddedPostgresConnection(password: "paperclip",port: selectedPort,persistent: true,- initdbFlags: ["--encoding=UTF8", "--locale=C"],+ initdbFlags: ["--encoding=UTF8", "--locale=C", "--lc-messages=C"],onLog: () => {},onError: () => {},});diff --git a/patches/[email protected] b/patches/[email protected]new file mode 100644index 0000000000..0f25ff3966--- /dev/null+++ b/patches/[email protected]@@ -0,0 +1,22 @@+diff --git a/dist/index.js b/dist/index.js+index ccfe17a82f4879bf20cc345c579a987d9eba5309..dd689f5908f625f49b4785318daea736aa88927f 100644+--- a/dist/index.js++++ b/dist/index.js+@@ -133,7 +133,7 @@ class EmbeddedPostgres {+ `--pwfile=${passwordFile}`,+ `--lc-messages=${LC_MESSAGES_LOCALE}`,+ ...this.options.initdbFlags,+- ], Object.assign(Object.assign({}, permissionIds), { env: { LC_MESSAGES: LC_MESSAGES_LOCALE } }));++ ], Object.assign(Object.assign({}, permissionIds), { env: Object.assign(Object.assign({}, process.env), { LC_MESSAGES: LC_MESSAGES_LOCALE }) }));+ // Connect to stderr, as that is where the messages get sent+ (_a = process.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (chunk) => {+ // Parse the data as a string and log it+@@ -177,7 +177,7 @@ class EmbeddedPostgres {+ '-p',+ this.options.port.toString(),+ ...this.options.postgresFlags,+- ], Object.assign(Object.assign({}, permissionIds), { env: { LC_MESSAGES: LC_MESSAGES_LOCALE } }));++ ], Object.assign(Object.assign({}, permissionIds), { env: Object.assign(Object.assign({}, process.env), { LC_MESSAGES: LC_MESSAGES_LOCALE }) }));+ // Connect to stderr, as that is where the messages get sent+ (_a = this.process.stderr) === null || _a === void 0 ? void 0 : _a.on('data', (chunk) => {+ // Parse the data as a string and log itdiff --git a/server/src/__tests__/heartbeat-process-recovery.test.ts b/server/src/__tests__/heartbeat-process-recovery.test.tsindex a5742f420e..d0e3cc31a0 100644--- a/server/src/__tests__/heartbeat-process-recovery.test.ts+++ b/server/src/__tests__/heartbeat-process-recovery.test.ts@@ -72,7 +72,7 @@ async function startTempDatabase() {password: "paperclip",port,persistent: true,- initdbFlags: ["--encoding=UTF8", "--locale=C"],+ initdbFlags: ["--encoding=UTF8", "--locale=C", "--lc-messages=C"],onLog: () => {},onError: () => {},});diff --git a/server/src/__tests__/issues-service.test.ts b/server/src/__tests__/issues-service.test.tsindex 70b99ba8f2..ba27866f54 100644--- a/server/src/__tests__/issues-service.test.ts+++ b/server/src/__tests__/issues-service.test.ts@@ -68,7 +68,7 @@ async function startTempDatabase() {password: "paperclip",port,persistent: true,- initdbFlags: ["--encoding=UTF8", "--locale=C"],+ initdbFlags: ["--encoding=UTF8", "--locale=C", "--lc-messages=C"],onLog: () => {},onError: () => {},});diff --git a/server/src/__tests__/routines-e2e.test.ts b/server/src/__tests__/routines-e2e.test.tsindex 301f045f4f..836897243c 100644--- a/server/src/__tests__/routines-e2e.test.ts+++ b/server/src/__tests__/routines-e2e.test.ts@@ -130,7 +130,7 @@ async function startTempDatabase() {password: "paperclip",port,persistent: true,- initdbFlags: ["--encoding=UTF8", "--locale=C"],+ initdbFlags: ["--encoding=UTF8", "--locale=C", "--lc-messages=C"],onLog: () => {},onError: () => {},});diff --git a/server/src/__tests__/routines-service.test.ts b/server/src/__tests__/routines-service.test.tsindex ee2e261ed3..d59542468f 100644--- a/server/src/__tests__/routines-service.test.ts+++ b/server/src/__tests__/routines-service.test.ts@@ -76,7 +76,7 @@ async function startTempDatabase() {password: "paperclip",port,persistent: true,- initdbFlags: ["--encoding=UTF8", "--locale=C"],+ initdbFlags: ["--encoding=UTF8", "--locale=C", "--lc-messages=C"],onLog: () => {},onError: () => {},});diff --git a/server/src/index.ts b/server/src/index.tsindex eb0964ee17..d47d66742f 100644--- a/server/src/index.ts+++ b/server/src/index.ts@@ -347,7 +347,7 @@ export async function startServer(): Promise<StartedServer> {password: "paperclip",port,persistent: true,- initdbFlags: ["--encoding=UTF8", "--locale=C"],+ initdbFlags: ["--encoding=UTF8", "--locale=C", "--lc-messages=C"],onLog: appendEmbeddedPostgresLog,onError: appendEmbeddedPostgresLog,});