Function Status Code

Last updated: 2021-10-26 15:40:39

    If an error code is returned after the function is executed, you can find the cause and solution for the error code by referring to the following table.

    Status Code and Status Message Description Solution
    200
    Success
    The execution is successful. -
    400
    InvalidParameterValue
    The request event passed in by the event execution function is not of the JSON type. Please make modifications as instructed in Introduction and InvokeFunction and try again.
    401
    InvalidCredentials
    The verification fails. Your account does not have the permission to manipulate this function. Please make modifications as instructed in the authorization description in Permission Management Overview and try again.
    404
    InvalidSubnetID
    The subnet ID in the network configuration of the function is exceptional. Please check whether the network configuration of the function is correct and whether the subnet ID is valid.
    405
    ContainerStateExited
    The container exits. Please check your image or bootstrap file to see whether it can be properly started locally.
    If so, please check whether the use limits of SCF are followed; for example, RootFS is read-only and only `/tmp` is writable.
    Local debugging command: `docker run -itd --read-only -v /tmp:/tmp`.
    406
    RequestTooLarge
    The `event` input parameter of the function, i.e., the request event size of the function, exceeds the quota limit. The request event size exceeds the quota limit, which is 6 MB for sync request events or 128 KB for async ones. Please adjust the request event size accordingly and try again.
    407
    The size of response exceeds the upper limit (6MB)
    The size of function response exceeds the upper limit of 6 MB. Please adjust it and try again.
    410
    InsufficientBalance
    The account balance is insufficient. The SCF service is suspended because the Tencent Cloud account has overdue payments. Please top up and try again.
    429
    ResourceLimit
    The container request rate is too high and exceeds the limit due to concurrency surges. The default speed of elastic concurrency expansion for each account is 500 concurrent instances per region per minute. During a sudden concurrency surge, if there are not enough containers to carry the requests, a large number of container request actions will be triggered, and this message will be returned when the account limit is exceeded.
    • After assessing the function concurrency, please configure provisioned concurrency for the function and prepare containers in advance to avoid sudden concurrency surges from causing the container request speed to exceed the limit.
    • If assessment shows that the provisioned concurrency cannot meet the needs of your business scenario, you can smart customer service to increase the container request speed quota in the corresponding region.
    430
    User code exception caught
    A user code execution error occurs. Please check the code error stack information in the invocation log provided by the SCF console, make modifications, and try again.
    432
    ResourceLimitReached
    The account-level or region-level concurrency limit is reached.
    • For a function with a maximum dedicated quota configured, if the function concurrency exceeds the quota, this message will be returned. You can assess your business needs and increase the quota or refer to Concurrency Overrun Troubleshooting.
    • For a function with no maximum dedicated quota configured, if the concurrency quota actually used by the function exceeds the region-level unused concurrency quota, this message will be returned. You can assess your business needs and configure a maximum dedicated quota for the function. If the remaining available quota in the corresponding region cannot meet your business needs, you can smart customer service to increase the total concurrency quota in the region.
    433
    TimeLimitReached
    Function execution is not completed after the execution timeout period elapses.
    • Please check whether a large number of time-consuming operations exists in the service code.
    • Please set a longer timeout period on the **Function Configuration** page. If the current timeout period has been set to the maximum value, you can create an async function as instructed in Async Execution to get a function execution duration of up to 24 hours.
    434
    MemoryLimitReached
    The memory limit is reached.
    • Please check the code logic to see whether there is a memory leak.
    • Please increase the memory configuration on the **Function Configuration** page, or apply for a large memory on the **Function Memory Configuration** page to get up to 120 GB of function execution memory.
    435
    FunctionNotFound
    The function is not found.
    • Please check whether the input parameters match the information of the function to be invoked.
    • Please check whether the function exists when it is invoked and whether there is any deletion action that causes the function to be invoked after deletion.
    436
    InvalidParameterValue
    The parameter passed in for `invoke` does not conform to the specification. The parameter does not conform to the specification. Please modify it as instructed in Introduction and try again.
    437
    HandlerNotFound
    The function package is loaded incorrectly.
    • Please check whether the compressed package is in normal status.
    • The function execution entry file is not found. Please make sure that the entry file is in the root directory of the decompressed code package.
    • Please check the entry file and execution method in the code package.
    438
    FunctionStatusError
    The function is exceptional or the SCF service is suspended.
    • The function is invoked in an exceptional state. Please wait for the function status to become normal and try again.
    • The SCF service is suspended because the Tencent Cloud account has overdue payments. Please top up and try again.
    439
    User preocess exit when running
    The user process exits accidentally. Based on the error message, please find out the cause, fix the function code, and try again.
    441
    UnauthorizedOperation
    CAM authentication fails. Please check whether the CAM authentication parameters for the function invoker are passed correctly. For more information, please see the authorization description in Permission Management Overview.
    442
    QualifierNotFound
    The specified version is not found. The function version does not exist. Please check the function version and try again.
    443
    UserCodeError
    A user code execution error occurs. Based on the error log on the console, please check the error stack of the code and see whether the code can be executed properly.
    444
    PullImageFailed
    Image pull fails. Please check the integrity and validity of the selected image and try again; for example, check whether it can be downloaded locally. If the problem persists, please contact the smart customer service or submit a ticket.
    445
    ContainerInitError
    Container start fails. Container start fails. Please check whether your bootstrap file has been uploaded successfully and ensure that the invocation path is correct.
    • For an image deployment-based function, please check whether the `Command` or `Args` parameter passed in the console is in the correct format. For more information, please see Usage.
    • For a code deployment-based function, please check whether your bootstrap file has been uploaded successfully and ensure that the invocation path is correct.
    446
    PortBindingFailed
    Port listening fails. The container initialization duration exceeds the initialization timeout period.
  • Please check whether the listening port is 9000.
  • Please check whether all the files in the code package or container image are required files. Appropriate streamlining can improve the initialization speed of the container.
  • Please check whether there are any exceptions or time-consuming business logic in the initialization code. You can appropriately increase the initialization timeout period and try again.
  • 447
    PullImageTimeOut
    Image pull times out. It may be a timeout caused by a large image or network jitters. Please minimize the image or increase the initialization timeout period and try again. If the problem persists, please contact the smart customer service or submit a ticket.
    449
    InsufficientResources
    The configured function memory exceeds 3,072 MB but there are no resources available in the region.
  • Please adjust the configured function memory to less than or equal to 3,072 MB.
  • If assessment shows that the memory required for function execution exceeds 3,072 MB, you can apply for a large-memory function.
  • 450
    InitContainerTimeout
    Container start times out. The container start duration exceeds the initialization timeout period. Please minimize the code or increase the initialization timeout period and try again.
    499
    RequestCanceled
    The function execution request is canceled.
    • For an asynchronously executed function, if the user cancels the function execution request, this message will be returned.
    • For an HTTP-triggered function, if the timeout period of an API Gateway trigger is less than the sum of the initialization duration and execution duration of the function, this message will be returned. Please check whether there is any exceptionally time-consuming business logic in the code or increase the backend timeout period of the API and try again.
    500
    InternalError
    Internal error. Internal error. Please try again. If the problem persists, please contact the smart customer service or submit a ticket.

    Execution method

    The execution method specifies the starting file and function while invoking the cloud function as shown below:

    • For Go programming, use the FileName format, such as main.

    • For Python, Node.js, or PHP programming, use the FileName.FunctionName format, such as index.main_handler.

      • Please note that FileName does not include the file name extension, and FunctionName is the name of the entry function. Ensure that the file name extension matches the programming language. For example, for Python programming, the file name extension is .py, and for Node.js programming, the file name extension is .js. For more information, please see "Execution Method" in Basic Concepts.
    • For Java programming, use the package.class::method format, such as example.Hello::mainHandler.

    • For the Custom Runtime environment, a non-fixed format can be used based on the custom programming language implementation.