Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ dev: ensure-langflow-data ensure-backend-volumes ## Start full stack with GPU su

dev-cpu: ensure-langflow-data ensure-backend-volumes ## Start full stack with CPU only
@echo "$(YELLOW)Starting OpenRAG with CPU only...$(NC)"
$(COMPOSE_CMD) up -d
$(COMPOSE_CMD) up -d --build
@echo "$(PURPLE)Services started!$(NC)"
@echo " $(CYAN)Backend:$(NC) http://openrag-backend"
@echo " $(CYAN)Frontend:$(NC) http://localhost:3000"
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ services:
- discovery.type=single-node
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD}
- OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g
entrypoint:
- /bin/bash
- -c
- "/usr/share/opensearch/opensearch-docker-entrypoint.sh opensearch & /usr/share/opensearch/setup-security.sh; wait"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fail fast when setup-security.sh fails (currently failure is ignored).

At Line 17, setup-security.sh is followed by ; wait, so a failed security setup does not fail container startup. That can leave OpenSearch running without OIDC/JWT config while appearing up.

Suggested fix
-      - "/usr/share/opensearch/opensearch-docker-entrypoint.sh opensearch & /usr/share/opensearch/setup-security.sh; wait"
+      - "/usr/share/opensearch/opensearch-docker-entrypoint.sh opensearch & os_pid=$$!; /usr/share/opensearch/setup-security.sh || { kill $$os_pid; wait $$os_pid; exit 1; }; wait $$os_pid"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker-compose.yml` at line 17, The container startup currently ignores
failures from setup-security.sh because the command uses a semicolon and a
trailing wait; change the startup command so that a failure in
/usr/share/opensearch/setup-security.sh causes the container to exit (e.g.,
chain the scripts with && or enable exit-on-error before running them) so that
"/usr/share/opensearch/opensearch-docker-entrypoint.sh opensearch" runs only if
setup-security.sh succeeds; update the invocation around
opensearch-docker-entrypoint.sh and setup-security.sh to use a failing-safe
chain (for example replace the semicolon with && or add set -e) so
setup-security.sh failures are not ignored.

# NOTE: do NOT add `extra_hosts: openrag-backend:host-gateway` here.
# `extra_hosts` writes to /etc/hosts, which libc resolves BEFORE
# docker DNS — so the alias overrides docker-compose service-name
Expand Down
Loading