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

Could not find credentials matching during docker build

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We have a jenkins job that builds a docker image from docker file using the build and publish and then pushes it to a private docker registry. It used to work fine.

      Now there were some updates to the DTR. We didn't touch the Jenkins job configuration, but I now get the following error when running the builds:

      {{ERROR: Could not find credentials matching test-docker
      hudson.AbortException: Could not find credentials matching test-docker
      at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:217)
      at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:204)
      at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:196)
      at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:455)
      at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:431)
      at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:373)
      at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:311)
      at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:291)
      at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:262)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      at hudson.model.Build$BuildExecution.build(Build.java:205)
      at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      at hudson.model.Run.execute(Run.java:1728)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:404)
      Build step 'Docker Build and Publish' marked build as failure}}

      The credential is definitely there (as username / password) and that same credential used to work before...

      Any idea what might be going on?

        Attachments

          Activity

          Hide
          demmeln Nikolaus Demmel added a comment -

          Maybe this has nothing to do the DTR update and was never actually working in the first place, we just never noticed because of the shared docker daemon and the machine being rebooted seldomly.

          Maybe an update in the plugin caused the error to surface where before it was ignored more or less silentlty: https://github.com/jenkinsci/docker-commons-plugin/commit/702579ffe9001f4394e696dcc1d7990012ce97df

          Show
          demmeln Nikolaus Demmel added a comment - Maybe this has nothing to do the DTR update and was never actually working in the first place, we just never noticed because of the shared docker daemon and the machine being rebooted seldomly. Maybe an update in the plugin caused the error to surface where before it was ignored more or less silentlty: https://github.com/jenkinsci/docker-commons-plugin/commit/702579ffe9001f4394e696dcc1d7990012ce97df
          Hide
          demmeln Nikolaus Demmel added a comment -

          It turns out this was an issue with credentials and domains. I had inadvertedly used the wrong "domain" for the credentials, which meant that they would appear in the list of credentials to select, but the job would then fails.

          Solution is to add the DTR domain to that particular credential domain in Jenkins.

          Show
          demmeln Nikolaus Demmel added a comment - It turns out this was an issue with credentials and domains. I had inadvertedly used the wrong "domain" for the credentials, which meant that they would appear in the list of credentials to select, but the job would then fails. Solution is to add the DTR domain to that particular credential domain in Jenkins.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            demmeln Nikolaus Demmel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: