{"record":{"id":"e3a34537cec7641d","repo":"vxcontrol/pentagi","slug":"internal-e3a345","errorCode":"Internal","errorMessage":"docker client not configured on this server","messagePattern":"docker client not configured on this server","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"backend/pkg/server/services/flow_files.go","lineNumber":724,"sourceCode":"\t\t\tresponse.Error(c, response.ErrInternal, statErr)\n\t\t\treturn\n\t\t}\n\t\tentries = append(entries, pullEntry{\n\t\t\tcontainerPath: containerPath,\n\t\t\tcacheRelPath:  cacheRelPath,\n\t\t\tlocalTarget:   localTarget,\n\t\t\ttargetExists:  targetExists,\n\t\t})\n\t}\n\n\tif err := os.MkdirAll(containerDir, 0755); err != nil {\n\t\tlogger.FromContext(c).WithError(err).WithField(\"flow_id\", flowID).Error(\"error creating container cache directory\")\n\t\tresponse.Error(c, response.ErrInternal, err)\n\t\treturn\n\t}\n\n\tif s.dockerClient == nil {\n\t\terr = errors.New(\"docker client not configured on this server\")\n\t\tlogger.FromContext(c).WithError(err).WithField(\"flow_id\", flowID).Error(\"docker client unavailable for pull\")\n\t\tresponse.Error(c, response.ErrInternal, err)\n\t\treturn\n\t}\n\n\tcontainerName := primaryContainerName(s.tenantPrefix, flowID)\n\trunning, err := s.dockerClient.IsContainerRunning(c.Request.Context(), containerName)\n\tif err != nil {\n\t\tlogger.FromContext(c).WithError(err).WithFields(map[string]any{\n\t\t\t\"flow_id\":        flowID,\n\t\t\t\"container_name\": containerName,\n\t\t}).Error(\"error checking container status for pull\")\n\t\tresponse.Error(c, response.ErrInternal, err)\n\t\treturn\n\t}\n\tif !running {\n\t\terr = fmt.Errorf(\"container '%s' is not running; start the flow before pulling files\", containerName)\n\t\tlogger.FromContext(c).WithError(err).WithField(\"flow_id\", flowID).Error(\"container not running for pull\")","sourceCodeStart":706,"sourceCodeEnd":742,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/server/services/flow_files.go#L706-L742","documentation":"PullFlowFiles streams files out of a flow's Docker container. Before doing any Docker work it checks s.dockerClient, and when the service was constructed without a Docker client (e.g. the server is configured without a Docker endpoint) it refuses with this Internal error rather than nil-pointer panicking later.","triggerScenarios":"Calling GET/PULL the flow-files pull endpoint (docker client check at flow_files.go:724) on a server instance whose DockerClient dependency was never set — typically because DOCKER_* env config is missing or Docker is disabled on that deployment.","commonSituations":"Deploying PentAGI on a host without a mounted Docker socket; running the API server locally for UI work with docker endpoints disabled; misconfigured DOCKER_HOST/docker-compose service that skips Docker client initialization; calling the API on a scaled replica that intentionally has no Docker access.","solutions":["Configure the Docker client for the server process (set the Docker endpoint/socket env config and restart) so s.dockerClient is initialized at startup.","Route file-pull requests to a server instance/replica that has Docker configured.","Check server startup logs to confirm the Docker client was created; fix the init error that left it nil.","If Docker is intentionally unavailable in this environment, stop using the flow-files pull API there and fetch files via the worker that owns the container."],"exampleFix":"// before (server constructed without docker)\nservices.NewFlowFilesService(db, nil, tenantPrefix)\n// after (pass configured docker client)\ndockerClient, err := docker.NewClient(cfg)\nif err != nil { log.Fatal(err) }\nservices.NewFlowFilesService(db, dockerClient, tenantPrefix)","handlingStrategy":"validation","validationCode":"// client-side: only call when the deployment has Docker enabled\nif (!window.__serverCapabilities?.docker) {\n  console.warn('docker unavailable on this server; skipping file pull');\n  return;\n}\nawait fetch(`/flows/${flowId}/files/download`);","typeGuard":null,"tryCatchPattern":"try {\n  const res = await pullFlowFiles(flowId);\n  handle(res);\n} catch (e) {\n  if (e.status === 500 && /docker client not configured/.test(e.message)) {\n    showNotice('File download requires a server with Docker access.');\n  } else { throw e; }\n}","preventionTips":["Ensure DOCKER_* env config is set on every server instance that serves flow-files endpoints.","Verify the Docker socket/endpoint at startup and fail fast if Docker is required.","Add a health endpoint that reports Docker availability and surface it in the UI.","Route Docker-dependent API calls only to Docker-capable replicas."],"tags":["docker","configuration","http-api"],"backgroundTag":"docker-client-not-configured","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}