Viewing Network Load Balancer Work Request Errors

Many of the configuration steps used to create and configure network load balancer (NLB) operation do not take effect immediately. In these cases, the request initiates an asynchronous work flow known as a work request to carry out the operation.

Because of the asynchronous nature of work request fulfillment, it is not always obvious that a configuration step has failed with an error. The failed step is often not revealed until the next step, dependent on the success of the first, is attempted,

You can view NLB work request status indicators to find out if a work request has failed with an error. Using these methods, you can check the progress of each operation, whether or not it resulted in a failed state, which step it failed on, and the reason for the failure.

Using the Compute Web UI

  1. Open the Navigation Menu. Under Networking, click Network Load Balancers.

  2. Click the name of the NLB for which you want to view work request errors.

  3. In the Resources list, click on Work Requests.
  4. From the listing of work requests, for each work request you can view:
    • Type of work request
    • State of the work request (Succeeded, Failed, and so on)
    • Start and finish time stamp
  5. From the View Details page of each work request, you can view:
    • General information about the work request, such as type
    • OCID of the work request
    • Error detail of the work request failed (nothing is displayed for non-failure status)
    • Start and finish time stamp

Using the OCI CLI

  1. Gather the information you need to run the command:

    • Compartment OCID (oci iam compartment list --compartment-id-in-subtree true)

  2. Run the nlb work-request list command, which lists the OCIDs for all work requests for all the NLBs in the compartment.

    Note:

    For information about optional parameters, run the command with the --help option.

    Syntax (entered on a single line):

    oci nlb work-request-errors list --work-request-id workrequest_OCID \
      --compartment-id tenancy _OCID [OPTIONS]

    Where [OPTIONS] are:

    • --all Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.
    • --from-json [text] Provide input to this command as a JSON document from a file using the file://path-to/file syntax.
    • --limit [integer] For list pagination. The maximum number of results per page or items to return, in a paginated “List” call.
    • --page [text] The page token representing the page from which to start retrieving results.
    • --page-size [integer] When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.

    Example: (Attempt to create an NLB with an invalid Subnet ID, see that the work request has failed, and display the error details):

    $ oci nlb network-load-balancer create --display-name Priv_NLB1  \
      --compartment-id ocid1.tenancy....….….….uniqueID --subnet-id ocid1.subnet....….….….uniqueID \
      --is-private true
    
    {
      "data": {
        "backend-sets": {},
        "compartment-id": "ocid1.tenancy.1....….….….uniqueID",
        "defined-tags": {},
        "display-name": "Priv_NLB1",
        "freeform-tags": {},
        "id": "ocid1.networkloadbalancer.....….….….uniqueID",
        "ip-addresses": null,
        "is-preserve-source-destination": false,
        "is-private": true,
        "lifecycle-details": null,
        "lifecycle-state": "CREATING",
        "listeners": {},
        "network-security-group-ids": null,
        "nlb-ip-version": "IPV4",
        "subnet-id": "ocid1.subnet.....….….….uniqueID",
        "system-tags": null,
        "time-created": "2023-10-18T12:58:34.000001+00:00",
        "time-updated": null
        },
      "opc-work-request-id": "ocid1.workrequest.....….….….uniqueID"
    }
    $ oci nlb work-request get --work-request-id ocid1.workrequest.....….….….uniqueID
    
    {
      "data": {
        "compartment-id": "ocid1.tenancy.....….….….uniqueID",
        "id": "ocid1.workrequest.1.....….….….uniqueID",
        "operation-type": "CREATE_NETWORK_LOAD_BALANCER",
        "percent-complete": 100.0,
        "resources": [
        {
          "action-type": "CREATED",
          "entity-type": "NetworkLoadbalancer",
          "entity-uri": null,
          "identifier": "ocid1.networkloadbalancer.1.....….….….uniqueID"
        }
        ],
        "status": "FAILED",
        "time-accepted": "2023-10-18T12:58:34.701224+00:00",
        "time-finished": "2023-10-18T12:58:34.977166+00:00",
        "time-started": "2023-10-18T12:58:34.715807+00:00"
      }
    }
    
    $ oci nlb work-request-error list --compartment-id ocid1.tenancy....….….….uniqueID \
      --work-request-id ocid1.workrequest....….….….uniqueID
    
    {
      "data": {
        "items": [
        {
          "code": "INTERNAL_ERROR",
          "message": "Error occurred. Network response code: 404.Error Message: 
            'No Subnet was found'",
          "timestamp": "2023-10-18T12:58:34.948927+00:00"
        }
        ]
      }
    }