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.
- Run the
ibmcloud ce buildrun get --name BUILDRUN_NAMEcommand to display the details of your build run. - Review the
Reasonin the command output.
Take the following steps to help you resolve the problem with your build.
-
Check your secrets. In a build, secrets are used for the following purposes:
- To authenticate at the container registry. A registry secret stores credentials to access a container registry. To list all secrets in your project, including existing registry secrets, run the
ibmcloud ce secret listcommand. To create a registry secret, run theibmcloud ce secret create --format registrycommand. For more information about registry secrets, see Adding access to a private container registry. - To authenticate at a private source code repository. An SSH secret stores credentials to authenticate to a service with an SSH key, such as authenticating to a Git repository, such as GitHub or GitLab. To list all secrets in your project,
including existing SSH secrets, run the
ibmcloud ce secret listcommand. To create an SSH secret, run theibmcloud ce secret create --format sshcommand. For more information about SSH secrets to access repositories, see Accessing private code repositories.
- To authenticate at the container registry. A registry secret stores credentials to access a container registry. To list all secrets in your project, including existing registry secrets, run the
-
After secrets are defined, use the
ibmcloud ce build updatecommand to update the build configuration. If you are referencing an registry secret, specify the name of the secret by using the--registry-secretoption with thebuild updatecommand. 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-secretoption with thebuild updatecommand. For example,ibmcloud ce build update --name <BUILD_NAME> [--registry-secret <REGISTRY_ACCESS_SECRET>] [--git-repo-secret <GIT_REPO_SECRET>] -
Use the
ibmcloud ce buildrun submitcommand to submit a new build run. For thebuildrun submitcommand, you must specify the--buildoption to provide the name of your build configuration. You can optionally specify the--nameoption to provide the name for this build run. If you specify the--nameoption, 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 theibmcloud ce buildrun deletecommand. For example,ibmcloud ce buildrun submit --build <BUILD_NAME> --name <BUILDRUN_NAME>