Code Monkey home page Code Monkey logo

Comments (10)

AlanGreene avatar AlanGreene commented on July 4, 2024 1

"unexpected end of JSON input" is being returned in the pod logs, it's not something added by the Dashboard. The timestamp is part of the logs too returned by the k8s API server.

from pipeline.

vdemeester avatar vdemeester commented on July 4, 2024

@uqix thanks for the report. I am not sure I understand the relation between the error (in a step unexpected end of JSON input is the log of a step execution) and the order in the status. The order in the list in the status, doesn't necessarily reflect the execution order (I don't think we give any guarantees there).

Without the definition of the StepAction, it is a bit hard to debug your issue. Can you share the definition of the StepAction ?

from pipeline.

uqix avatar uqix commented on July 4, 2024

Sorry for late reply, here's the simplified yaml to reproduce the problem:

  • stepaction:
apiVersion: tekton.dev/v1alpha1
kind: StepAction
metadata:
  name: git-checkout
  labels:
    kustomize.toolkit.fluxcd.io/substitute: disabled
    app.kubernetes.io/version: "1.0.0"
spec:
  image: bitnami/git:2.41.0
  script: |
    #!/usr/bin/env bash
    set -exu -o pipefail +o histexpand
    shopt -s inherit_errexit extglob
    echo test
  • taskrun:
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  generateName: build-ts-v1-dev-
spec:
  taskSpec:
    steps:
      - name: test
        ref:
          name: git-checkout-v1
      - name: test2
        ref:
          name: git-checkout-v1
      - name: test3
        ref:
          name: git-checkout-v1
  • Error:
image
  • Some experiment:
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  generateName: build-ts-v1-dev-
spec:
  taskSpec:
    steps:
      - name: test
        ref:
          name: git-checkout-v1
      - name: test2
        ref:
          name: git-checkout-v1
      # - name: test3
      #   ref:
      #     name: git-checkout-v1
image

Comment out 3rd step, it suddenly works.

from pipeline.

vdemeester avatar vdemeester commented on July 4, 2024

2024-02-26-100955

Interesting, it just works for me. I wonder if the "unexpected end of json input" might be dashboard related only ? (cc @AlanGreene as I am clueless πŸ™ƒ )

nit: git-checkout-v1 should be git-checkout in your TaskRun example though

from pipeline.

vdemeester avatar vdemeester commented on July 4, 2024

@uqix how does the TaskRun looks like from the API or CLI ? (kubectl get taskrun build-ts-…)

from pipeline.

uqix avatar uqix commented on July 4, 2024

Here's some significant diffs of their pods: (left side from the 2-steps task, right side from the 3-steps task)

1st container:

image

2nd container:

image

Those container args of the 3-steps task (right side) seem weird.

from pipeline.

uqix avatar uqix commented on July 4, 2024

My feature-flags configmap:

apiVersion: v1
kind: ConfigMap
metadata:
  namespace: tekton-pipelines
  name: feature-flags
data:
  enable-api-fields: alpha
  enable-param-enum: "true"
  enable-step-actions: "true"

from pipeline.

uqix avatar uqix commented on July 4, 2024

I also diffed taskruns, nothing wrong found:

  • 2-steps taskrun:
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  annotations:
    pipeline.tekton.dev/release: d714545
  creationTimestamp: "2024-02-26T12:01:38Z"
  generateName: build-ts-v1-dev-
  generation: 1
  labels:
    app.kubernetes.io/managed-by: tekton-pipelines
  name: build-ts-v1-dev-7m5m9
  namespace: tekton-run
  resourceVersion: "112152331"
  uid: 7274fbc5-786f-43a9-b908-50858bd77cf5
spec:
  podTemplate:
    env:
    - name: TZ
      value: Asia/Shanghai
    nodeSelector:
      ci-load: "true"
  serviceAccountName: tekton-run
  taskSpec:
    steps:
    - computeResources: {}
      name: test
      ref:
        name: git-checkout-v1
    - computeResources: {}
      name: test2
      ref:
        name: git-checkout-v1
  timeout: 1h0m0s
status:
  completionTime: "2024-02-26T12:01:45Z"
  conditions:
  - lastTransitionTime: "2024-02-26T12:01:45Z"
    message: All Steps have completed executing
    reason: Succeeded
    status: "True"
    type: Succeeded
  podName: build-ts-v1-dev-7m5m9-pod
  provenance:
    featureFlags:
      AwaitSidecarReadiness: true
      Coschedule: workspaces
      DisableAffinityAssistant: false
      DisableCredsInit: false
      EnableAPIFields: alpha
      EnableCELInWhenExpression: false
      EnableKeepPodOnCancel: false
      EnableParamEnum: true
      EnableProvenanceInStatus: true
      EnableStepActions: true
      EnableTektonOCIBundles: true
      EnforceNonfalsifiability: none
      MaxResultSize: 4096
      RequireGitSSHSecretKnownHosts: false
      ResultExtractionMethod: termination-message
      RunningInEnvWithInjectedSidecars: true
      ScopeWhenExpressionsToTask: false
      SendCloudEventsForRuns: false
      SetSecurityContext: false
      VerificationNoMatchPolicy: ignore
  startTime: "2024-02-26T12:01:39Z"
  steps:
  - container: step-test
    imageID: curlimages/curl@sha256:961cf9e2a1939ea380b3f16e313a581b5d4681dd9dc4b1ace060eb396a71df0d
    name: test
    terminated:
      containerID: containerd://ce735e91d1fb6d2db38c0be5091f57adf690acc5d45dd6b357a4eecebc4271a0
      exitCode: 0
      finishedAt: "2024-02-26T12:01:44Z"
      reason: Completed
      startedAt: "2024-02-26T12:01:44Z"
    terminationReason: Completed
  - container: step-test2
    imageID: curlimages/curl@sha256:961cf9e2a1939ea380b3f16e313a581b5d4681dd9dc4b1ace060eb396a71df0d
    name: test2
    terminated:
      containerID: containerd://362a4e0679881f9b7367fffee27d6c2439b1d9c88639516f13f0893b07ed384e
      exitCode: 0
      finishedAt: "2024-02-26T12:01:44Z"
      reason: Completed
      startedAt: "2024-02-26T12:01:44Z"
    terminationReason: Completed
  taskSpec:
    steps:
    - computeResources: {}
      image: curlimages/curl:8.3.0
      name: test
      script: |
        #!/usr/bin/env sh
        echo test
    - computeResources: {}
      image: curlimages/curl:8.3.0
      name: test2
      script: |
        #!/usr/bin/env sh
        echo test
  • 3-steps taskrun:
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
  annotations:
    pipeline.tekton.dev/release: d714545
  creationTimestamp: "2024-02-26T11:57:07Z"
  generateName: build-ts-v1-dev-
  generation: 1
  labels:
    app.kubernetes.io/managed-by: tekton-pipelines
  name: build-ts-v1-dev-695zn
  namespace: tekton-run
  resourceVersion: "112150352"
  uid: 06d379d4-a9db-4241-80f7-144d38df451f
spec:
  podTemplate:
    env:
    - name: TZ
      value: Asia/Shanghai
    nodeSelector:
      ci-load: "true"
  serviceAccountName: tekton-run
  taskSpec:
    steps:
    - computeResources: {}
      name: test
      ref:
        name: git-checkout-v1
    - computeResources: {}
      name: test2
      ref:
        name: git-checkout-v1
    - computeResources: {}
      name: test3
      ref:
        name: git-checkout-v1
  timeout: 1h0m0s
status:
  completionTime: "2024-02-26T11:57:11Z"
  conditions:
  - lastTransitionTime: "2024-02-26T11:57:11Z"
    message: '"step-test" exited with code 1'
    reason: Failed
    status: "False"
    type: Succeeded
  podName: build-ts-v1-dev-695zn-pod
  provenance:
    featureFlags:
      AwaitSidecarReadiness: true
      Coschedule: workspaces
      DisableAffinityAssistant: false
      DisableCredsInit: false
      EnableAPIFields: alpha
      EnableCELInWhenExpression: false
      EnableKeepPodOnCancel: false
      EnableParamEnum: true
      EnableProvenanceInStatus: true
      EnableStepActions: true
      EnableTektonOCIBundles: true
      EnforceNonfalsifiability: none
      MaxResultSize: 4096
      RequireGitSSHSecretKnownHosts: false
      ResultExtractionMethod: termination-message
      RunningInEnvWithInjectedSidecars: true
      ScopeWhenExpressionsToTask: false
      SendCloudEventsForRuns: false
      SetSecurityContext: false
      VerificationNoMatchPolicy: ignore
  startTime: "2024-02-26T11:57:07Z"
  steps:
  - container: step-test
    imageID: curlimages/curl@sha256:961cf9e2a1939ea380b3f16e313a581b5d4681dd9dc4b1ace060eb396a71df0d
    name: test
    terminated:
      containerID: containerd://18226fec428d930e877709360de2001d245e8d8c3f1db884bdc00e32e3b68b09
      exitCode: 1
      finishedAt: "2024-02-26T11:57:09Z"
      reason: Error
      startedAt: "2024-02-26T11:57:09Z"
  - container: step-test2
    imageID: curlimages/curl@sha256:961cf9e2a1939ea380b3f16e313a581b5d4681dd9dc4b1ace060eb396a71df0d
    name: test2
    terminated:
      containerID: containerd://f91fa78a4a74785144238b62c7e5561fffe3ac2744075cc8b85cfb91ad2af2d1
      exitCode: 1
      finishedAt: "2024-02-26T11:57:09Z"
      reason: Error
      startedAt: "2024-02-26T11:57:09Z"
  - container: step-test3
    imageID: curlimages/curl@sha256:961cf9e2a1939ea380b3f16e313a581b5d4681dd9dc4b1ace060eb396a71df0d
    name: test3
    terminated:
      containerID: containerd://10db25d703f7e60827a1fe8277b46c5a1aaf8fd550cd3e880c8076ff3c6e0353
      exitCode: 1
      finishedAt: "2024-02-26T11:57:10Z"
      reason: Error
      startedAt: "2024-02-26T11:57:10Z"
  taskSpec:
    steps:
    - computeResources: {}
      image: curlimages/curl:8.3.0
      name: test
      script: |
        #!/usr/bin/env sh
        echo test
    - computeResources: {}
      image: curlimages/curl:8.3.0
      name: test2
      script: |
        #!/usr/bin/env sh
        echo test
    - computeResources: {}
      image: curlimages/curl:8.3.0
      name: test3
      script: |
        #!/usr/bin/env sh
        echo test

from pipeline.

uqix avatar uqix commented on July 4, 2024

Interesting, it just works for me.

Just figured it out: our k8s contains some kyverno policy that auto rewrites pod image addresses like this:

curlimages/curl:8.3.0 -> our.harbor/some-ns/curlimages/curl:8.3.0

this image rewriting causes StepAction trouble.

from pipeline.

vdemeester avatar vdemeester commented on July 4, 2024

@uqix good to know, I think we can close this then πŸ‘ΌπŸΌ

from pipeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.