gpt4 book ai didi

json - 提交AWS Batch作业时出现CannotStartContainerError

转载 作者:行者123 更新时间:2023-12-02 19:36:34 28 4
gpt4 key购买 nike

AWS Batch中,我有一个job definitionjob queuecompute environment在哪里执行我的AWS Batch jobs
提交作业后,我在失败的列表中找到此错误:

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中,我有:
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 文件是这样的:
# 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:
{
"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中:
time="2017-06-09T12:23:21.014547063Z" level=error msg="Handler for GET /v1.17/containers/4150933a38d4f162ba402a3edd8b7763c6bbbd417fcce232964e4a79c2286f67/json returned error: No such container: 4150933a38d4f162ba402a3edd8b7763c6bbbd417fcce232964e4a79c2286f67" 

最佳答案

该错误是因为命令格式错误。我正在使用boto3通过lambda函数(python 2.7)提交作业,命令的语法应如下所示:

'command' : ['sudo','mkdir','directory']

希望它能帮助到别人。

关于json - 提交AWS Batch作业时出现CannotStartContainerError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44440074/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com