Skip to content

nerdctl start cannot start containers in Created or Exited status (OCI runtime create failed: cannot allocate tty if runc will detach without setting console socket) #492

Open

Description

Required behavior: Allow start Created or Exited containers, either with nerdctl start or nerdctl exec -it.
Actual behavior:
you can run a container, for example: nerdctl run -it nginx:latest --name nginx-container.
You can stop it: nerdctl stop nginx-container.
Issue:
You cannot start again the container neither nerdctl start nginx-container nor nerdctl exec -it nginx-container /bin/sh.
Error messages:
nerdctl start nginx-container:
FATA[0000] OCI runtime create failed: cannot allocate tty if runc will detach without setting console socket: unknown
nerdctl exec -it nginx-container /bin/sh:
FATA[0000] no running task found: task 0a88555b90488894c72918665b9b14bd6ae96e89676d65ca772b9abf34727884 not found: not found
Environment:

  • OS: MacOs Big Sur 11.0.1.
  • Backend: Rancher Desktop 0.6.0 (nerdctl 0.12.1).

Activity

  1. ghost changed the title [-]`nerdctl start` cannot start containers in **Created** or **Exited** status [/-] [+]`nerdctl start` cannot start containers in `Created` or `Exited` status [/+] on Nov 2, 2021
  2. changed the title [-]`nerdctl start` cannot start containers in `Created` or `Exited` status [/-] [+]`nerdctl start` cannot start containers in `Created` or `Exited` status (`OCI runtime create failed: cannot allocate tty if runc will detach without setting console socket`)[/+] on Nov 3, 2021
  3. AkihiroSuda commented on Nov 3, 2021

    @AkihiroSuda
    Member

    -it is currently incomparable with stop/start, please use -d

  4. pvbiesen commented on Jan 28, 2022

    @pvbiesen

    +1 migrating from docker, very annoying nerdctl start -i <container> doesn't work after nerctl run -ti <image> /bin/bash .

  5. animatedcreativity commented on Feb 4, 2022

    @animatedcreativity

    Yes, cannot start stopped containers.

  6. raktim-sixt commented on Aug 22, 2022

    @raktim-sixt

    yes, same here...cannot start the container which is in the CREATED state

    failed to create shim task: OCI runtime create failed: runc create failed: cannot allocate tty if runc will detach without setting console socket: unknown

    has anyone found any workaround/solution to this?

  7. aerphanas commented on Nov 12, 2022

    @aerphanas

    is anyone know how to run image properly ?
    i run image with :

    nerdctl run -it overlayfs@sha256:564f654982832faaeb09ab49b4b543b83a79f478b5d73bc2785fe0aa07648597

    after i stop container and i want to run it again with :

    nerdctl container start overlayfs@sha256:564f654982832faaeb09ab49b4b543b83a79f478b5d73bc2785fe0aa07648597

    it say

    FATA[0000] failed to create shim task: OCI runtime create failed: runc create failed: cannot allocate tty if runc will detach without setting console socket: unknown

    i have version

    nerdctl version 
    Client:
     Version:	v1.0.0
     OS/Arch:	linux/amd64
     Git commit:	<unknown>
     buildctl:
      Version:	0.10.5
      GitCommit:	v0.10.5
    
    Server:
     containerd:
      Version:	v1.6.9
      GitCommit:	v1.6.9
     runc:
      Version:	1.1.4
    
    

    current solution :
    run container with -d flag

    nerdctl run -d overlayfs@sha256:564f654982832faaeb09ab49b4b543b83a79f478b5d73bc2785fe0aa07648597

    i don't know why it immediately stop the container if you run nerdctl ps -a it will have status Exited (0) even after add --restart flag it will restarting in loop, btw you can start container with command :

    nerdctl start -a overlayfs@sha256:564f654982832faaeb09ab49b4b543b83a79f478b5d73bc2785fe0aa07648597

    but it will give you blank shell, if you type ls it will response :

    ls
    bin
    boot
    dev
    etc
    home
    lib
    lib64
    media
    mnt
    opt
    proc
    root
    run
    sbin
    srv
    sys
    tmp
    usr
    var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions