Common Errors

Stay organized with collections Save and categorize content based on your preferences.

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
SummaryToken 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.

AdError

CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR
SummaryThis 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
SummaryOne 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
SummaryOne 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.

AdGroupAdError

AD_GROUP_AD_LABEL_ALREADY_EXISTS
SummaryThis 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
SummaryAn 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.

AdGroupCriterionError

INVALID_KEYWORD_TEXT
SummaryThe 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.

AdGroupError

DUPLICATE_ADGROUP_NAME
SummaryAn 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

AssetError

DUPLICATE_ASSET
SummaryTwo 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

AuthenticationError

CLIENT_CUSTOMER_ID_INVALID
SummaryClient 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 Quickstart for details.
CLIENT_CUSTOMER_ID_IS_REQUIRED
SummaryClient 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
SummaryNo 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.
SummaryThe 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
SummaryThe 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
SummaryOAuth 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.

AuthorizationError

CUSTOMER_NOT_ENABLED
SummaryThe 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
SummaryThe 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
SummaryThe 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
SummaryThe 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.

BiddingError

BID_TOO_MANY_FRACTIONAL_DIGITS
SummaryThe 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
SummaryThe 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.

CampaignBudgetError

MONEY_AMOUNT_LESS_THAN_CURRENCY_MINIMUM_CPC
SummaryThe 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
SummaryThe 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.

CampaignError

DUPLICATE_CAMPAIGN_NAME
SummaryA 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

CriterionError

KEYWORD_HAS_INVALID_CHARS
SummaryAdding 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.

DistinctError

DUPLICATE_ELEMENT
SummaryThe 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.

InternalError

DEADLINE_EXCEEDED
SummaryThe 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
SummarySomething 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
SummaryA 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)
SummaryThe 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.

MutateError

RESOURCE_NOT_FOUND
SummaryThe 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.

NotEmptyError

EMPTY_LIST
SummaryA 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

QuotaError

RESOURCE_EXHAUSTED
SummaryA 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.

RangeError

TOO_LOW
SummaryA 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.

RequestError

INVALID_INPUT
SummaryThe 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
SummaryThe 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.

ResourceCountLimitExceededError

RESOURCE_LIMIT
SummaryThe 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.

StringLengthError

TOO_LONG
SummaryThe 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.