Why does the Google Cloud Vision OCR activity display the error, "Invalid first character of token: < GoogleCloudErrorRunningEngine"?
Issue Description
The following error is encountered during the execution of the Google Cloud Vision OCR activity:
"Error performing OCR: Invalid first character of token: < GoogleCloudErrorRunningEngine."
The complete exception message reads:
"System.Exception: Error performing OCR: Invalid first character of token: < GoogleCloudErrorRunningEngine."
Example
The error message, "Error performing OCR: Invalid first character of token: < GoogleCloudErrorRunningEngine", signals a problem with the data being sent to the Google Cloud Vision OCR engine. The specific issue, Invalid first character of token: <, indicates that the input data does not adhere to the valid format expected by the OCR engine. This issue originates from data sent on the client side, rather than being an issue with the Google Cloud service itself.
Likely Causes
-
Network or Proxy Issues
Network configurations or proxy settings could be causing the system to return an < character, which represents the beginning of an HTML tag. Instead of receiving the expected OCR response, the system may be parsing an HTML error page as OCR output, leading to this error. -
Malformed JSON or API Request
Formatting issues in the data sent within the API request constitute the most common cause of this error. The input is expected to follow a specific structure, such as a JSON object. The presence of an unexpected < The symbol suggests that the system is attempting to process an HTML or XML error page, rather than image data or a valid JSON request. -
Improper Authentication
Authentication failure, though less likely to produce this specific error, can result in an HTML error page being returned instead of the desired OCR response. This page may trigger the parsing issue. -
Web Application Firewall (WAF)
A Web Application Firewall may be interfering with traffic sent to the application, potentially modifying or blocking requests and responses. Configuration settings in certain WAFs may result in issues similar to the error described.
Troubleshooting Steps
-
Review Network Configuration
Check proxy or firewall settings that may be interfering with data transmission. Temporarily bypass the proxy to rule it out as a potential cause. - Fiddler: Inspect API Responses Using Fiddler Classic
- Install Fiddler Classic and reproduce the issue while generating a Fiddler trace.
- Navigate to the "Inspectors" tab and examine the "Response" section. Use the "Raw" or "Headers" sub-tabs to check whether the response contains HTML error page tags such as <html>, <head>, or <body>. Identifying these tags confirms that the root cause lies within an HTML error response.
- Review the error message within the HTML page, which could provide additional information (e.g., "Invalid API key" or "Forbidden").
-
Validate the API Request Body
Open the "Request" section within Fiddler and examine the "Headers" and "Raw" tabs. Confirm that the request contains properly formed data in JSON format. Check that the API key is correctly included in the request headers or body.
If further assistance is required, open a case with UiPath Product Support. Include the following details:
- Date and time when the error occurred
- A ZIP file generated by the UiPath Diagnostic Tool
- A Fiddler trace that captures the request/response cycle



