Error: OCI runtime create failed: container_linux.go:348

已回答

I have a Docker container setup to which I'm trying to connect PyCharm.  The following error is occurring:

Error:com.github.dockerjava.api.exception.BadRequestException: {"message":"OCI runtime create failed: container_linux.go:348: starting container process caused \"exec: \\\"/ssd/company-dev/venv/bin/python\\\": stat /ssd/company-dev/venv/bin/python: no such file or directory\": unknown"}

This is a valid path within the Docker container.  I know this because I jumped into the container via Terminal to examine the path.  It's also present for all of my colleagues and they're not getting this error.

The same error occurs when I click on "Install requirements" in the yellow tooltip that appears near the top of PyCharm.

So I have two related questions:

  1. What is causing this error?
  2. How do I resolve it?

Robert W.

3

Same problem here. Could anyone help?

0

I'm having the same issue here.

0

I tried to restart docker, pycharm, build again the images (any image, even that the image is working, is giving this error), restart the Mac... The problem still happens. 

0

I "fixed" it by deleting old Docker container and creating new one (based on Docker file), then assigned this new one as a remote Python interpreter to my project.

1

Thanks Mateusz. I tried to do it now, I even Reseted Docker to Factory Defaults. Now, before to give the error above, it shows also: "Getting Remote Interpreter Version". The image is working, but not as Interpreter in PyCharm.

0

Hi,

Thank you for contacting PyCharm support and sorry for a super-late reply.

Could you please make sure you are using the latest Docker version?

If problem remains, please do the following:

  1. Open Help | Debug Log Settings...
  2. Add the following line: #com.jetbrains.python.docker
  3. Click OK
  4. Reproduce the problem.
  5. Attach your idea.log (Help | Show Log in...).

Looking forward to your reply.

Kind regards,

Sergey

https://www.jetbrains.com

The Drive to Develop

0

Hello Sergey, thank you for the reply. Yeah, I'm using the last Docker Version: Version 18.06.1-ce-mac73 (26764).

2018-10-04 11:20:53,986 [13742240] INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: #com.jetbrains.python.docker
2018-10-04 11:21:05,114 [13753368] ERROR - minal.model.TerminalTextBuffer - Attempt to get line out of bounds: -32 < 0
2018-10-04 11:21:05,281 [13753535] INFO - packaging.PyPackageManagerImpl - Running packaging tool: /usr/local/bin/python3.7 /Users/williazi/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/182.4505.26/PyCharm.app/Contents/helpers/packaging_tool.py list
2018-10-04 11:21:16,436 [13764690] INFO - .CloudSilentLoggingHandlerImpl - Creating container...

0

Please upload logs folder zipped (Help | Show Log in...) to https://uploads.services.jetbrains.com/ and provide the name of the zip file.

Kind regards,

Sergey

https://www.jetbrains.com

The Drive to Develop

0

Uploaded: PyDockerPyCharm2018.2.zip

0

It is not there, unfortunately.

Please try again.

You should see

Upload complete!

when done.

Kind regards,

Sergey

https://www.jetbrains.com

The Drive to Develop

0

Done:

Upload complete!
Uploading...
File uploaded: PyDockerPyCharm2018.2.zip
Upload complete!
0

Thanks for the logs.

There is an exception "...caused \"exec: \\\"python\\\": executable file not found...". 

Please try with the full path to python executable when adding docker-based interpreter (Python interpreter path).

Kind regards,

Sergey

https://www.jetbrains.com

The Drive to Develop

2

Thanks Sergey. It works. As I'm using a Linux Image, Python version is the 3th. So, I just replaced:

python to python3


Thank you for the support. Best regards.

2

Thanks for your help. I a very similar issue. In order to solve it, I found my interpreter path on Docker using command :

sys.executable

Then I changed my Python interpreter path to :

 

0

Even though the path of python in the container is valid, Pycharm doesn't recognize this path. This is because PyCharm recreates a new container for each action (e.g. Run, Debug, Indexing, etc.) from the image not knowing about the existing container changes. Therefore all the requirements should be included in the image.

Hence if python was installed on a container and the actual image was not having python, Pycharm won't recognize this path. You need to create a new image out of this container once the desired changes are made and then use Pycharm with that image.

Once the changes are made to the container, can use the below to create an image:

docker commit <container-id>

docker tag <image-id> <name_for_image>

Use this image with Pycharm.

0

I had a similar `OCI runtime create failed` error after a dnf update on Fedora 34 which included a Docker update.

Downgrading containerd.io worked for me.

sudo dnf downgrade containerd.io
0

I have a similar Issue:
First I have this error:
And then:
I have no option to change from python to python3 in UI of Pycharm:

I attached the log file with ID: 2023_01_06_8XTNZUv91GK8s6Q11pzpxL


Thanks in advance!

0

Cguerrer Do you use Docker Desktop? If so, please make sure Compose V2 is enabled in the general settings. 

Also, make sure Compose V2 is enabled in Preferences | Build, Execution, Deployment | Docker | Tools in PyCharm.

0

Hi Andrey:

Thank you very much for answering, for some strange reason that I do not know my Pycharm for ubuntu, it did not allow me to change the value of the Python interpreter Path:
.

It is strange, since we compared the versions of Pycharm with a colleague, they were exactly identical, I uninstalled it completely and reinstalled it and same behavior.

This is the UI that I had before so I cannot change python by python3

Then, I could fix it, I was able to move forward by installing a version of Pycharm from 2021 (is not the best solution, but it works) and now I was able to put python3 and move forward with Docker.

I don't understand why it didn't show me that option and others did.

0

Thank you,

I would appreciate if you submit a bug report to https://youtrack.jetbrains.com/issues/py with the following data:

- logs from **Help | Collect Logs and Diagnostic Data** after reproducing the issue

- Screenshots demonstrating the issue (same as you posted here)

0

请先登录再写评论。