首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >提交AWS批处理作业时的CannotStartContainerError

提交AWS批处理作业时的CannotStartContainerError
EN

Stack Overflow用户
提问于 2017-06-08 23:38:40
回答 0查看 787关注 0票数 1

AWS Batch中,我有一个job definition、一个job queue和一个compute environment来执行我的AWS Batch jobs。提交作业后,我在失败作业列表中找到该作业,错误如下:

代码语言:javascript
复制
Status reason
Essential container in task exited
Container message
CannotStartContainerError: API error (404): oci runtime error: container_linux.go:247: starting container process caused "exec: \"/var/application/script.sh --file= --key=. 

cloudwatch logs中,我有:

代码语言:javascript
复制
container_linux.go:247: starting container process caused "exec: \"/var/application/script.sh --file=Toulouse.json --key=out\": stat /var/application/script.sh --file=Toulouse.json --key=out: no such file or directory"

我已经指定了一个包含所有脚本的正确docker镜像(我们已经在使用它,并且它可以正常工作),但我不知道错误来自哪里。任何建议都是非常感谢的。

docker文件类似于:

代码语言:javascript
复制
# Pull base image.
FROM account-id.dkr.ecr.region.amazonaws.com/application-image.base-php7-image:latest

VOLUME /tmp
VOLUME /mount-point

RUN chown -R ubuntu:ubuntu /var/application

# Create the source directories
USER ubuntu
COPY application/ /var/application

# Register aws profile
COPY data/aws /home/ubuntu/.aws

WORKDIR /var/application/
ENV COMPOSER_CACHE_DIR /tmp
RUN composer update -o && \
    rm -Rf /tmp/*

这是Job Definition

代码语言:javascript
复制
{
    "jobDefinitionName": "JobDefinition",
    "jobDefinitionArn": "arn:aws:batch:region:accountid:job-definition/JobDefinition:25",
    "revision": 21,
    "status": "ACTIVE",
    "type": "container",
    "parameters": {},
    "retryStrategy": {
        "attempts": 1
    },
    "containerProperties": {
        "image": "account-id.dkr.ecr.region.amazonaws.com/application-dev:latest",
        "vcpus": 1,
        "memory": 512,
        "command": [
            "/var/application/script.sh",
            "--file=",
            "Ref::file",
            "--key=",
            "Ref::key"
        ],
        "volumes": [
            {
                "host": {
                    "sourcePath": "/mount-point"
                },
                "name": "logs"
            },
            {
                "host": {
                    "sourcePath": "/var/log/php/errors.log"
                },
                "name": "php-errors-log"
            },
            {
                "host": {
                    "sourcePath": "/tmp/"
                },
                "name": "tmp"
            }
        ],
        "environment": [
            {
                "name": "APP_ENV",
                "value": "dev"
            }
        ],
        "mountPoints": [
            {
                "containerPath": "/tmp/",
                "readOnly": false,
                "sourceVolume": "tmp"
            },
            {
                "containerPath": "/var/log/php/errors.log",
                "readOnly": false,
                "sourceVolume": "php-errors-log"
            },
            {
                "containerPath": "/mount-point",
                "readOnly": false,
                "sourceVolume": "logs"
            }
        ],
        "ulimits": []
    }
}

在Cloudwatch日志流/var/ log /docker中:

代码语言:javascript
复制
time="2017-06-09T12:23:21.014547063Z" level=error msg="Handler for GET /v1.17/containers/4150933a38d4f162ba402a3edd8b7763c6bbbd417fcce232964e4a79c2286f67/json returned error: No such container: 4150933a38d4f162ba402a3edd8b7763c6bbbd417fcce232964e4a79c2286f67" 
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44440074

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档