Jenkins stage Docker OCI runtime failure - docker

I am using a Jenkinsfile to build an application and deploy via Ansible while using a Docker image for its build agent within the Jenkinsfile. Upon a safe restart of Jenkins, I am now seeing my Jenkins jobs failing for the following error that previously never appeared. Nothing has changed in the Jenkinsfile or in the configuration and there is no config.json in the project I am building so I am unsure where this is arising from.
Running shell script
OCI runtime exec failed: exec failed: container_linux.go:348: starting
container process caused "chdir to cwd (\"/opt/software/jenkins/workspace/Engineering-develop#3\") set in config.json failed: no such file or directory": unknown
process apparently never started in /opt/software/jenkins/workspace/Engineering-develop#3/durable-38313533

Related

Getting error while starting a container through docker in hyperledger fabric,how to resolve this?

while starting containers by the command "sudo ./fabricNetwork.sh up" where fabricNetwork.sh is the shell script for starting containers I get the following error for the container "chaincode"
"Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown
Error: failed to start containers: chaincode"
how to resolve this error
I tried changing the shebang line at the beginning of shell script from "#!/bin/bash" to "#!/bin/sh" but it gave me the error "./fabricNetwork.sh: 8: ./fabricNetwork.sh: Syntax error: "(" unexpected". Any ideas how to resolve the error.
That error message looks like it is coming from the container itself, rather than your shell script. I'm not sure if it is wise to use sudo on your script, according to different sources that I have read over the years. It is better if the owner of the shell script is added to the docker group, if you are running the script on Ubuntu.

Chaincode container getting created but not starting

Hyperledger-Fabric: v2.3.3
Peer docker image: tag 2.3.3
Error on peer logs after committing chaincode:
ERRO 036 start-could not start container: API error (400): failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "chaincode": executable file not found in $PATH: unknown
WARN 037 could not launch chaincode 'test_v1_v1:65f5b95ca7ff438e02a86aea4205bcd697a2afa0f4e37c314d3011667357fe50': error starting container: error starting container: API error (400): failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "chaincode": executable file not found in $PATH: unknown
docker ps -a shows that chaincode container status: Created.
I tried restarting peers and orderer, but same error
*Note: Comment if I should provide any specific configuration or anything to understand the problem.
The problem was that the package name in chaincode file was not "main" (I thought that we have to name it as parent directory).
So, the binary was not getting generated after the chaincode was committed. As a result when the peer was trying to launch/run chaincode container it was saying that I don't have binary/executable file to run.
After changing package name to "main" and doing packaging, installation and commit process the chaincode container started.
*NOTE: This is my understanding of the problem, please let me know if anything written above is misconception/ wrong.

OCI runtime exec failed

since today i have got an error message with various docker commands. Unfortunately I don't really know what to do with it. Does anyone have any idea what the problem could be and how I fix it?
Error:
OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: process_linux.go:95: starting setns process caused: fork/exec /proc/self/exe: resource temporarily unavailable: unknown
Another Error:
ERROR: for hosting_mail_1 Cannot start service mail: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/moby/5fabf9edf67fbd6455bdc955c56c063683aa78e8e31514660661799aaa867391/log.json: no such file or directory): runc did not terminate successfully: unknown
ERROR: for mail Cannot start service mail: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/moby/5fabf9edf67fbd6455bdc955c56c063683aa78e8e31514660661799aaa867391/log.json: no such file or directory): runc did not terminate successfully: unknown
ERROR: Encountered errors while bringing up the project.
I don't know if you solved your problem finally, but this really looks like bad file system authorization that may have been corrupted from an update on the file systems.
Regarding the error : container_linux.go:370:,/run/containerd/io.containerd.runtime.v2.task/moby/5fabf9edf67fbd6455bdc955c56c063683aa78e8e31514660661799aaa867391/log.json
I can see that :
docker manage to initiate a volume ID
did not manage to mount that volume on the disk
0/ Check docker basic command
docker ps
docker images
docker pull ubuntu:latest
If one of these commands is failing, you are up to review docker installation, seems that maybe docker is not installed properly.
1/
To check if you need to completely re-install docker, you may try the following basic command
docker run --name checkDocker -it ubuntu:latest bash
If this is not displaying any docker shell, then you have a problem on running a container, not necessarly docker installation.
2/
Check your docker volumes and rights, I don't have your installation setup, but It seems you are using docker-compose and maybe there is some conflicts when mounting the volume of your containers with specific rights and the host's rights and user id
3/
If you are ending up here you should follow that work around of re-installation, which would be the fatest solution to restore your application if you have backup (hope you have )

Docker build error OCI runtime create failed [duplicate]

This question already has answers here:
Cannot start docker container In docker CE on oracle linux
(5 answers)
Closed 3 years ago.
I am trying to build an agent on the linux machine using docker. Everything was working fine and i was able to create the agent. But suddenly it was showing offline. When i tried to recreate the agent it was throwing below error:-
ERROR: for build-agent_dl-build-agent_1 Cannot start service dl-build-agent: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \"write /proc/self/attr/keycreate: permission denied\"": unknown
ERROR: for dl-build-agent Cannot start service dl-build-agent: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \"write /proc/self/attr/keycreate: permission denied\"": unknown
ERROR: Encountered errors while bringing up the project.
even if i am trying to run a simple docker command 'docker run hello-world' i am getting below error,
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "process_linux.go:430: container init caused \"write /proc/self/attr/keycreate: permission denied\"": unknown.
ERRO[0000] error waiting for container: context cancelled
Any suggestions?
Below command solved my issue,
sudo semanage permissive -a container_runtime_t
Please follow below link for more details,
Cannot start docker container In docker CE on oracle linux
Thanks #leopal for suggestion.

Command in task definition causes exception

Originally in a Dockerfile I use
CMD python /app/src/main.py
to start a process in my docker container. It works as expected.
I am now in the process of deploying these docker images to the aws ecs.
I want to move this CMD out of the Dockerfile and put it as part of the task definition, because I suppose it will offer me more flexibility.
However when the docker container is spinned up, it emits this exception:
container_linux.go:247: starting container process caused "exec: \"python
/app/src/main.py\": stat python /app/src/main.py: no such file or directory"
Apparently ecs treats the CMD parameter as if it refers to a single file.
I have tried to define the command as a list i.e. ["python", " /app/src/main.py"] but it just raised a different error: container_linux.go:247: starting container process caused "exec: \"[\\\"python\\\"\": executable file not found in $PATH"
I need to put the command as a comma delimited string i.e.
python,/app/src/main.py

Resources