﻿---
title: Troubleshoot machine learning with CPS
description: Use this section to diagnose and resolve common problems with anomaly detection datafeeds that search across linked projects on Elastic Cloud Serverless...
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning
products:
  - Elastic Cloud Serverless
  - Elasticsearch
  - Machine Learning
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Unavailable
---

# Troubleshoot machine learning with CPS
Use this section to diagnose and resolve common problems with anomaly detection datafeeds that search across linked projects on Elastic Cloud Serverless. These topics apply when CPS-enabled ML datafeeds are available for your project.
<tip>
  If you can't find your issue here, explore the other [troubleshooting topics](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot) or [contact us](/elastic/docs-content/pull/7403/troubleshoot#contact-us).
</tip>


## Where to find diagnostics

Gather context from the following sources before narrowing down a CPS datafeed issue:
- **ML job Messages in Kibana** — Open **Machine Learning → Anomaly Detection**, select the job, and review the **Messages** tab for audit entries and warnings about linked projects, credentials, or scope changes.
- **`.ml-notifications-*` and `.ml-annotations-*` indices** — Search these indices for the job or datafeed ID to find historical audit messages and scope-change annotations.
- **`GET _ml/datafeeds/{id}/_stats`** — Inspect `remote_cluster_stats` for per-project availability, skip counts, and cross-project search health over recent extraction cycles.
- **`GET _ml/datafeeds/{id}`** — Confirm the effective `project_routing` expression and whether the datafeed uses qualified index references.


## Common issues

- [Linked project skipped or unavailable](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-linked-project-skipped)
- [Search scope changed](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-search-scope-changed)
- [`project_routing` matches no project](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-routing-no-match)
- [Stale project reference](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-stale-project-reference)
- [Cloud token mint failure](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-cloud-token-mint-failure)
- [Cloud token runtime failure](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-cloud-token-runtime-failure)
- [Field mapping mismatch across projects](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-field-mapping-mismatch)
- [Schema drift in a linked project](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-schema-drift)
- [Search scope too broad](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-scope-too-broad)
- [Bulk migration partial failure](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-bulk-migration-partial)
- [Clone inherits unintended `project_routing`](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/troubleshoot/elasticsearch/machine-learning/cps-datafeed-clone-project-routing)


## `project_routing` quick reference


| `project_routing` value                   | Effective search scope                                                     |
|-------------------------------------------|----------------------------------------------------------------------------|
| Empty or omitted (`null`)                 | **Flat world** — searches the origin project and all linked projects       |
| `_origin` or `_alias:_origin`             | **Local only** — searches the origin project                               |
| `_alias:prod-*` (or other tag expression) | **Subset** — searches only linked projects whose tags match the expression |
| Qualified index (`project:index`)         | **Specific project** — searches the named project and index                |

For syntax details and examples, refer to [Project routing in CPS](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/explore-analyze/cross-project-search/cross-project-search-project-routing).

## Related pages

- [Cross-project search](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/explore-analyze/cross-project-search) — Overview of cross-project search concepts and prerequisites.
- [Project routing in CPS](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/explore-analyze/cross-project-search/cross-project-search-project-routing) — How to limit CPS queries to specific linked projects.
- [Run a job](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/7403/explore-analyze/machine-learning/anomaly-detection/ml-ad-run-jobs) — Create, start, and manage anomaly detection jobs and datafeeds.


## When to contact support

Contact [Elastic support](/elastic/docs-content/pull/7403/troubleshoot#contact-us) when:
- A linked project or region appears unavailable across multiple jobs and you have confirmed project linking in Elastic Cloud.
- The same datafeed fails repeatedly after you apply the fixes in these topics.
- The origin project reports memory pressure or out-of-memory errors while CPS datafeeds are running, and narrowing `project_routing` does not relieve the symptoms.