Issues deploying applications and functions

Find out how to troubleshoot problems when deploying applications and functions with OCI Functions.

You might encounter these issues when deploying applications and functions with OCI Functions.

Deploying an application returns an "unauthorized: incorrect username or password" message

When deploying an application, you might see a message similar to the following:

$ fn -v deploy --app acme-app

Deploying go-app to app: acme-app
Bumped to version 0.0.2
Building image phx.ocir.io/ansh81vru1zp/acme-repo/go-app:0.0.2
FN_REGISTRY: phx.ocir.io/ansh81vru1zp/acme-repo
Current Context: acme-functions-compartment
Sending build context to Docker daemon 5.12kB
Step 1/10 : FROM fnproject/go:dev as build-stage
Get https://registry-1.docker.io/v2/fnproject/go/manifests/dev: unauthorized: incorrect username or password

The message indicates an unnecessary and unsuccessful attempt to log in to Docker Hub. To resolve this situation, log out from Docker using the following command:

docker logout

Having logged out from Docker, re-run the command to deploy the application.

Deploying a function returns an "error running docker push, are you logged into docker?" message

If you see a message similar to the following when deploying a function, double-check that your development environment doesn't have the FN_REGISTRY environment variable set to your Docker username:

The push refers to repository [docker.io. ...
.
.
.
denied: requested access to the resource is denied
Fn: error running docker push, are you logged into docker?: exit status 1
See fn <command> --help’ for more information.
			

If you have used the open source Fn Project platform, you might have followed instructions in the Fn Project documentation to set the FN_REGISTRY environment variable to your Docker username to enable interaction with the official Docker registry (docker.io).

The FN_REGISTRY environment variable overrides the value of the registry option in your Fn Project CLI context.

To use the Fn Project CLI with OCI Functions, do one of the following:

  • Unset the FN_REGISTRY environment variable.
  • Override the FN_REGISTRY environment variable using the --registry global option whenever you enter an Fn Project CLI command that interacts with Oracle Cloud Infrastructure Registry.

Deploying a function returns a ListTriggers message and a 500 error

When deploying a function that you've previously created using an earlier version of the Fn Project CLI, you might see a message similar to the following:

Fn: [GET /triggers][500] ListTriggers default  &{Fields: Message:Internal server error}

This message indicates that the function's func.yaml file contains one or more HTTP trigger definitions. OCI Functions does not currently support HTTP triggers. To deploy the function, remove the triggers: section from the func.yaml file.

To avoid creating new func.yaml files containing trigger definitions, follow the instructions in Installing the Fn Project CLI to upgrade the Fn Project CLI to the most recent version.

Deploying a function returns an "Image does not exist or you do not have access to use it" message

When deploying a function using an Oracle Cloud Infrastructure compute instance as your OCI Functions development environment, you might see a message similar to the following:

Fn: Image phx.ocir.io/ansh81vru1zp/acme-repo/helloworld-func:0.0.2 does not exist or you do not have access to use it.

This message indicates that the compute instance does not have access to Oracle Cloud Infrastructure Registry.

Double-check that a policy statement (similar to the one below) exists in the tenancy's root compartment to allow a dynamic group that includes the compute instance's OCID to access Oracle Cloud Infrastructure Registry:

 Allow dynamic-group <dynamic-group-name> to read repos in tenancy

For more information about using an Oracle Cloud Infrastructure compute instance as your development environment, see Different Options for Function Development Environments.

Deploying a function to OCI Functions returns "Fn: Missing subnets annotation" message

When you deploy a function to OCI Functions, you might see the following message:

$ fn deploy --app joes-helloworld-app

Deploying helloworld-func to app: joes-helloworld-app
.
.
.
Fn: Missing subnets annotation

If you see the Fn: Missing subnets annotation message, confirm that you entered the correct application name. For example:

  • the application might not be in the compartment currently specified by the Fn Project CLI context
  • the application might have existed previously, but has subsequently been deleted

Deploying a function to OCI Functions returns "Function's image architecture 'x86' is incompatible..." message

When you deploy a function to OCI Functions, you might see a message similar to the following:

$ fn deploy --app joes-helloworld-app

Deploying helloworld-func to app: joes-helloworld-app
.
.
.
Fn: Service error:InvalidParameter. Invalid Invalid image - Function's image architecture 'x86' is incompatible with the application's shape type 'GENERIC_X86_ARM'. http status code: 400. Opc request id:...

This message indicates that the function's image does not include the necessary dependencies (child images) for the application's shape. A likely cause of the message is the use of Fn Project CLI version 0.6.24 (or earlier) to deploy a function with an x86 image to:

  • an application that has a multi-architecture shape (such as Generic_X86_ARM)
  • an application that has a single architecture shape that is not compatible with an x86 image (such as Generic_ARM)

From Fn Project CLI version 0.6.25 onwards, when you use the command fn deploy --app <app-name> to build a function and deploy it to OCI Functions, the Fn Project CLI builds the function's Docker image with the necessary dependencies for the application's shape. If the application has a multi-architecture shape (such as Generic_X86_ARM, the default application shape since September, 2023), the Fn Project CLI builds a multi-architecture image for the function. The function's image and the application's shape are always compatible.

However, Fn Project CLI version 0.6.24 (and earlier) always builds Docker images with the necessary dependencies for a single architecture, the x86 architecture. As a single architecture image, such an x86 image is only compatible with applications that have the Generic_X86 single architecture shape. The x86 image is incompatible with applications that have:

  • a multi-architecture shape (such as Generic_X86_ARM, the default application shape since September, 2023)
  • a single architecture shape that is not Generic_X86 (such as Generic_ARM)

To deploy the function successfully, you have to provide an image that is compatible with the application's shape. Do one of the following:

  • Use Fn Project CLI version 0.6.25 or later (recommended).
  • Deploy the function to a different application that has a shape that is compatible with the function's image (create a new application if necessary). Assuming you are using Fn Project CLI version 0.6.24 or earlier, always deploy the function to an application that has a Generic_X86 shape.
  • Use Docker to build an image that is compatible with the application's architecture shape.

For more information, see Specifying the Compute Architecture on Which to Run Functions.

Deploying a function to OCI Functions in Cloud Shell returns "OL8 Cloud Shell does not support cross-compilation and multi-arch functions builds..." message

When you deploy a function to OCI Functions in the Cloud Shell development environment, you might see a message similar to the following:

OL8 CloudShell does not support cross-compilation and multi-arch functions builds. Please ensure the architecture of your App matches the CloudShell architecture.

This message indicates that the function is based on a multi-architecture image, or that the application has a multi-architecture shape, or that the Cloud Shell session and the application have a different architecture.

In the Cloud Shell development environment, OCI Functions does not support the creation and deployment of functions based on multi-architecture images, nor applications with multi-architecture shapes. In addition, the Cloud Shell session's architecture must be the same as the application's architecture.

For more information:

Deploying a function returns an "Invalid or unsupported image manifest. Unable to get architecture from the OCIR Manifest/Headers…" message

When you deploy a function to OCI Functions, you might see a message similar to the following:

$ fn -v deploy --app acme-app

Fn: Service error:InvalidParameter. Invalid or unsupported image manifest. Unable to get architecture from the OCIR Manifest/Headers. http status code: 400.

There are a number of possible causes and solutions, as described in this section.

Possible cause: Incorrect Docker version

The Docker version you are using might be unsupported.

If you are using Docker to build function images, you must use a supported version of Docker (at the time of writing, version 17.10 or later).

To confirm the version of Docker that you are using, enter:

docker version

If the version of Docker is not supported, install a more recent version. For more information, see Installing Docker for Use with OCI Functions.

Possible cause: Manifest is incorrectly formatted, or is missing required information

The image manifest might be incorrectly formatted, or might not contain all of the required information. The error message provides additional details.

Specifically, the image manifest:

  • Must be in valid JSON format.
  • Must include an image digest.
  • Must specify a valid image architecture (either amd64 or arm64, or both).

To inspect the image manifest, enter:

docker manifest inspect --verbose <image-path>

For example:

docker manifest inspect --verbose phx.ocir.io/ansh81vru1zp/acme-repo/acme-func:0.0.3

Verify that the image manifest:

  • Is in valid JSON format.
  • Includes a digest field.
  • Includes a platform field that specifies a valid image architecture. In the case of a single architecture image, the platform field must specify either amd64 or arm64. In the case of a multi-architecture image, the platform field must specify both amd64 and arm64. For more information, see Specifying the Compute Architecture on Which to Run Functions.

If the image manifest is incorrectly formatted, or is missing required information, update the manifest and rebuild the image.

Possible cause: Image is invalid

The image built from the image manifest might be invalid (for example, because the image manifest is missing required information).

In this situation, you have to rebuild the image. How to rebuild the image depends on whether you are rebuilding a single architecture image or a multi-architecture image, and on the tool you want to use.

Rebuilding a single architecture image:

You can rebuild single architecture images in different ways, including:

  • Using the Fn Project CLI (Recommended):

    In the function's directory, enter the following Fn Project CLI command to build the function and its dependencies as a single architecture image, push the image to the specified Docker registry, and deploy the function to OCI Functions:

    fn deploy --app <your-function-app>

    where <app-name> is the name of the application with the single architecture shape, in which you want to create the function.

    For more information, see Using the Fn Project CLI to build a single architecture image.

  • Using the Docker build command or the Docker buildx plugin:

    To build an image for the same architecture as your current platform, use the docker build command. For example, to build an image to deploy on an application with amd64 as the single architecture shape, enter:

    docker build --platform linux/amd64 -t <image-path> .

    To build an image for a different architecture than your current platform, use the docker buildx build command. For example, to build an image to deploy on an application with amd64 as the single architecture shape, enter:

    docker buildx build --platform linux/amd64 -t <image-path> .

    Be sure to specify either amd64 or arm64, and not to specify both. Also be sure not to specify any other architecture.

    Having built the image, enter the following command to push the image to the Docker registry:

    docker push <image-path>

    For more information, see Using the Docker build command to build a single architecture image.

Rebuilding a multi-architecture image:

You can rebuild multi-architecture images in different ways, including:

  • Using the Fn Project CLI (Recommended):

    In the function's directory, enter the following Fn Project CLI command to build the function and its dependencies as a multi-architecture image, push the image to the specified Docker registry, and deploy the function to OCI Functions:

    fn deploy --app <your-function-app>

    where <app-name> is the name of the application with the multi-architecture shape, in which you want to create the function.

    For more information, see Using the Fn Project CLI to build a multi-architecture image (recommended)..

  • Using the Docker buildx plugin:

    To build a multi-architecture image on which to base a function to deploy to an application with a multi-architecture shape, enter the following docker buildx build command:

    docker buildx build --platform linux/amd64,linux/arm64 -t <your-registry>/<your-image>:<tag> --push .

    Be sure to specify both amd64 and arm64, and not to specify any other architecture.

    Having built the image, enter the following command to push the image to the Docker registry:

    docker push <image-path>

    For more information, see Using the Docker buildx plugin to build a multi-architecture image..