vxcontrol/pentagi · error

Internal

Internal

Error message

docker client not configured on this server

What it means

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.

Source

Thrown at backend/pkg/server/services/flow_files.go:724

			response.Error(c, response.ErrInternal, statErr)
			return
		}
		entries = append(entries, pullEntry{
			containerPath: containerPath,
			cacheRelPath:  cacheRelPath,
			localTarget:   localTarget,
			targetExists:  targetExists,
		})
	}

	if err := os.MkdirAll(containerDir, 0755); err != nil {
		logger.FromContext(c).WithError(err).WithField("flow_id", flowID).Error("error creating container cache directory")
		response.Error(c, response.ErrInternal, err)
		return
	}

	if s.dockerClient == nil {
		err = errors.New("docker client not configured on this server")
		logger.FromContext(c).WithError(err).WithField("flow_id", flowID).Error("docker client unavailable for pull")
		response.Error(c, response.ErrInternal, err)
		return
	}

	containerName := primaryContainerName(s.tenantPrefix, flowID)
	running, err := s.dockerClient.IsContainerRunning(c.Request.Context(), containerName)
	if err != nil {
		logger.FromContext(c).WithError(err).WithFields(map[string]any{
			"flow_id":        flowID,
			"container_name": containerName,
		}).Error("error checking container status for pull")
		response.Error(c, response.ErrInternal, err)
		return
	}
	if !running {
		err = fmt.Errorf("container '%s' is not running; start the flow before pulling files", containerName)
		logger.FromContext(c).WithError(err).WithField("flow_id", flowID).Error("container not running for pull")

View on GitHub (pinned to ea665308ba)

Solutions

  1. Configure the Docker client for the server process (set the Docker endpoint/socket env config and restart) so s.dockerClient is initialized at startup.
  2. Route file-pull requests to a server instance/replica that has Docker configured.
  3. Check server startup logs to confirm the Docker client was created; fix the init error that left it nil.
  4. 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.

Example fix

// before (server constructed without docker)
services.NewFlowFilesService(db, nil, tenantPrefix)
// after (pass configured docker client)
dockerClient, err := docker.NewClient(cfg)
if err != nil { log.Fatal(err) }
services.NewFlowFilesService(db, dockerClient, tenantPrefix)
Defensive patterns

Strategy: validation

Validate before calling

// client-side: only call when the deployment has Docker enabled
if (!window.__serverCapabilities?.docker) {
  console.warn('docker unavailable on this server; skipping file pull');
  return;
}
await fetch(`/flows/${flowId}/files/download`);

Try / catch

try {
  const res = await pullFlowFiles(flowId);
  handle(res);
} catch (e) {
  if (e.status === 500 && /docker client not configured/.test(e.message)) {
    showNotice('File download requires a server with Docker access.');
  } else { throw e; }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01). Data as JSON: /api/errors/e3a34537cec7641d. Report an issue: GitHub.