1
---
2
name: data-manager-api-troubleshooting
3
description: >-
4
Diagnoses and fixes errors, warnings, and missing data for Data Manager API
5
event and audience ingestion requests. Use when an IngestEvents,
6
IngestAudienceMembers, RemoveAudienceMembers, RemoveAllAudienceMembers, or
7
RetrieveRequestStatus call fails (INVALID_ARGUMENT, REQUIRED_FIELD_MISSING,
8
INVALID_HEX_ENCODING, PERMISSION_DENIED, UNAUTHENTICATED,
9
RESOURCE_EXHAUSTED, INVALID_REQUEST_ID), when
10
a response has fieldWarnings, when checking request status or diagnostics,
11
when request status shows FAILED or PARTIAL_SUCCESS or processing errors,
12
when finding which records failed, or when a request returned 200 but
13
conversions or audience members are missing. Don't
14
use for writing new ingestion code (use the data-manager-api-event-ingestion
15
or data-manager-api-audience-ingestion skills) or first-time credential
16
setup (use the data-manager-api-setup skill).
17
metadata:
18
version: "1.0.1"
19
publisher: google
20
category: GoogleAds
21
---
22
23
# Data Manager API Troubleshooting
24
25
The Data Manager API reports problems in three places, at three different times.
26
27
## Step 1: Classify the problem
28
29
Ask for the exact error payload, response, or diagnostics output if the user
30
hasn't shared it.
31
32
| Symptom | When | What it means | Go to |
33
| :--- | :--- | :--- | :--- |
34
| Request throws an exception or returns 4xx/5xx | Immediately | The **entire** request was rejected. No records were ingested. | [Step 2](#step-2-fix-request-errors) |
35
| Request succeeds with `field_warnings` | Immediately | The request was accepted, but the flagged field had an issue (for example, an invalid or missing optional value). Don't resend. Fix the source data for future requests. | None |
36
| Request succeeded, but data is missing or lower than expected | Check `retrieve_request_status` 30 minutes to 24 hours later | Records can still fail during asynchronous processing. Diagnostics show per-destination results, including which records failed. | [Step 3](#step-3-check-request-status-and-diagnostics) |
37
38
## Step 2: Fix request errors
39
40
The API uses a fast-fail model: if any record fails synchronous validation, the
41
whole request fails and no records are processed. Fix the problem and resend the
42
**entire** request. To confirm a fix first, send the ingestion request with
43
`validate_only` set to `true`.
44
45
### Read the full error
46
47
For `INVALID_ARGUMENT`, the top-level `message` is always generic ("There was a
48
problem with the request."). Read **every** entry in the `google.rpc.BadRequest`
49
detail's `field_violations`, including `field` (a path with list indexes, such
50
as `events.events[1].user_data.user_identifiers[2]`), `reason` (an
51
`ErrorReason`), and `description`. For any error, also log `request_id` from
52
`google.rpc.RequestInfo` and include it in support requests.
53
54
In Python (`google.api_core.exceptions.GoogleAPICallError`), read `err.details`:
55
56
```python
57
from google.api_core import exceptions
58
from google.rpc import error_details_pb2
59
60
try:
61
...
62
except exceptions.GoogleAPICallError as err:
63
for detail in err.details:
64
if isinstance(detail, error_details_pb2.BadRequest):
65
for v in detail.field_violations:
66
print(v.field, v.reason, v.description)
67
elif isinstance(detail, error_details_pb2.RequestInfo):
68
print("request_id:", detail.request_id)
69
```
70
71
### Fix by error code
72
73
| Error code | What to do |
74
| :--- | :--- |
75
| `INVALID_ARGUMENT` (400) | Follow [Fix INVALID_ARGUMENT errors](references/request-errors.md#fix-invalid_argument-errors). |
76
| `UNAUTHENTICATED` (401), `PERMISSION_DENIED` (403) | Read `ErrorInfo.reason`, then follow [Permission errors](references/request-errors.md#permission-errors). |
77
| `RESOURCE_EXHAUSTED` (429) | Check `ErrorInfo.metadata.quota_limit`. For a per-minute limit, resend with exponential backoff and jitter. For a daily limit, don't resend until the quota resets at midnight Pacific Time. In both cases, reduce the request count by batching more records per request (up to 2,000 events or 10,000 audience members) and sending at most 10 requests concurrently. |
78
| `RetrieveRequestStatus` fails with `INVALID_REQUEST_ID` or `REQUEST_TOO_OLD` | Status exists only for recent requests that succeeded and didn't set `validate_only`. For `INVALID_REQUEST_ID`, check that the ID is the `request_id` from a successful, non-validation ingestion response (if the original request failed, fix it using its own error). For `REQUEST_TOO_OLD`, diagnostics are no longer available. |
79
80
For other error codes, check whether the error can be retried before resending.
81
See
82
[Best practices for error handling](https://developers.google.com/data-manager/api/devguides/concepts/understand-errors.md.txt#best-practices-for-error-handling).
83
84
## Step 3: Check request status and diagnostics
85
86
Each destination in the response has an overall `request_status`, error and
87
warning counts, and a request-type status with record and identifier counts.
88
Some audience data also has a match rate. Field names differ by request type
89
and data type. Use the fields in
90
[Request status and diagnostics](references/request-status.md).
91
92
### Requirements and timing
93
94
* Diagnostics exist only for requests that succeeded and didn't set
95
`validate_only`.
96
* Wait at least 30 minutes after ingestion, then poll with exponential backoff
97
until every destination reaches `SUCCESS`, `PARTIAL_SUCCESS`, or `FAILED`.
98
Processing can take up to 24 hours. When writing code that reads request
99
status, handle destinations still in `PROCESSING` by polling again later
100
instead of reporting their results.
101
102
### Map records to their errors and warnings
103
104
`record_indices` are 0-based positions in the original request's `events` or
105
`audience_members` list. When a user asks which records failed or wants to fix
106
them, invert `error_info.error_counts` and `warning_info.warning_counts` for
107
each destination into a per-record list of errors and warnings. Resend only the
108
corrected records that had errors, and only to the destinations where they
109
failed. For warning-only records, fix the issue for future uploads.
110
111
To find what a processing reason means and how to fix it, see
112
[Processing reasons](references/request-status.md#processing-reasons).
113
114
## References
115
116
* [Request errors](references/request-errors.md)
117
* [Request status and diagnostics](references/request-status.md)
118
* [Understand API errors](https://developers.google.com/data-manager/api/devguides/concepts/understand-errors.md.txt)
119
* [Diagnostics](https://developers.google.com/data-manager/api/devguides/diagnostics.md.txt)
120
* [Configure destinations and headers](https://developers.google.com/data-manager/api/devguides/concepts/destinations.md.txt)
121
* [Best practices](https://developers.google.com/data-manager/api/devguides/concepts/best-practices.md.txt)
122
* [Limits and quotas](https://developers.google.com/data-manager/api/devguides/limits.md.txt)
123