mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-21 08:15:23 -04:00
[GH-ISSUE #203] Flow creation fails with "failed to get primary docker image: network error: failed to reach API server" even though OpenAI API works #78
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lockens on GitHub (Mar 12, 2026).
Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/203
Problem
Creating a new flow fails with:
failed to get primary docker image: network error: failed to reach API server
The flow is written to the database but the worker container never starts.
Environment
PentAGI: 1.1.0-e97bbe5
Host: Kali Linux
Docker: 27.5.1
Install method: docker-compose
OpenAI connectivity test
OpenAI API is reachable from both the main container and worker containers.
Example test from container:
wget -S -qO- --header="Authorization: Bearer $OPEN_AI_KEY" https://api.openai.com/v1/models
Result:
HTTP/1.1 200 OK
Configuration
.env
OPEN_AI_KEY=***
OPEN_AI_SERVER_URL=https://api.openai.com/v1
LLM_SERVER_PROVIDER=openai
LLM_SERVER_MODEL=gpt-4o-mini
LLM_SERVER_URL=https://api.openai.com/v1
LLM_SERVER_KEY=***
DOCKER_ENV_LLM_SERVER_PROVIDER=openai
DOCKER_ENV_LLM_SERVER_MODEL=gpt-4o-mini
DOCKER_ENV_LLM_SERVER_URL=https://api.openai.com/v1
DOCKER_ENV_LLM_SERVER_KEY=***
Logs
flow created in DB flow_id=11 provider_name=openai provider_type=openai
failed to get flow provider
error="failed to get primary docker image: network error: failed to reach API server"
graphql request handled with errors
createAssistant failed to create flow worker
Observation
Worker containers start but environment variables appear empty:
LLM_SERVER_URL=
LLM_SERVER_MODEL=
LLM_SERVER_PROVIDER=
LLM_SERVER_KEY=
Even though they are correctly set in the main container.
Question
Is this related to the automatic Docker image selection step, or is there additional configuration required for worker containers to inherit
LLM_SERVER_*variables?@lockens commented on GitHub (Mar 12, 2026):
Additional debug information.
PentAGI logs
@asdek commented on GitHub (Mar 19, 2026):
hey @lockens
thanks for the detailed report! i can see the issue now.
the problem: your
.envconfiguration mixes native OpenAI setup with custom provider settings, and includes unsupportedDOCKER_ENV_*variables that don't exist in PentAGI's configuration system.solution:
remove all
DOCKER_ENV_*variables - these are not part of PentAGI's standard configuration and should be deleted from your.envfilechoose one configuration approach based on your setup:
option A: native OpenAI (recommended for verified organizations)
option B: custom provider (for unverified OpenAI organizations)
if your OpenAI account doesn't have access to latest reasoning models (o1, o3, o4-mini), use this instead:
see the unverified organizations guide for details.
note:
LLM_SERVER_PROVIDER=openaiis only needed when using LiteLLM proxy where model names have prefixes likeopenai/gpt-4o-mini. if you're connecting directly to OpenAI's API, don't use this variable.this will verify that all agents can connect to your LLM provider correctly.
let me know if you still see the network error after these changes!