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.