Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientException: host.sourcePath should not be set for volumes in Fargate. #501

Closed
deshraj opened this issue May 3, 2018 · 4 comments
Closed
Assignees

Comments

@deshraj
Copy link

deshraj commented May 3, 2018

Summary

Getting the following error:

ClientException: host.sourcePath should not be set for volumes in Fargate.

Description

  • Which specific command was run
    ecs-cli compose --project-name django-app service up --create-log-groups --cluster-config django

  • Which version of the CLI you are using (Run: ecs-cli --version)
    ecs-cli version 1.5.0 (0bfcecd)

  • Which version of Go are you using? (Run: go version)
    Not using go.

  • What platform are you using to run ECS CLI commands?
    MacOS

Config files

  • docker-compose.yml
version: "2"
services:

  django:
    restart: always
    image: django_app
    container_name: django
    build:
      context: ./
      dockerfile: docker/prod/django/Dockerfile
    logging:
      driver: awslogs
      options: 
        awslogs-group: django
        awslogs-region: us-east-1
        awslogs-stream-prefix: ecs-django

  nginx:
    image: nginx:latest
    container_name: nginx
    ports:
      - "80:80"
    depends_on:
      - django
    volumes:
      - ./docker/prod/nginx:/etc/nginx/conf.d
    logging:
      driver: awslogs
      options: 
        awslogs-group: django
        awslogs-region: us-east-1
        awslogs-stream-prefix: ecs-nginx
  • ecs-params.yml
version: 1
task_definition:
  task_execution_role: ecsExecutionRole
  ecs_network_mode: awsvpc
  task_size:
    mem_limit: 0.5GB
    cpu_limit: 256
run_params:
  network_configuration:
    awsvpc_configuration:
      subnets:
        - "subnet-XXXXX"
        - "subnet-XXXXX"
      security_groups:
        - "sg-XXXXXX"
      assign_public_ip: ENABLED

Expected Behavior

Seems like this was fixed in #201 but not sure what is happening here.

Observed Behavior

deshraj at blah in ~/ecs-test [!?]
$ ecs-cli compose --project-name django-app service up --create-log-groups --cluster-config django
WARN[0000] Skipping unsupported YAML option for service...  option name=build service name=django
WARN[0000] Skipping unsupported YAML option for service...  option name=container_name service name=django
WARN[0000] Skipping unsupported YAML option for service...  option name=restart service name=django
WARN[0000] Skipping unsupported YAML option for service...  option name=container_name service name=nginx
WARN[0000] Skipping unsupported YAML option for service...  option name=depends_on service name=nginx
ERRO[0000] Error registering task definition             error="ClientException: host.sourcePath should not be set for volumes in Fargate.\n\tstatus code: 400, request id: XXXXX" family=django-app
ERRO[0000] Create task definition failed                 error="ClientException: host.sourcePath should not be set for volumes in Fargate.\n\tstatus code: 400, request id: XXXX"
FATA[0000] ClientException: host.sourcePath should not be set for volumes in Fargate.
	status code: 400, request id: XXXXX
@SoManyHs SoManyHs self-assigned this May 3, 2018
@SoManyHs
Copy link
Contributor

SoManyHs commented May 3, 2018

Hi @deshraj,
I believe the issue is that in your nginx config, you specified:

volumes:
      - ./docker/prod/nginx:/etc/nginx/conf.d

While #201 did allow for supporting a sourcePath and target as specified in the docker compose volumes syntax, sourcePath is not supported in FARGATE mode since that would require access to the host instance.

We are planning on supporting named volumes soon, but in the meantime you should be able to simply specify the target for your volume with launch-type FARGATE, e.g.

volumes:
      - /etc/nginx/conf.d

Hope this helps!

@SoManyHs
Copy link
Contributor

Closing this issue due to lack of response. Feel free to re-open if still experiencing problems. Thanks!

@deshraj
Copy link
Author

deshraj commented Jun 7, 2018

Thanks for the detailed response. It makes a lot of sense. It resolved the issue. :)

@vsatpathy
Copy link

Hey,
i am still not able to add sourcepath to the docker compose yml file under volumes.
Is this feature surrently supported or is in the roadmap?

error:
FATA[0002] ClientException: Fargate compatible task definitions do not support sourcePath

code-snippet:
volumes:
- /efs-volume-name:/app/temp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants