IBM Cloud Docs
Why is my app create failing?

Why is my app create failing?

You cannot create an app. When you run the ibmcloud ce app create command in the CLI or deploy an app in the console, the application create does not complete successfully and displays a failed or revision failed error message.

If you cannot create an app, determine whether one of the following cases is true.

  1. The name of your app is not unique within the project. You receive an error message that contains Application 'myapp' already exists within project 'myproj', please select a unique name.

  2. The name of your app is not valid. You receive an error message that contains An application name must consist of lowercase alphanumeric characters, '-' and must start with an alphabetic character and end with an alphanumeric character.

  3. If the image that you referenced does not exist, the app create does not complete and an error occurs. You receive an error message that contains Unable to pull the image.

  4. If you do not have the permissions to access the referenced image, the app create does not complete and an error occurs. You receive an error message that contains Unable to pull the image.

  5. The memory or CPU setting is not valid. You receive an error message that contains memory parameter must be between .25 G and 32 G or cpu parameter must be between .0125 and 8.0.For more information about Code Engine limits for apps, see Application limits and defaults for Code Engine.

  6. The resource quota for apps or app revisions is reached and the app (or app revision) is not created. Code Engine has quotas for apps and revisions of the apps within a project. For more information about Code Engine limits, see Project quotas.

  7. If the image for your app is located in Docker Hub and you receive a similar error message that indicates you have reached your Docker pull rate limit.

    429 Too Many Requests - Server message: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit ”
    

Try one of these solutions.

  1. To determine whether the name of your app is unique within the project, use the ibmcloud ce app list command to list all defined apps and check whether an app with the same name exists. If an app with the same name exists, use the ibmcloud ce app delete --name APP_NAME to delete the old app. The name of the app must be unique within your project.

  2. To confirm that the name of your app is valid, check that the name of your app consists of lowercase alphanumeric characters, '-', and that the name starts and ends with an alphabetic character.

  3. To confirm that the image for your app exists, review the error message for information about the failure.

    a. To deploy applications in Code Engine, you need to first create a container image that has all the runtime artifacts your application needs to run, such as runtime libraries. You can use many different methods to create the image, including building your app from source code by using the build container images feature available in Code Engine. Your image can be downloaded from either a public or private image registry. For more information about accessing private registries, see Adding access to a private container registry.

    b. If you use the app create command in the Code Engine CLI, specify the name of the image that is used for your application by using the format REGISTRY/NAMESPACE/REPOSITORY:TAG where REGISTRY and TAG are optional. If REGISTRY is not specified, the default is docker.io. If TAG is not specified, the default is latest. For more information about the format to use to specify the repository for your image, see the ibmcloud ce app create command.

  4. To confirm that you can access the referenced image, verify the location of your image and confirm that you have permissions to access the image.

    If the image is located in a container image registry, such as Docker Hub or IBM Cloud Container Registry, check that you added registry access to Code Engine and that you are using the correct registry secret. For more information about working with images in a container image registry, see adding access to a private container registry.

  5. If you specify the --memory or --cpu option with the app create command, confirm that you are using valid values. In the following command, the values that are specified for --memory and --cpu are not valid; for example,

    ibmcloud ce app create --name myapp  --image icr.io/codeengine/codeengine --memory 50Gi --cpu 20
    

    Example output

    Creating application 'myapp'...
    FAILED
    memory parameter must be between 128Mi and 32Gi
    cpu parameter must be between .01 and 8.0
    

    To fix the errors, set the --memory option between 128 Mi and 32 Gi, and set the --cpu option between 0.01 and 8.0 vCPU.

  6. If you receive an error message that indicates the resource quota is exceeded, delete apps or app revisions before you can deploy additional apps or app revisions.

  7. To address the Docker Hub rate limit problem, you can take the following actions.

    • Authenticate with Docker Hub to increase the rate limit. Be aware of Docker rate limits.

    • Pull the image from Docker Hub and publish the image in a different registry, such as IBM Cloud® Container Registry. Then, pull your image from the new location.

If these solutions do not solve your issue, for further debugging, try retrieving the logs or the system event information for your app. For more information, see How do I get logs for my apps and How do I get system event information for my apps.

For more about working with apps, see Deploying apps.