AWS Batch Container Error: "ResourceInitializationError no users found"

0

When triggering a batch job (Fargate Job Queue), the status is going to FAILED with the following error message:

Cannotstartcontainererror: ResourceInitializationError: unable to create new container: mount callback failed on /tmp/containerd-mount3975084381: no users found

Unfortunately I can't find any similar errors online. For reference, the Dockerfile that I'm building is simply the following:

FROM python:3.8-slim-buster
WORKDIR /app
USER root

COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

COPY . .

CMD [ "python3", "run.py"]

And the contents of run.py are as follows:

print("Python script has run!")

The only other file in the image is requirements.txt, which contains just the line requests.

I temporarily gave the ecs runtime role full admin permissions to see if that would help, but the error still occurred (so I changed it back).

Any help here would be appreciated!

asked a year ago1336 views
2 Answers
0
Accepted Answer

Found my answer! The job definition had the user set to ubuntu, which wasn't available in the python:3.8-slim-buster image. I changed it to root and it works perfectly.

answered a year ago
0

Not enough info to help with this. I would try these things:

  1. I do not think it is an issue with your docker image, but anyway, it is better to make sure it works as expected. Try to build a docker image locally and run this docker run YOUR_IMAGE python3 run.py
  2. check CloudWatch logs. There must be a stream with the title Batch..., something like that. Maybe there will be more info about the error
  3. try to use not Fargate, but EC2. If it work, the issue probably with task configuration

Feel free to ping me if you need more help, I am curious why this thing does not work :)

profile picture
Max
answered a year ago
  • Thank you for your reply!

    1. The script runs successfully when building/pulling and running locally
    2. Although there is a stream created for each run, they all contain 0 events
    3. Yep, it actually works perfectly on EC2 - just failing on fargate...

    Please let me know what info/config details I can provide and I'd be happy to!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions