I am trying to deploy two docker containers via docker compose to ECS.
This already worked before. Now I'm getting the following error:
DatabasemongoService TaskFailedToStart: Unexpected EC2 error while attempting to tag the network interface: InvalidParameterValue
I tried deleting all resources in my account and recreating a default VPC which the docker compose uses to deploy.
I tried tagging the network interface via the management web UI, which worked without troubles.
I found this Documentation about EC2 Error Codes: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html
InvalidParameterValue: A value specified in a parameter is not valid, is unsupported, or cannot be used. Ensure that you specify a resource by using its full ID. The returned message provides an explanation of the error value.
I don't get any output besides the error above to put my search on a new trail.
Also there is this entry talking about the error:
InvalidNetworkInterface.InUse: The specified interface is currently in use and cannot be deleted or attached to another instance. Ensure that you have detached the network interface first. If a network interface is in use, you may also receive the InvalidParameterValue error.
As the compose CLI handles creation and deletion of network interfaces automatically, I assume this is not the problem.
Below is my docker-compose.yaml file. I start it via docker compose --env-file=./config/.env.development up
in the ecs context.
version: '3'
services:
feathers:
image: xxx
build:
context: ./app
args:
- BUILD_MODE=${MODE_ENV:-development}
working_dir: /app
container_name: 'feather-container'
ports:
- ${BE_PORT}:${BE_PORT}
environment:
- MODE=${MODE_ENV:-development}
depends_on:
- database-mongo
networks:
- backend
env_file:
- ./config/.env.${MODE_ENV}
database-mongo:
image: yyy
build:
context: ./database
container_name: 'mongo-container'
command: mongod --port ${MONGO_PORT} --bind_ip_all
environment:
- MONGO_INITDB_DATABASE=${MONGO_DATABASE}
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
ports:
- ${MONGO_PORT}:${MONGO_PORT}
volumes:
- mongo-data:/data
networks:
- backend
networks:
backend:
name: be-network
volumes:
mongo-data:
Any help, idea, or point in the right direction is very appreciated!
One suggestion I have is you go to CloudTrails and identify the ENI creation / tagging call made by the ECS service role and inspect the request / response.