8000 k8s work unit fails because container exited before attaching stdin stream · Issue #489 · ansible/receptor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

k8s work unit fails because container exited before attaching stdin stream #489

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

Closed
fosterseth opened this issue Nov 17, 2021 · 3 comments
Closed
Labels
type:bug Something isn't working

Comments

@fosterseth
Copy link
Member
fosterseth commented Nov 17, 2021

This bug occurs occasionally while running make test.

Here is the work unit status from the following functional test TestWork/kube_worker/work_submit_while_remote_node_is_down

{
  "State": 3,
  "Detail": "Stream error running pod: stdin: Internal error occurred: error attaching to container: container is in CONTAINER_EXITED state, stdout: http2: response body closed",
  "StdoutSize": 10,
  "WorkType": "echosleepshort",
  "ExtraData": {
    "Image": "alpine",
    "Command": "sh -c \"for i in `seq 1 5`; do echo $i;done\"",
    "Params": ""
  }
  etc.
}

Interestingly the pod ran and we got back the full stdout (10 bytes). This work unit doesn't even have stdin.

Seems the pod is running and finishing before we can attach a stdin stream, but this stream isn't needed in this case. This work unit should have succeeded.

@fosterseth
Copy link
Member Author

add this to your receptor node conf

- work-kubernetes:
    worktype: kubeit2
    authmethod: runtime
    allowruntimeauth: true
    allowruntimepod: true
    allowruntimeparams: true

create pod.yml

apiVersion: v1
kind: Pod
metadata:
    generateName: myapp-pod-
    labels:
        app: myapp
spec:
    containers:
    - name: worker
      image: busybox
      command: ['sh', '-c', 'echo The Pod is running && sleep 0 && exit 0']
      # resources:
      #     limits:
      #         memory: "1000000Mi"
    restartPolicy: Never

minikube start, start receptor process, then submit work

receptorctlfoo work submit kubeit2 --param secret_kube_pod=@/home/sbf/sockceptor/pod.yml --param secret_kube_config=@/home/sbf/.kube/config --no-payload

@thenets
Copy link
Member
thenets commented Apr 29, 2022

@fosterseth @shanemcd @AlanCoding is this still a problem?

@fosterseth
Copy link
Member Author

@thenets this should no longer be an issue, fixed in #547

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
0