Troubleshooting OCI Functions


Find out how to troubleshoot problems with OCI Functions, and possible solutions to common issues.

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

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

Use the Errors chart on the Metrics page in the Console to see error codes and messages for individual functions: If a function doesn't run or perform as expected when you invoke it, you can use the Errors chart on the Metrics page in the Console to see error codes and error messages for that function. For more information, see Function Metrics.
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 OCI 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 OCI 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 OCI 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 OCI Functions
Creating applications and functions
Deploying applications and functions
Invoking functions
Miscellaneous
Setting up and running OCI Functions
Error number and message (if applicable)	Description and link
401: Not authenticated	Running Fn Project CLI commands returns a 401 error
404: Resource is not authorized or not found	Running Fn Project CLI commands returns a 404 error
x509: decryption password incorrect	Running Fn Project CLI commands returns an X509: decryption password incorrect error
Error response from daemon... unknown: Unauthorized	Performing Docker-related operations with the Fn Project CLI displays an "Error response from daemon... unknown: Unauthorized" message
asn1:structure error: tags don't match	Running an Fn Project CLI command displays an "Fn: asn1:structure error: tags don't match" message
Client version: n.n.nn is not latest: n.n.nn	Running fn version shows that a more recent version of the Fn Project CLI is available
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 OCI Functions returns "Fn: Missing subnets annotation" message
Function's image architecture 'x86' is incompatible with the application's shape type 'GENERIC_X86_ARM'	Deploying a function to OCI Functions returns "Function's image architecture 'x86' is incompatible..." 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


444	Invoking a function causes the client to report a timeout, and a 444 error is shown in the function's logs
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: Unable to get resource authorization token due to Function resource matching too many Dynamic Groups. Update your Dynamic Groups' matching rules

FunctionInvokeTooManyMatchingDGs

	Invoking a function returns a FunctionInvokeTooManyMatchingDGs 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




502: Customer subnet DNS resolver error. Please fix the subnet configuration and try again

	Invoking a function returns a FunctionInvokeSubnetConfigError message and a 502 error


503: Timed out - server too busy

FunctionInvokeServiceUnavailable

	Invoking a function returns a FunctionInvokeServiceUnavailable message and a 503 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 OCI Functions on Ubuntu, Docker login returns an "error getting credentials - err: exit status 1..." message