#3806·floci

[BUG] ECS: volumesFrom is not applied, so a container whose entrypoint comes from the source container cannot start

Author: MicDuff1Created Sep 17, 2026Updated Sep 17, 2026
Labelsbugecs

Use case

A non-essential sidecar image carries the agent binary in a volume, the application container mounts it with volumesFrom and its entryPoint is that binary, which then execs the real command.

Summary of the bug

A task definition where one container shares a volume via volumesFrom and the other container's entryPoint is a file inside that volume never starts. Floci creates the target container and then fails to start it, because the shared volume's content is not there. The service reconciler immediately starts the next task, so the service never becomes stable and ECS containers accumulate without bound (by the way: the containers Floci creates for ECS tasks are never removed automatically) .

Service

ECS

AWS API Action

ECS CreateService respectively running service

Expected behavior

The /shared volume the sidecar declares is mounted into the app container, so the app's entryPoint /shared/wrapper exists, the task runs, runningCount reaches 1

Actual behavior

runningCount stays 0. The app container is created but cannot start (stat /shared/wrapper: no such file or directory), and the reconciler replaces the task continually — 11 further containers within 50 seconds in the measurement above, 94 in an eight-minute run of the real workload.

ERROR [io.git.hec.flo.ser.ecs.EcsService] Failed to start ECS task arn:aws:ecs:eu-central-1:000000000000:task/sidecar-demo/8caa92e0aad043478d7f2bbdc90f6216: Status 400: {"message":"failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: \"/shared/wrapper\": stat /shared/wrapper: no such file or directory"}

Reproduction

bash
# 1. A sidecar image that publishes an executable in a volume
mkdir repro && cd repro
cat > Dockerfile <<'EOF'
FROM busybox:latest
RUN mkdir -p /shared && printf '#!/bin/sh\nexec "$@"\n' > /shared/wrapper && chmod +x /shared/wrapper
VOLUME /shared
EOF
docker build -t repro-sidecar:latest .

# 2. Floci, with access to the Docker daemon. This is the setup the measurement below was taken on:
#    Docker Desktop with "Expose daemon on tcp://localhost:2375 without TLS" enabled.
docker run -d --name floci-repro -p 4566:4566 \
  -e DOCKER_HOST=tcp://host.docker.internal:2375 floci/floci:2.1.0
# On Linux, mounting the socket does the same:
#   docker run -d --name floci-repro -p 4566:4566 \
#     -v /var/run/docker.sock:/var/run/docker.sock floci/floci:2.1.0
# In Git Bash on Windows, prefix that command with MSYS_NO_PATHCONV=1, or the mount target is
# rewritten into a Windows path and Floci ends up without a socket.

export AWS_ENDPOINT_URL=http://localhost:4566
export AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test AWS_DEFAULT_REGION=eu-central-1

# Precondition: Floci has to be able to reach the daemon, otherwise the symptom below looks the same
# for an entirely different reason. This has to print at least one container.
docker exec floci-repro sh -c 'echo ok' >/dev/null && docker ps -q | head -1

VPC=$(aws ec2 create-vpc --cidr-block 10.0.0.0/16 --query Vpc.VpcId --output text)
SUBNET=$(aws ec2 create-subnet --vpc-id "$VPC" --cidr-block 10.0.1.0/24 --query Subnet.SubnetId --output text)
aws ecs create-cluster --cluster-name sidecar-demo

# 3. The app's entryPoint is the file the sidecar shares
aws ecs register-task-definition --cli-input-json '{
  "family": "sidecar-entrypoint",
  "requiresCompatibilities": ["FARGATE"],
  "networkMode": "awsvpc",
  "cpu": "256", "memory": "512",
  "containerDefinitions": [
    { "name": "sidecar", "image": "repro-sidecar:latest", "command": ["true"], "essential": false },
    { "name": "app", "image": "busybox:latest",
      "entryPoint": ["/shared/wrapper"],
      "command": ["sh", "-c", "while true; do sleep 5; done"],
      "essential": true,
      "volumesFrom": [{ "sourceContainer": "sidecar", "readOnly": true }],
      "dependsOn": [{ "containerName": "sidecar", "condition": "START" }] }
  ]
}'

aws ecs create-service --cluster sidecar-demo --service-name sidecar-entrypoint-service \
  --task-definition sidecar-entrypoint --desired-count 1 --launch-type FARGATE \
  --network-configuration "awsvpcConfiguration={subnets=[$SUBNET],assignPublicIp=DISABLED}"

sleep 50
aws ecs describe-services --cluster sidecar-demo --services sidecar-entrypoint-service \
  --query 'services[0].{running:runningCount,desired:desiredCount}'
docker ps -aq --filter label=io.floci.service=ecs | wc -l
docker logs floci-repro 2>&1 | grep -A2 'Failed to start ECS task'

Environment

  • Floci version / image tag: floci/floci:2.1.0
  • Java SDK version (if applicable): 17.0.11
  • How you're running Floci (Docker / native / mvn quarkus:dev): Docker