Troubleshooting Oracle Functions

This topic covers common issues related to Oracle Functions and how to address them.

Use the following techniques to find out more about an error or issue:

  • Use tracing to observe function execution: If a function doesn't run or perform as expected when you invoke it, you can use tracing to debug execution and performance issues. To use tracing, you have to enable tracing for the application containing the function, and then enable tracing for one or more functions. You can then view function traces in the APM Trace Explorer. For more information, see Distributed Tracing for Functions.

  • Use function logs to review function invocation information: The Oracle Cloud Infrastructure Logging service is the default and recommended option for accessing, searching, and storing function logs. Note that to store and view logs for a function, the function must include print statements. For more information, see Storing and Viewing Function Logs.
  • Use DEBUG=1 to see details about requests and responses sent to and from the Oracle Functions service: If you encounter an unexpected error when using an Fn Project CLI command, you can see more details about the HTTP requests and responses sent to and from the Oracle Functions service. Start the command with the string DEBUG=1 and run the command again. For example:

    $ DEBUG=1 fn invoke helloworld-app helloworld-func

    Note that DEBUG=1 must appear before the command, and that DEBUG must be in upper case.

    If you engage with Oracle Support and raise a support ticket, you can attach the output to the ticket.

    Note also that if you have set up a local machine as your Oracle Functions development environment (specifying --provider oracle in the Fn Project CLI context), you must set the environment variable OCI_GO_SDK_DEBUG=v as well as starting the command with DEBUG=1.

The issues in this topic are organized in the following broad categories:

Setting up and running Oracle Functions

Creating applications and functions

Error number and message (if applicable) Description and link
Unable to create your app, please try again. Creating a new application displays an error message in the New Application dialog

Deploying applications and functions

Error number and message (if applicable) Description and link
unauthorized: incorrect username or password Deploying an application returns an "unauthorized: incorrect username or password" message

denied: requested access to the resource is denied

Fn: error running docker push, are you logged into docker?: exit status 1

Deploying a function returns an "error running docker push, are you logged into docker?" message
500: Internal server error Deploying a function returns a ListTriggers message and a 500 error
Image <image-name> does not exist or you do not have access to use it. Deploying a function returns an "Image does not exist or you do not have access to use it" message
401: Missing subnets annotation Deploying a function to Oracle Functions returns "Fn: Missing subnets annotation" message

Invoking functions

Error number and message (if applicable) Description and link

413: Request content too large

FunctionInvokeRequestContentTooLarge

Invoking a function returns an FunctionInvokeRequestContentTooLarge message and a 413 error

429: User-rate limit exceeded

TooManyRequests

Invoking a function returns a TooManyRequests message and a 429 error

502: Function failed Invoking a function returns a Function failed message and a 502 error
502: Syslog endpoint unavailable Invoking a function returns a FunctionInvokeSyslogUnavailable message and a 502 error
502: Failed to pull function image Invoking a function returns a FunctionInvokeImageNotAvailable message and a 502 error
502: subnet ocid1.subnet.... is out of IPs Invoking a function returns a FunctionInvokeSubnetOutOfIPs message and a 502 error
502: subnet ocid1.subnet.... does not exist or Oracle Functions is not authorized to use it Invoking a function returns a FunctionInvokeSubnetNotAvailable message and a 502 error (due to a subnet issue)
502: dhcp options ocid1.dhcpoptions.... does not exist or Oracle Functions is not authorized to use it Invoking a function returns a FunctionInvokeSubnetNotAvailable message and a 502 error (due to a DHCP Options issue)

502: function response body too large

FunctionInvokeResponseBodyTooLarge

Invoking a function returns a FunctionInvokeResponseBodyTooLarge message and a 502 error

502: FunctionInvokeResponseHeaderTooLarge

function response header too large

Invoking a function returns a FunctionInvokeResponseHeaderTooLarge message and a 502 error

502: error receiving function response

FunctionInvokeExecutionError

Invoking a function returns a FunctionInvokeExecutionError message and a 502 error

502: function failed

FunctionInvokeExecutionFailed

Invoking a function returns a FunctionInvokeExecutionFailed message and a 502 error

502: invalid function response

FunctionInvokeInvalidResponse

Invoking a function returns a FunctionInvokeInvalidResponse message and a 502 error

504: Container failed to initialize, please ensure you are using the latest fdk and check the logs

'ModuleNotFoundError: No module named 'contextvars'

Invoking a function returns a FunctionInvokeContainerInitFail error message, a 504 error, and a 'ModuleNotFoundError: No module named 'contextvars'' log message
504: Container failed to initialize, please ensure you are using the latest fdk and check the logs Invoking a function returns FunctionInvokeContainerInitFail and 'Container initialization timed out' messages, and a 504 error
504: Timed out Invoking a function returns a FunctionInvokeTimeout message and a 504 error

504: Container initialization timed out, please ensure you are using the latest fdk and check the logs

FunctionInvokeContainerInitTimeout

Invoking a function returns a FunctionInvokeContainerInitTimeout message and a 504 error

504: Image pull timed out

FunctionInvokeImagePullTimeout

Invoking a function returns a FunctionInvokeImagePullTimeout message and a 504 error

Miscellaneous

Error number and message (if applicable) Description and link
error getting credentials - err: exit status 1, out: Error spawning command line 'dbus-launch --autolaunch... When running Oracle Functions on Ubuntu, Docker login returns an "error getting credentials - err: exit status 1..." message