Common Errors
This page lists common errors and provides tips on preventing and handling them.
For a complete list of errors, review the error
references. For further support, visit our
forum.
google.auth.exceptions.RefreshError
|
invalid_grant |
Summary | Token has been expired or revoked. |
Common causes |
A Google Cloud Platform project with an OAuth consent screen configured for an external user type and a publishing status of Testing is issued a refresh token expiring in 7 days.
|
How to handle |
Your Google project's publishing status is Testing so the refresh token expires every 7 days and receives an invalid_grant error. Go to the Google API Console and navigate to the OAuth consent screen. Then change the publishing status to In production following these instructions to avoid the refresh token expiring in 7 days.
|
Prevention tips |
See Unverified apps.
|
|
|
CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR |
Summary | This operator cannot be used with a subclass of Ad. |
Common causes |
Trying to modify attributes other than the status of the ad.
|
How to handle |
N/A
|
Prevention tips |
Once an ad is created, it cannot be modified. If you would like to modify the ad, you must make a new ad and then remove the old one. The status of the ad is, however, modifiable using MutateAdGroupAds.
|
|
INVALID_INPUT |
Summary | One of the fields in an ad contains invalid characters. |
Common causes |
Using special characters in URLs.
|
How to handle |
N/A
|
Prevention tips |
Validate URLs in your app before making the API request.
|
|
LINE_TOO_WIDE |
Summary | One of the fields in an ad was longer than the maximum allowed length. See About text ads. |
Common causes |
Having too long of a line of text.
|
How to handle |
N/A
|
Prevention tips |
Validate the length of the line before making the API request.
|
|
|
AD_GROUP_AD_LABEL_ALREADY_EXISTS |
Summary | This label is already associated with some of the ads. |
Common causes |
Trying to associate the label with ads that have already been associated.
|
How to handle |
N/A
|
Prevention tips |
Check first if the label to be added is already associated with the ads.
|
|
CANNOT_OPERATE_ON_REMOVED_ADGROUPAD |
Summary | An operation attempted to update a removed ad. |
Common causes |
Once an ad is removed, it can no longer be updated—including changes to its status.
|
How to handle |
N/A
|
Prevention tips |
Ensure that your code does not attempt to update removed ads.
|
|
|
INVALID_KEYWORD_TEXT |
Summary | The keyword text contains invalid characters. See Add keywords. |
Common causes |
The keyword text contains invalid characters.
|
How to handle |
N/A
|
Prevention tips |
Validate the keyword text in your app before making a request to the API.
|
|
|
DUPLICATE_ADGROUP_NAME |
Summary | An ad group is being added or renamed, but the name is already being used by another ad group. |
Common causes |
Creating a new ad group with the name of an existing active or paused ad group.
|
How to handle |
Log the error and present an error message to the user, optionally suggesting a unique ad group name or showing the list of names in use.
|
Prevention tips |
N/A
|
|
|
DUPLICATE_ASSET |
Summary | Two operations in a single request contain a create operation for an asset with the same binary data. |
Common causes |
A mutate request with duplicated create operations containing the same binary data.
|
How to handle |
Create the asset in a separate request, then link to it in the subsequent request; or, use a temporary ID within the same request.
|
Prevention tips |
N/A
|
|
|
CLIENT_CUSTOMER_ID_INVALID |
Summary | Client customer ID is not a number. |
Common causes |
Using an improper client customer ID.
|
How to handle |
N/A
|
Prevention tips |
123-456-7890 should be 1234567890. See Get started for details.
|
|
CLIENT_CUSTOMER_ID_IS_REQUIRED |
Summary | Client customer ID was not specified in the HTTP header. |
Common causes |
Not specifying a client customer ID in the HTTP header.
|
How to handle |
N/A
|
Prevention tips |
Client customer ID is required for all calls, so make sure you've specified one in the HTTP header. Consider using our client libraries as they handle this for you.
|
|
CUSTOMER_NOT_FOUND |
Summary | No account found for the customer ID provided in the header. |
Common causes |
Trying to access an account that was just created before the account is established in the backend.
|
How to handle |
Wait an initial five minutes, then retry every 30 seconds.
|
Prevention tips |
Wait a few minutes after the account is created before issuing requests against it.
|
|
GOOGLE_ACCOUNT_COOKIE_INVALID |
Summary | The access token in the request header is either invalid or has expired. |
Common causes |
The access token has been invalidated.
|
How to handle |
Request a new token. If you're using one of our client libraries, consult its documentation on how to refresh the token.
|
Prevention tips |
Store and reuse access tokens until they expire.
|
|
NOT_ADS_USER |
Summary | The Google account used to generate the access token is not associated with any Google Ads account. |
Common causes |
The login information provided corresponds to a Google account that does not have Google Ads enabled.
|
How to handle |
Make sure to sign in with a valid Google Ads account (typically your manager account) for the OAuth flow. You can also invite the Google account to access an existing Google Ads account by signing in to your manager account, selecting the customer or manager account in question, navigating to Tools and Settings > Access and security , then adding the Google account email address.
|
Prevention tips |
N/A
|
|
OAUTH_TOKEN_INVALID |
Summary | OAuth access token in the header is not valid. |
Common causes |
Your access token passed with the HTTP header was not correct.
|
How to handle |
N/A
|
Prevention tips |
Make sure you've passed the correct access token associated with your account. It's sometimes confused with refresh tokens and authorization codes. If you would like to get a credential that can access all client accounts under a manager account, make sure you get the refresh token for the manager account. For more details, see our guide on access token and refresh token and OAuth2.
|
|
|
CUSTOMER_NOT_ENABLED |
Summary | The customer account cannot be accessed because it is not in an enabled state. |
Common causes |
This occurs when the customer account hadn't finished signup or had been deactivated.
|
How to handle |
Sign in to the Google Ads UI and ensure that you've completed the signup process for this account. For deactivated accounts, see Reactivate a cancelled Google Ads account.
|
Prevention tips |
You can proactively check if a customer account is deactivated by checking for a status of CANCELLED.
|
|
DEVELOPER_TOKEN_NOT_APPROVED |
Summary | The developer token is only approved for use with test accounts and attempted to access a non-test account. |
Common causes |
A test developer token was used to access a non-test account.
|
How to handle |
Ensure that you do in fact want to access a non-test account. If so, then you need to apply to have your developer token upgraded to Standard or Basic access.
|
Prevention tips |
N/A
|
|
DEVELOPER_TOKEN_PROHIBITED |
Summary | The developer token is not allowed with the project sent in the request. |
Common causes |
Each Google API Console project can be associated with the developer token from only one manager account. Once you make a Google Ads API request, the developer token is permanently paired to the Google API Console project. If you don't use a new Google API Console project, you'll get a DEVELOPER_TOKEN_PROHIBITED error when making a request.
|
How to handle |
N/A
|
Prevention tips |
If switching to a developer token under a new manager account, you'll need to create a new Google API Console project for Google Ads API requests that use the new manager's token.
|
|
USER_PERMISSION_DENIED |
Summary | The authorized customer does not have access to the operating customer. |
Common causes |
Authenticating as a user with access to a manager account but not specifying login-customer-id in the request.
|
How to handle |
N/A
|
Prevention tips |
Specify the login-customer-id as the manager account ID without hyphens (- ). Client libraries have built in support for this.
|
|
|
BID_TOO_MANY_FRACTIONAL_DIGITS |
Summary | The bid value is not an exact multiple of the minimum unit of the account's currency. For example, US$ 0.015 (15000 in micros) is not a valid bid. |
Common causes |
N/A
|
How to handle |
N/A
|
Prevention tips |
Verify that bids are multiples of the minimum unit for the account's currency.
|
|
BID_TOO_BIG |
Summary | The error is returned even though the bid is within the campaign budget. |
Common causes |
N/A
|
How to handle |
N/A
|
Prevention tips |
Check if the account is participating in Google Ad Grants. If so, restrict CPC bids to the maximum prescribed by the program.
|
|
|
MONEY_AMOUNT_LESS_THAN_CURRENCY_MINIMUM_CPC |
Summary | The budget amount is too small. |
Common causes |
N/A
|
How to handle |
N/A
|
Prevention tips |
Verify that budget amount is greater than or equal to the minimum unit for the account's currency.
|
|
NON_MULTIPLE_OF_MINIMUM_CURRENCY_UNIT |
Summary | The budget amount will have too many significant decimal places when converted from a micro amount to an amount in the account's currency. |
Common causes |
N/A
|
How to handle |
N/A
|
Prevention tips |
Verify that budget amount is divisible by the minimum unit for the account's currency.
|
|
|
DUPLICATE_CAMPAIGN_NAME |
Summary | A campaign is being added or renamed, but the name is already being used by another campaign. |
Common causes |
Creating a new campaign with the name of an existing active or paused campaign.
|
How to handle |
Log the error and present an error message to the user, optionally suggesting a unique campaign name or showing the list of names in use.
|
Prevention tips |
N/A
|
|
|
KEYWORD_HAS_INVALID_CHARS |
Summary | Adding or editing keywords that contain invalid characters. |
Common causes |
Use special characters like ! @ % * in the keywords.
|
How to handle |
N/A
|
Prevention tips |
Make sure you don’t use any unallowed characters in the keywords. See Add keywords.
|
|
|
DUPLICATE_ELEMENT |
Summary | The request contains two parameters that are identical and redundant. |
Common causes |
N/A
|
How to handle |
N/A
|
Prevention tips |
Remove duplicates (operations, parameters, list elements) before making the request. Look for fields that have the DistinctElements constraint.
|
|
|
DEADLINE_EXCEEDED |
Summary | The request timed out and could not be completed quickly enough to return a response. |
Common causes |
A search request was made that generated too large of a response, or a mutate request was too large to process.
|
How to handle |
Wait for about 30 seconds, then retry the request. If the error persists try breaking the request into multiple, smaller requests that can be completed more quickly.
|
Prevention tips |
Review Segmentation to understand how it can affect the size of a response. Be aware of the gRPC transport layer limitations.
|
|
INTERNAL_ERROR |
Summary | Something unexpected happened while processing the request. |
Common causes |
The API isn't functioning correctly due to a bug.
|
How to handle |
Retry any requests that failed with this error, using an exponential backoff schedule for the retries.
|
Prevention tips |
N/A
|
|
TRANSIENT_ERROR |
Summary | A transient internal error has occurred, and a retry should be performed. |
Common causes |
This error occurs when the API internally encounters a temporary issue.
|
How to handle |
Retry any requests that failed with this error, using an exponential backoff schedule for the retries.
|
Prevention tips |
N/A
|
|
InvalidGrantError
|
invalid_grant (malformed auth code) |
Summary | The authorization code exchanged for OAuth tokens was malformed. |
Common causes |
This happens when attempting to generate a refresh token for a user that has already been granted access to the requesting application. For instance, this can happen when running the Generate User credentials example more than once for the same OAuth client credentials and authorizing user.
|
How to handle |
In order to regenerate a refresh token for a given combination of authorizing user and OAuth client credentials, revoke an existing refresh token. Note that revoking a token renders it unusable for Google Ads API access and invalidates any access tokens that the refresh token was used to generate.
|
Prevention tips |
Make sure to store your refresh token in a secure location to avoid the need for regeneration.
|
|
|
RESOURCE_NOT_FOUND |
Summary | The request referred to a resource that could not be found. |
Common causes |
The request attempted to mutate or otherwise reference a resource that does not exist or has been removed. Or, the given resource name for the resource is malformed.
|
How to handle |
Use a search request to retrieve the resource name for an existing resource before submitting a mutate request. Review our client library guides, which include documentation on how to construct valid resource names in every supported language
|
Prevention tips |
Don't create resource names manually. Use one of the helper methods offered by our client libraries.
|
|
|
EMPTY_LIST |
Summary | A required list is empty. |
Common causes |
Passing in an empty list of operations to a mutate method.
|
How to handle |
N/A
|
Prevention tips |
N/A
|
|
|
RESOURCE_EXHAUSTED |
Summary | A system frequency limit has been exceeded. |
Common causes |
N/A
|
How to handle |
N/A
|
Prevention tips |
Set up short delays between requests or combine more operations in fewer requests.
|
|
|
TOO_LOW |
Summary | A value was lower than the minimum allowed. |
Common causes |
Forgetting to specify an ID, which results in a value of 0 being passed in.
|
How to handle |
N/A
|
Prevention tips |
Note any range limitations documented in the API reference.
|
|
|
INVALID_INPUT |
Summary | The request is malformed. |
Common causes |
The URL or content of the request is malformed.
|
How to handle |
N/A
|
Prevention tips |
N/A
|
|
REQUIRED_FIELD_MISSING |
Summary | The request is missing required information. |
Common causes |
Missing required fields when attempting to add an entity.
|
How to handle |
Log the error and present an error message to the user. The fieldPath attribute of the error indicates which field is missing.
|
Prevention tips |
Refer to the API reference to find out which fields are required.
|
|
|
RESOURCE_LIMIT |
Summary | The request is attempting to create a resource that would cause the total number of those resources to exceed a specified limit. |
Common causes |
There are multiple limits on the number of resources that can exist in certain contexts.
|
How to handle |
Identify the limit that's being encountered by reviewing System limits. Either reuse an existing resource, or remove resources to create space for new ones.
|
Prevention tips |
Use search queries to monitor the number of resources that have limitations.
|
|
|
TOO_LONG |
Summary | The string assigned to the specified field is longer than the limit. |
Common causes |
Headlines or descriptions for ads contain too much text.
|
How to handle |
Identify the limit that's being encountered , modify the string accordingly, and resend the request.
|
Prevention tips |
Be aware of string length limits.
|
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-18 UTC.
[null,null,["Last updated 2024-12-18 UTC."],[[["The Google Ads API returns a variety of errors related to authentication, ads, assets, bidding, and budgets, providing specific error codes for troubleshooting."],["Common causes of errors include invalid inputs, exceeding limits, and resource conflicts, necessitating careful validation of data and adherence to API guidelines."],["Suggested solutions involve correcting inputs, adjusting values to meet requirements, ensuring unique names, and retrying with exponential backoff for transient errors."],["Understanding the error codes and their corresponding descriptions enables developers to effectively diagnose and resolve issues encountered during API interactions."],["Developers should consult the Google Ads API documentation for detailed explanations of each error and recommended best practices to avoid them."]]],[]]