Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(self-host): make FoundationDB init idempotent (#4274)

Ievgen Bondarenko448ef4bf815d
diff --git a/apps/api/src/harness.ts b/apps/api/src/harness.ts
index 6bd8e00a0..7c1421f81 100644
--- a/apps/api/src/harness.ts
+++ b/apps/api/src/harness.ts
@@ -748,7 +748,7 @@ async function setupFdb(): Promise<Services["fdb"]> {
// configured" failure and surface any real configure error.
const configure = execForward(
`${runtime}@fdb-configure`,
- `${runtime} exec ${containerName} sh -c 'out=$(fdbcli --exec "configure new single memory" 2>&1); status=$?; printf "%s\\n" "$out"; if [ "$status" -eq 0 ]; then exit 0; fi; printf "%s\\n" "$out" | grep -Eiq "already.*configured|database.*configured"'`,
+ `${runtime} exec ${containerName} sh -c 'out=$(fdbcli --exec "configure new single memory" 2>&1); status=$?; printf "%s\\n" "$out"; if [ "$status" -eq 0 ]; then exit 0; fi; printf "%s\\n" "$out" | grep -Eiq "already.*configured|database.*configured|database.*already exists"'`,
);
await configure.promise;
diff --git a/docker-compose.yaml b/docker-compose.yaml
index e2ade0104..233f44bc3 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -203,7 +203,7 @@ services:
entrypoint:
- /bin/bash
- -c
- - "sleep 5 && out=$(fdbcli -C /var/fdb/fdb.cluster --exec 'configure new single ssd' 2>&1); status=$$?; printf '%s\n' \"$$out\"; if [ \"$$status\" -eq 0 ]; then exit 0; fi; printf '%s\n' \"$$out\" | grep -Eiq 'already.*configured|database.*configured'"
+ - "sleep 5 && out=$(fdbcli -C /var/fdb/fdb.cluster --exec 'configure new single ssd' 2>&1); status=$$?; printf '%s\n' \"$$out\"; if [ \"$$status\" -eq 0 ]; then exit 0; fi; printf '%s\n' \"$$out\" | grep -Eiq 'already.*configured|database.*configured|database.*already exists'"
volumes:
- fdb-cluster-file:/var/fdb
networks: