Data Extraction Scope Throws Exception At ML Extractor

Resolution when ML Extractor activity throws exception.

Issue Description: When executing a data extraction scope, the ML extractor throws an exception.

Root Cause: There can be a variety of reason why this can occur. Typically it means one of the following:

  • A connection to the endpoint could not be established
  • The connection to our cloud could not be established by AI Center (on-prem connected only)
  • An invalid API key was used.

Diagnosing

  1. Capture the stack trace and look at it closely. It often contains a hint at the error.
  2. Check to see if the stack trace contains the following:
    • Data Extraction Scope: Invalid response: content=Invalid api_key requested code=BadRequest
  3. If the above error is encountered, go to the section Resolving Invalid API Key
  4. If the error was, "An error occurred while sending the request." this most likely means the AI Center certificate was not trusted. Go to the section Resolving Connection Issues
  5. If the error message is: "Invalid response: content=License 'validation' error: a connection error occurred code=Unauthorized " or anything else, see the section Checking AI Centers Connection Metering
  6. If none of the above steps help reveal the issue, please open a ticket with UiPath.
    • Most likely either a fiddler trace or wireshark trace will need to be captured.

Resolving Invalid API Key

  1. This issue happens when using On Prem AI Center connected or when using a cloud endpoint.
  2. Make sure that in the Extractor activity, an API key is being used. If no API Key is being used see the next step.
  3. For On Prem Connected AI Center (non-airgapped), verify that the license key was obtained from the associated cloud account and that it is still valid
    • Read more on the API Key
    • Go to https://cloud.uipath.com
    • Admin -> Licenses -> Robots & Services
    • From this page see the Document Understanding API Key
  4. If using airgapped, API key is not needed. Sometimes users think they are using airgapped when they are using on-prem connected. To check if using Air-gapped do the following
    • Go to https://:8800
    • Under License, check to see if the isAirGapped flag is set to true.
    • If it is not set to true, then the installation is not airgapped and a license key is needed.
    • If needed open a license or support ticket. UiPath recommends on-prem connected. Sometimes users request their license to be on-prem, not realizing for on-prem connected the license will be in the cloud.
    • For Air Gapped, no license key should be used.
  5. If the correct license key is being used and the configuration looks correct, go back to the diagnosing section.

Resolving Connection Issues

  1. If a connection issue is occurring, the best thing to do is to first go to the AI Center URL: https://:31390/ai-app
  2. If there are any connection issues when going to this site, it can be assumed the same issues will affect the Robot.
  3. If the certificate is not trusted, read more on the Configure AI Center - Trust The Application Certificate
    • If a self-signed certificate is being used, we recommend fixing that. Self-signed certificates are bad practice. Contact your infrastructure team and request a proper domain certificate.
    • The AI Center certificate can be changed as mentioned in the Updating AI Center Certificate
  4. If there do not seem to be any connection issues, or it is not clear what the problem with the connection is, please open a ticket with UiPath.
    • The next step would be to do a wireshark trace.

Checking AI Centers Connection to Metering

  1. Have the admin login to the server for AI Center.
  2. Have them run the command: curl -v https://du-metering.uipath.com
    • This command should return error free, but if it does not, it probably means that our services are facing the same error.
  3. Run the following commands
    • kubectl get ns
      • This will return a list of different items. One will be a GUID (so a jumble of letters and numbers). Use this for the next command
    • kubectl -n get pods
      • This will return the ML skills that you have. It will also be a jumble of letters. You probably only have one. These represent the pods for the skills and will be needed in the next step
    • kubectl -n logs
      • This will display the logs of the ML skill. If there is a connection issue, it will be revealed here
  4. Some possible errors that might be seen:
    • uipath_core.licenses.license_validator:send_request_to_metering_server:119 - ERROR: License 'validation' failed: a connection error occurred
    • uipath_core.controller:handle_invalid_usage:55 - ERROR: {'info': 'Prediction Failed', 'reason': '{"message": "License \'validation\' error: a connection error occured"}'}
  5. Typically the above errors indicate a firewall issue. Make sure all the correct ports have been opened
If the above does not help to reveal the issue, considering opening a ticket with UiPath.
1 Like