CannotStartContainerError: API error (400): OCI runtime create failed: container_linux.go:348
NickName:gc5 Ask DateTime:2018-10-11T23:42:08

CannotStartContainerError: API error (400): OCI runtime create failed: container_linux.go:348

I am trying to run a script through AWS Batch, following the tutorial from here. In particular, the entry point script is the same: it is a script that downloads the code to be executed in AWS Batch from an S3 bucket. However, no matter how I try to execute it on AWS, I always receive:

CannotStartContainerError: API error (400): OCI runtime create failed: 
  container_linux.go:348: starting container process caused "exec:
  \"/usr/local/bin/fetch_and_run.sh\": 
  stat /usr/local/bin/fetch_and_run.sh: no such file or directory": unknown

I am able to start the same container locally.

I start the process from awscli with the following command:

aws batch submit-job --job-name mss_dev --job-definition mapper \
  --job-queue bio-job-queue \
  --container-overrides '{"environment": \
  [{"name": "BATCH_FILE_S3_URL", "value": "s3://test/myjob.sh"}, \
   {"name": "BATCH_FILE_TYPE", "value": "script"}], \
   "command":["/usr/local/bin/fetch_and_run.sh"]}'

My Dockerfile is the following:

FROM amazonlinux:latest

# General dependencies and user
## aws-cli installed twice (here for root, later for user)
RUN yum -y install which unzip tar wget aws-cli curl sudo
RUN yum -y groupinstall 'Development Tools'
RUN yum -y install gcc git curl make zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl openssl-devel
RUN yum -y install java-1.8.0-openjdk.x86_64
## User and work directory
RUN groupadd -r user && useradd -mr -g user -d /home/user -s /sbin/nologin -c "Docker image user" user
RUN echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
ENV HOME /home/user
## Change user to user
USER user
ENV USER user
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)" && echo 'export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >>~/.profile
## GNU parallel 10 seconds installation
#WORKDIR $HOME/tools/parallel
#RUN (wget -O - pi.dk/3 || curl pi.dk/3/ || fetch -o - http://pi.dk/3) | bash
# RUN brew install gcc
ENV PATH "/home/linuxbrew/.linuxbrew/bin:$PATH"
RUN brew install parallel

# Pyenv
WORKDIR $HOME
RUN git clone git://github.com/yyuu/pyenv.git .pyenv

ENV PYENV_ROOT $HOME/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH

# Python3
RUN pyenv install 3.6.5
RUN pyenv global 3.6.5
RUN pyenv rehash

# Python3 modules
RUN pip install --upgrade pip
RUN pip install --upgrade awscli pandas scipy numpy kneed

# STAR
RUN mkdir -p $HOME/tools/STAR
WORKDIR $HOME/tools/STAR
RUN wget https://github.com/alexdobin/STAR/archive/2.6.1b.tar.gz && tar xvf 2.6.1b.tar.gz

# DropSeq
RUN mkdir -p $HOME/tools/DropSeq
WORKDIR $HOME/tools/DropSeq
RUN wget https://github.com/broadinstitute/Drop-seq/releases/download/v1.13/Drop-seq_tools-1.13.zip && unzip Drop-seq_tools-1.13.zip

# Reference and other files should be downloaded during execution
RUN mkdir -p $HOME/data
RUN mkdir -p $HOME/results
COPY --chown=user:user code /home/user/code

# Copy main files and set entrypoint
WORKDIR /tmp
ADD fetch_and_run.sh /usr/local/bin/fetch_and_run.sh
USER nobody
ENTRYPOINT ["/usr/local/bin/fetch_and_run.sh"]
# To debug
# ENTRYPOINT ["/bin/bash"]

Copyright Notice:Content Author:「gc5」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52764054/cannotstartcontainererror-api-error-400-oci-runtime-create-failed-container

More about “CannotStartContainerError: API error (400): OCI runtime create failed: container_linux.go:348” related questions

CannotStartContainerError: API error (400): OCI runtime create failed: container_linux.go:348: starting container process caused

Docker container is just running and stopped and throwing below error in AWS ECS. Could someone help. "CannotStartContainerError: API error (400): OCI runtime create failed: container_linux.go:348:

Show Detail

CannotStartContainerError: API error (400): OCI runtime create failed: container_linux.go:348

I am trying to run a script through AWS Batch, following the tutorial from here. In particular, the entry point script is the same: it is a script that downloads the code to be executed in AWS Batc...

Show Detail

OCI runtime create failed: container_linux.go:348:

I'm new to docker and trying to run an app. When I run the following command docker-compose run --rm flaskapp /bin/bash -c "cd /opt/services/flaskapp/src && python -c 'import database;

Show Detail

OCI runtime(container_linux.go:348) error in docker

my Server is : 3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014 and my docker version is : Docker version 18.06.3-ce, build d7080c1 I got this error after my simple code docker run

Show Detail

Getting OCI runtime create failed: container_linux.go:348: error

I'm trying to install the Concerto Computer Adaptive Testing platform on my Windows 10 Home machine, using the Docker Toolbox. The documentation for the installation is here: https://github.com/ca...

Show Detail

Received below error while starting docker container " Error response from daemon: OCI runtime create failed: container_linux.go:348"

I am using $ sudo docker start <Container Id> Below error I received Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exe...

Show Detail

OCI runtime create failed: container_linux.go:380

I am trying to start a container from the given image below but I am getting the following error: ERROR: for code_challenge_api Cannot start service api: OCI runtime create failed: container_linu...

Show Detail

OCI runtime execution failed

Getting this error when i ran ./byfn.sh -m up command : OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"scripts/script.sh\": stat scripts/sc...

Show Detail

OCI runtime exec failed: exec failed: container_linux.go:348 : starting container process caused "no such file or directory": unknown

I am trying to bringup my fabric network. I got my orderers organization started. I got my peer organizations started. I got my cli started. after that request is failing with OCI runtime exec

Show Detail

CannotStartContainerError: ResourceInitializationError: failed to create new container runtime task: failed to create shim: OCI runtime create failed:

Here's the full error message: CannotStartContainerError: ResourceInitializationError: failed to create new container runtime task: failed to create shim: OCI runtime create failed: container_linu...

Show Detail