ODC connector Unexpected error occurred in scheduled task
search cancel

ODC connector Unexpected error occurred in scheduled task

book

Article ID: 445363

calendar_today

Updated On:

Products

DX SaaS

Issue/Introduction

The ODC Connector fails to start or fails during a scheduled task with the following error in the logs:

```text
ERROR [support.TaskUtils$LoggingErrorHandler] (CollectorJob|...) - Unexpected error occurred in scheduled task.
java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 55
    at java.base/java.lang.String.substring(String.java:2823)
    at com.ca.ce.odc.scheduler.jobs.CommandLineBuilder.updateCommandsTobeRun(CommandLineBuilder.java:111)
    at com.ca.ce.odc.scheduler.jobs.CommandLineBuilder.builder(CommandLineBuilder.java:64)
    at com.ca.ce.odc.scheduler.jobs.CollectorJob.run(CollectorJob.java:94)
```

Environment

*   **Product:** Open Data Connector (ODC)
*   **Version:** 26.6.1 (or similar)
*   **Environment:** Linux/Unix

Cause

The root cause is an incorrectly formatted `agentRootDirectory` path in the `odc.yaml` configuration file. This exception occurs when the connector attempt to parse the path and encounters:
1.  **Windows-style backslashes** (`\\`) on a Linux environment.
2.  **Relative paths** (e.g., starting with `./`) that the scheduler cannot resolve to a valid absolute location during task execution.

Resolution

To resolve the issue, update the `odc.yaml` file to use an absolute path with forward slashes for the `agentRootDirectory` parameter.

1.  Locate your `odc.yaml` configuration file.
2.  Find the `agentRootDirectory` entry.
3.  Modify the path from a relative/Windows format to a Linux absolute path.

    **Example Change:**
    *   **From:** `agentRootDirectory: ".\\agents\\odc-agent-appneta_26.6.1\\v4-intelligent-alarms"`
    *   **To:** `agentRootDirectory: "/opt/odc-collector-26.6.1/agents/odc-agent-appneta_26.6.1/v4-intelligent-alarms"` (Adjust the path according to your actual installation directory).

4.  Save the file.
5.  Restart the ODC Connector service.