Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73224

Provisioning error on restart

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • kubernetes-plugin
    • None

      It seems that under some timing conditions it can happen that KubernetesLauncher succeeds in creating a Pod but then the controller terminates before that pod actually connects and comes online. Thus the launched field remains false, and after the build is resumed the launcher attempts to recreate a pod with the same name, which rightly fails and causes the node block to fail as well.

      These are the logs when the issue occurs:

      [Pipeline] Start of Pipeline
      [Pipeline] podTemplate
      [Pipeline] {
      [Pipeline] node
      Created Pod: kubernetes kubernetes-plugin-test/test0-1-22ssr-0frnl-vfw1g
      Pausing (Preparing for shutdown)
      Resuming build at Tue May 28 11:46:28 CEST 2024 after Jenkins restart
      Ready to run at Tue May 28 11:46:28 CEST 2024
      ERROR: Unable to create pod kubernetes kubernetes-plugin-test/test0-1-22ssr-0frnl-vfw1g.
      Failure executing: POST at: https://127.0.0.1:44875/api/v1/namespaces/kubernetes-plugin-test/pods. Message: pods "test0-1-22ssr-0frnl-vfw1g" already exists. Received status: Status(apiVersion=v1, code=409, details=StatusDetails(causes=[], group=null, kind=pods, name=test0-1-22ssr-0frnl-vfw1g, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=pods "test0-1-22ssr-0frnl-vfw1g" already exists, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=AlreadyExists, status=Failure, additionalProperties={}).
      ERROR: Failed to launch test0-1-22ssr-0frnl-vfw1g
      io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://127.0.0.1:44875/api/v1/namespaces/kubernetes-plugin-test/pods. Message: pods "test0-1-22ssr-0frnl-vfw1g" already exists. Received status: Status(apiVersion=v1, code=409, details=StatusDetails(causes=[], group=null, kind=pods, name=test0-1-22ssr-0frnl-vfw1g, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=pods "test0-1-22ssr-0frnl-vfw1g" already exists, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=AlreadyExists, status=Failure, additionalProperties={})

            amuniz Antonio Muñiz
            amuniz Antonio Muñiz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: