Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod stuck in error/removing state #15740

Closed
krystalcode opened this issue Sep 12, 2022 · 1 comment
Closed

Pod stuck in error/removing state #15740

krystalcode opened this issue Sep 12, 2022 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@krystalcode
Copy link

krystalcode commented Sep 12, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I ran a script that creates a pod and then adds a couple of containers to it. I immediately realized I wanted to change some environment variables before running the containers and I hit Ctrl+C to stop the script.

It seems no container was created in the pod (apart from the pod's infra container). The pod is now stuck in Error state and the infra container in Removing state. I cannot recreate the pod, I cannot add containers to it, and even after a reboot it is stuck in the same state.

Steps to reproduce the issue:

  1. Create a pod and stop the process before finishing i.e. Ctrl+C

Describe the results you received:

4153a9f2c002: pod ID
1cd35e8d63aa: infra ID

$ podman pod rm -f 4153a9f2c002
Error: error freeing lock for container 1cd35e8d63aa1ea540b26b5fc3827bc951c2ec3ce2542a133ed86e52e80699e4: no such file or directory
$ podman pod rm -f 1cd35e8d63aa
# No output, no error.
$ podman rm -f 1cd35e8d63aa
Error: container 1cd35e8d63aa1ea540b26b5fc3827bc951c2ec3ce2542a133ed86e52e80699e4 is the infra container of pod 4153a9f2c0026706d6a9db22336d367c0717311cdb9275ec47bcefaa3fb6ed4f and cannot be removed without removing the pod
$ podman pod create --replace ......
Error: error freeing lock for container 1cd35e8d63aa1ea540b26b5fc3827bc951c2ec3ce2542a133ed86e52e80699e4: no such file or directory
$ podman run --pod ......
Error: error running container create option: cannot use container 1cd35e8d63aa1ea540b26b5fc3827bc951c2ec3ce2542a133ed86e52e80699e4 as a dependency as it is being removed: container state improper

Describe the results you expected:

I would expect force-removing the pod to clean this up. Or some instructions on how to clean this up.

Output of podman version:

podman version 4.2.0

Ouput of podman inspect 4153a9f2c002

[
     {
          "Id": "4153a9f2c0026706d6a9db22336d367c0717311cdb9275ec47bcefaa3fb6ed4f",
          "Name": "my_container",
          "Created": "2022-09-11T12:53:38.543868619-05:00",
          "CreateCommand": [
               "podman",
               "pod",
               "create",
               "--replace",
               "--name",
               "apps_gitlab_prod",
               "--publish",
               "8081:80",
               "--publish",
               "8082:22",
               "--network",
               "gitlab",
               "--hostname",
               "gitlab"
          ],
          "ExitPolicy": "continue",
          "State": "Error",
          "Hostname": "gitlab",
          "CreateCgroup": true,
          "CgroupParent": "user.slice",
          "CgroupPath": "user.slice/user-libpod_pod_4153a9f2c0026706d6a9db22336d367c0717311cdb9275ec47bcefaa3fb6ed4f.slice",
          "CreateInfra": true,
          "InfraContainerID": "1cd35e8d63aa1ea540b26b5fc3827bc951c2ec3ce2542a133ed86e52e80699e4",
          "InfraConfig": {
               "PortBindings": {
                    "22/tcp": [
                         {
                              "HostIp": "",
                              "HostPort": "8082"
                         }
                    ],
                    "80/tcp": [
                         {
                              "HostIp": "",
                              "HostPort": "8081"
                         }
                    ]
               },
               "HostNetwork": false,
               "StaticIP": "",
               "StaticMAC": "",
               "NoManageResolvConf": false,
               "DNSServer": null,
               "DNSSearch": null,
               "DNSOption": null,
               "NoManageHosts": false,
               "HostAdd": null,
               "Networks": [
                    "gitlab"
               ],
               "NetworkOptions": null,
               "pid_ns": "private",
               "userns": "host",
               "uts_ns": "private"
          },
          "SharedNamespaces": [
               "net",
               "uts",
               "ipc"
          ],
          "NumContainers": 1,
          "Containers": [
               {
                    "Id": "1cd35e8d63aa1ea540b26b5fc3827bc951c2ec3ce2542a133ed86e52e80699e4",
                    "Name": "4153a9f2c002-infra",
                    "State": "removing"
               }
          ]
     }
]
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 12, 2022
@mheon
Copy link
Member

mheon commented Sep 12, 2022

Dupe of #15526

@mheon mheon closed this as completed Sep 12, 2022
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 16, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

2 participants