IBM Cloud Docs
Build fails when the build did not register correctly and a secret does not exist

Build fails when the build did not register correctly and a secret does not exist

After you create and run a build, your build does not complete successfully and you receive a message that the build is not registered correctly and a secret does not exist.

If you receive a message that the build is not registered correctly and a secret does not exist, then the BUILD_NAME build was not correctly defined.

Example error message

The Build is not registered correctly, build: <BUILD_NAME>, registered status: False, reason: SpecSourceSecretNotFound|SpecOutputSecretRefNotFound|MultipleSecretRefNotFound

The BUILD_NAME build references a secret that does not exist. If the reason is SpecOutputSecretRefNotFound, then a registry secret does not exist. If it is SpecSourceSecretNotFound, then a secret to access the Git repository is missing. The reason is MultipleSecretRefNotFound if both secrets do not exist. Correct the build to reference existing secrets.

Try one of these solutions.

Whether you are running your build in the console or in the CLI, use the CLI for troubleshooting problems with your build.

  1. Run the ibmcloud ce buildrun get --name BUILDRUN_NAME command to display the details of your build run.
  2. Review the Reason in the command output.

Take the following steps to help you resolve the problem with your build.

  1. Check your secrets. In a build, secrets are used for the following purposes:

  2. After secrets are defined, use the ibmcloud ce build update command to update the build configuration. If you are referencing an registry secret, specify the name of the secret by using the --registry-secret option with the build update command. If you are referencing an SSH secret to access a private repository that contains the source code to build your container image, specify the --git-repo-secret option with the build update command. For example,

    ibmcloud ce build update --name <BUILD_NAME> [--registry-secret <REGISTRY_ACCESS_SECRET>] [--git-repo-secret <GIT_REPO_SECRET>] 
    
  3. Use the ibmcloud ce buildrun submit command to submit a new build run. For the buildrun submit command, you must specify the --build option to provide the name of your build configuration. You can optionally specify the --name option to provide the name for this build run. If you specify the --name option, make sure that you use a different build run name from the failed build run, or ensure that you delete the failed build run by using the ibmcloud ce buildrun delete command. For example,

    ibmcloud ce buildrun submit --build <BUILD_NAME> --name <BUILDRUN_NAME>