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!

已提问 1 年前1357 查看次数
2 回答
0
已接受的回答

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.

已回答 1 年前
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
已回答 1 年前
  • 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!

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则