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

PipelineRun with status of PipelineRunCouldntCancelhas no status icon #1549

Closed
CarolynMabbott opened this issue Jun 22, 2020 · 4 comments
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@CarolynMabbott
Copy link
Member

Describe the bug

I have no status icon for my pipelinerun

Screenshot 2020-06-22 at 14 03 58

Expected behaviour

I have a cancelled status

Steps to reproduce the bug

Rerun a pipelinerun
Stop the pipelinerun that was rerun

Environment details

  • Kubernetes Platform:

Docker

  • Kubernetes or OpenShift version:
  • Install mode (if on OpenShift):
  • Cloud-provider/provisioner:
  • Versions:
    • Tekton Dashboard:

master

  • Tekton Pipelines:

0.13.2

  • Tekton Triggers:

master

  • Install namespaces:
    • Tekton Dashboard:

tekton-pipelines

  • Tekton Pipelines:

tekton-pipelines

  • Tekton Triggers:

tekton-pipelines

Additional Info

Status
PipelineRunCouldntCancel

Error

PipelineRun "simple-pipeline-run-vrzwn-r-vvb5p" was cancelled but had errors trying to cancel TaskRuns: Failed to patch TaskRun `simple-pipeline-run-vrzwn-r-vvb5p-deploy-simple-8vjbd` with cancellation: taskruns.tekton.dev "simple-pipeline-run-vrzwn-r-vvb5p-deploy-simple-8vjbd" not found

Screenshot 2020-06-22 at 14 08 28

@CarolynMabbott CarolynMabbott added the kind/bug Categorizes issue or PR as related to a bug. label Jun 22, 2020
@AlanGreene
Copy link
Member

@CarolynMabbott can you share the Pipeline you used to reproduce this? I'm not seeing it, did you have to wait for a particular point before stopping the run to get this status?

The PipelineRun would also be extremely useful: kubectl get -o yaml pipelinerun <name>

The only situation I can see where we wouldn't have an icon is if the PipelineRun:

  • has status == 'Unknown' and reason is something other than either 'Running' or 'Pending'
  • has status that's some value other than 'Unknown', 'True', or 'False'

It looks like your run with reason == 'PipelineRunCouldntCancel' could potentially match either of these so it would be good to understand which it is so we can decide how to handle it.

@CarolynMabbott
Copy link
Member Author

CarolynMabbott commented Jun 23, 2020

@AlanGreene Its the simple-pipeline from the pipeline hotel
https://github.com/pipeline-hotel/example-pipelines/blob/master/triggers-resources/config/github/simple-pipeline/simple-pipeline.yaml

I just pressed rerun on the pipelineruns page and waited a few seconds and pressed the stop pipelinerun

I also got the same error yesterday from the buildah-pipeline and the simple-pipelines when i was using openshift so its not just on docker

Heres the yaml from the simple-pipeline run on openshift, this one isnt a rerun just a normal pipelinerun
Possibly thinking its a pipelines problem as when refreshed the page the duration is still running with duration of 21 hours 34 minutes 43 seconds even though I defiantly did cancel it.
Just did a nother rerun and cancel to confirm that the duration keeps on increasing even after a cancel

Carolyns-MacBook-Pro:~ carolynmabbott$ oc get pr -n openshift-pipelines simple-pipeline-run-7v4hb -o yaml
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"tekton.dev/v1beta1","kind":"Pipeline","metadata":{"annotations":{},"name":"simple-pipeline","namespace":"openshift-pipelines"},"spec":{"params":[{"description":"The event type","name":"event-type","type":"string"}],"resources":[{"name":"git-source","type":"git"},{"name":"docker-image","type":"image"}],"tasks":[{"name":"build-simple","resources":{"inputs":[{"name":"git-source","resource":"git-source"}],"outputs":[{"name":"builtImage","resource":"docker-image"}]},"taskRef":{"name":"build-push"}},{"conditions":[{"conditionRef":"deployment-condition","params":[{"name":"event-type","value":"$(params.event-type)"}]}],"name":"deploy-simple","resources":{"inputs":[{"name":"git-source","resource":"git-source"},{"name":"image-out","resource":"docker-image"}]},"runAfter":["build-simple"],"taskRef":{"name":"deploy-simple-kubectl-task"}}]}}
  creationTimestamp: "2020-06-22T12:49:52Z"
  generateName: simple-pipeline-run-
  generation: 2
  labels:
    tekton.dev/pipeline: simple-pipeline
    triggers.tekton.dev/eventlistener: tekton-webhooks-eventlistener
    triggers.tekton.dev/trigger: sample-openshift-pipelines-push-event
    triggers.tekton.dev/triggers-eventid: cjqtt
    webhooks.tekton.dev/gitBranch: Carolyn-Mabbott1-patch-1
    webhooks.tekton.dev/gitOrg: carolyn-mabbott1
    webhooks.tekton.dev/gitRepo: sample
    webhooks.tekton.dev/gitServer: github.ibm.com
  name: simple-pipeline-run-7v4hb
  namespace: openshift-pipelines
  resourceVersion: "7256476"
  selfLink: /apis/tekton.dev/v1beta1/namespaces/openshift-pipelines/pipelineruns/simple-pipeline-run-7v4hb
  uid: 640144c8-0358-4e5c-bd29-2c9d3ae7b1c8
spec:
  params:
  - name: event-type
    value: push
  pipelineRef:
    name: simple-pipeline
  resources:
  - name: git-source
    resourceRef:
      name: git-source-m7vkc
  - name: docker-image
    resourceRef:
      name: docker-image-m7vkc
  serviceAccountName: tekton-dashboard
  status: PipelineRunCancelled
  timeout: 1h0m0s
status:
  conditions:
  - lastTransitionTime: "2020-06-22T13:22:00Z"
    message: 'PipelineRun "simple-pipeline-run-7v4hb" was cancelled but had errors
      trying to cancel TaskRuns: Failed to patch TaskRun `simple-pipeline-run-7v4hb-deploy-simple-jrqrm`
      with cancellation: taskruns.tekton.dev "simple-pipeline-run-7v4hb-deploy-simple-jrqrm"
      not found'
    reason: PipelineRunCouldntCancel
    status: Unknown
    type: Succeeded
  pipelineSpec:
    params:
    - description: The event type
      name: event-type
      type: string
    resources:
    - name: git-source
      type: git
    - name: docker-image
      type: image
    tasks:
    - name: build-simple
      resources:
        inputs:
        - name: git-source
          resource: git-source
        outputs:
        - name: builtImage
          resource: docker-image
      taskRef:
        kind: Task
        name: build-push
    - conditions:
      - conditionRef: deployment-condition
        params:
        - name: event-type
          value: $(params.event-type)
      name: deploy-simple
      resources:
        inputs:
        - name: git-source
          resource: git-source
        - name: image-out
          resource: docker-image
      runAfter:
      - build-simple
      taskRef:
        kind: Task
        name: deploy-simple-kubectl-task
  startTime: "2020-06-22T12:49:52Z"
  taskRuns:
    simple-pipeline-run-7v4hb-build-simple-wm8gt:
      pipelineTaskName: build-simple
      status:
        conditions:
        - lastTransitionTime: "2020-06-22T12:49:54Z"
          message: 'pod status "Initialized":"False"; message: "containers with incomplete
            status: [credential-initializer place-tools]"'
          reason: Pending
          status: Unknown
          type: Succeeded
        podName: simple-pipeline-run-7v4hb-build-simple-wm8gt-pod-bmqkc
        startTime: "2020-06-22T12:49:52Z"
        steps:
        - container: step-build
          name: build
          waiting:
            reason: PodInitializing
        - container: step-push
          name: push
          waiting:
            reason: PodInitializing
        - container: step-git-source-git-source-m7vkc-nllvv
          name: git-source-git-source-m7vkc-nllvv
          waiting:
            reason: PodInitializing
        - container: step-image-digest-exporter-z4ddf
          name: image-digest-exporter-z4ddf
          waiting:
            reason: PodInitializing
        - container: step-create-dir-builtimage-mvljp
          name: create-dir-builtimage-mvljp
          waiting:
            reason: PodInitializing
        taskSpec:
          params:
          - default: ./git-source/Dockerfile
            description: The path to the dockerfile to build
            name: pathToDockerFile
            type: string
          - default: ./git-source
            description: The build context used by Kaniko (https://github.com/GoogleContainerTools/kaniko#kaniko-build-contexts)
            name: pathToContext
            type: string
          resources:
            inputs:
            - name: git-source
              type: git
            outputs:
            - name: builtImage
              type: image
          steps:
          - args:
            - build
            - -f
            - $(inputs.params.pathToDockerFile)
            - -t
            - $(outputs.resources.builtImage.url)
            - $(inputs.params.pathToContext)
            command:
            - docker
            image: docker
            name: build
            resources: {}
            volumeMounts:
            - mountPath: /var/run/docker.sock
              name: docker-socket
          - args:
            - push
            - $(outputs.resources.builtImage.url)
            command:
            - docker
            image: docker
            name: push
            resources: {}
            volumeMounts:
            - mountPath: /var/run/docker.sock
              name: docker-socket
          volumes:
          - hostPath:
              path: /var/run/docker.sock
              type: Socket
            name: docker-socket
    simple-pipeline-run-7v4hb-deploy-simple-jrqrm:
      conditionChecks:
        simple-pipeline-run-7v4hb-deploy-simple-jrqrm-deployment--n2jtc:
          conditionName: deployment-condition-0
      pipelineTaskName: deploy-simple
Carolyns-MacBook-Pro:~ carolynmabbott$ 

@AlanGreene
Copy link
Member

AlanGreene commented Jun 23, 2020

OK so it's the first case, status: Unknown, reason: PipelineRunCouldntCancel, and there's no completionTime:

status:
  conditions:
  - lastTransitionTime: "2020-06-22T13:22:00Z"
    message: 'PipelineRun "simple-pipeline-run-7v4hb" was cancelled but had errors
      trying to cancel TaskRuns: Failed to patch TaskRun `simple-pipeline-run-7v4hb-deploy-simple-jrqrm`
      with cancellation: taskruns.tekton.dev "simple-pipeline-run-7v4hb-deploy-simple-jrqrm"
      not found'
    reason: PipelineRunCouldntCancel
    status: Unknown
    type: Succeeded

It does look like a pipeline issue alright. I wonder if it will eventually timeout...

Did you delete a TaskRun while the PipelineRun was in progress or was the only action to run and then cancel it? Issue related to deletion of TaskRun while PipelineRun in progress: tektoncd/pipeline#2647

Or perhaps there's some genuine intermittent issue behind this recent test failure: tektoncd/pipeline#2840

@CarolynMabbott
Copy link
Member Author

That explains why the duration keeps increasing

It hasnt timed out so far, got one at 22 hours 32 mins
Might never time out

I havent done anything to it like deleting. List of things I done:
I imported from pipelines hotel, set up a webhook and it got triggered and kicked off a pipelinerun

Some pass, the ones which didnt pass after a while i just stopped and got this error

It seems to be that im getting this bug with every pipelinerun i stop (both reruns and normal, not sure if it makes a difference)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants