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 causesA 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 handleYour 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 tipsFollow these instructions.

AdError

CANNOT_USE_AD_SUBCLASS_FOR_OPERATOR

SummaryThis operator cannot be used with a subclass of Ad.
Common causesYou've tried to modify attributes other than status of the ad.
How to handleN/A
Prevention tipsOnce 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 causesUsing special characters in URLs
How to handleN/A
Prevention tipsValidate URLs in your application before making a request to the API.

LINE_TOO_WIDE

SummaryOne of the lines in an ad was longer than the maximum allowed length. The length limits are documented in the Google Ads Help Center.
Common causesIncorrectly specifying empty default text in an ad parameter tag. Use {param1}, not {param1:}.
How to handleN/A
Prevention tipsValidate the length of the line before making the request.

AdGroupAdError

AD_GROUP_AD_LABEL_ALREADY_EXISTS

SummaryThis label is already associated with some of these ads.
Common causesYou’ve tried to associate the label with ads that already have them associated.
How to handleN/A
Prevention tipsCheck 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 causesOnce an ad is removed, it can no longer be updated (including changes to its status).
How to handleN/A
Prevention tipsEnsure that your code does not attempt to update removed ads.

AdGroupCriterionError

INVALID_KEYWORD_TEXT

SummaryThe keyword text contains invalid characters. A list of valid characters is available on the Google Ads Help Center.
Common causesThe keyword text contains invalid characters.
How to handleN/A
Prevention tipsValidate the keyword text in your application 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 causesCreating a new ad group with the name of an existing active or paused ad group.
How to handleLog the error and/or present an error message to the user, optionally suggesting a unique ad group name or showing the list of names in use.
Prevention tipsN/A

AssetError

DUPLICATE_ASSET

SummaryTwo operations in a single request contain a create operation for an asset with the same binary data.
Common causesA mutate request contains duplicated create operations containing the same binary data.
How to handleCreate the asset in a separate request then link to it in the subsequent request, or use a temporary ID within the same request.
Prevention tipsN/A

AuthenticationError

CLIENT_CUSTOMER_ID_INVALID

SummaryClient customer ID is not a number.
Common causesYou've specified your client customer ID incorrectly.
How to handleN/A
Prevention tips123-456-7890 should be 1234567890. Visit our Quickstart for details.

CLIENT_CUSTOMER_ID_IS_REQUIRED

SummaryClient customer ID was not specified in the HTTP header.
Common causesYou've not specified your client customer ID in the HTTP header.
How to handleN/A
Prevention tipsClient customer ID is required for all cases except for when using CustomerService.GetCustomer. Therefore, make sure you've specified it 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 causesTrying to access an account that was just created before the account is established in the backend.
How to handleWait an initial five minutes, then retry every 30 seconds.
Prevention tipsWait 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 causesThe access token has been invalidated.
How to handleRequest a new token following these guidelines. If you're using one of our client libraries, consult its documentation on how to refresh the token.
Prevention tipsStore 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 causesThe login information provided corresponds to a Google account that does not have Google Ads enabled.
How to handleMake sure to log 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 logging 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 tipsN/A

OAUTH_TOKEN_INVALID

SummaryOAuth access token in the header is not valid.
Common causesYour access token passed with the HTTP header was not correct.
How to handleN/A
Prevention tipsMake 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. Review our guide for details about access token and refresh token. For more details, consult the OAuth2 Authentication guide.

AuthorizationError

CUSTOMER_NOT_ENABLED

SummaryThe customer account cannot be accessed because it is not in an enabled state.
Common causesThis error occurs when the customer account hasn't finished signup or has been deactivated.
How to handleLog into the Google Ads UI and ensure that you've completed the signup process for this account. For deactivated accounts, see this Help Center article.
Prevention tipsYou 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 causesA test developer token was used to access a non-test account.
How to handleEnsure 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 tipsN/A

DEVELOPER_TOKEN_PROHIBITED

SummaryThe developer token is not allowed with the project sent in the request.
Common causesEach 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 do not use a new Google API Console project, you'll get a DEVELOPER_TOKEN_PROHIBITED error when making a request.
How to handleN/A
Prevention tipsIf 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 causesAuthenticating as a user with access to a manager account but not specifying login-customer-id in the request.
How to handleN/A
Prevention tipsSpecify the login-customer-id as the manager account ID without hyphens (-). Client libraries have built in support for this, or see our guide.

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 causesN/A
How to handleN/A
Prevention tipsVerify 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 causesN/A
How to handleN/A
Prevention tipsCheck if the account is participating in Google Grants for Google Ads. 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 causesN/A
How to handleN/A
Prevention tipsVerify 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 causesN/A
How to handleN/A
Prevention tipsVerify 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 causesCreating a new campaign with the name of an existing active or paused campaign.
How to handleLog the error and/or present an error message to the user, optionally suggesting a unique campaign name or showing the list of names in use.
Prevention tipsN/A

CriterionError

KEYWORD_HAS_INVALID_CHARS

SummaryAdding / editing keywords that contain invalid characters.
Common causesUse special characters like ! @ % * in the keywords.
How to handleN/A
Prevention tipsMake sure you don’t use any unallowed characters in the keywords. Consult the Add keywords Help Center article for more information.

DistinctError

DUPLICATE_ELEMENT

SummaryThe request contains two parameters that are identical and redundant.
Common causesN/A
How to handleN/A
Prevention tipsRemove 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 causesA search request was made that generated too large of a response, or a mutate request was too large to process.
How to handleWait 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 tipsReview our guide on report segmentation to understand how it can affect the size of a response. Be aware of the limitations of the gRPC transport layer.

INTERNAL_ERROR

SummarySomething unexpected happened while processing the request.
Common causesThe API isn't functioning correctly due to a bug.
How to handleWait for about 30 seconds, then retry the request. If this error occurs frequently, post the details to the forum for further troubleshooting.
Prevention tipsN/A

InvalidGrantError

invalid_grant (Malformed auth code)

SummaryThe authorization code exchanged for OAuth tokens was malformed.
Common causesThis happens when attempting to generate a refresh token for a user that has already granted access to the requesting application. For example, this can happen when running the Generate User credentials example more than once for the same OAuth client credentials and authorizing user.
How to handleIn order to regenerate a refresh token for a given combination of authorizing user and OAuth client credentials, follow these instructions to revoke an existing refresh token. Note that revoking a token will render it unusable for Google Ads API access, and will invalidate any access tokens that the refresh token was used to generate.
Prevention tipsMake 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 causesThe 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 handleUse 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 tipsDo not create resource names manually. Use one of the helper methods offered by our client libraries.

NotEmptyError

EMPTY_LIST

SummaryA required list is empty.
Common causesPassing in an empty list of operations to a mutate method.
How to handleN/A
Prevention tipsN/A

QuotaError

RESOURCE_EXHAUSTED

SummaryA system frequency limit has been exceeded.
Common causesSending too many requests in a short period of time.
How to handleN/A
Prevention tipsSet up short delays between requests or combine more operations in fewer requests.

RangeError

TOO_LOW

SummaryA value was lower than the minimum allowed.
Common causesForgetting to specify an ID, which results in a value of 0 being passed in.
How to handleN/A
Prevention tipsNote any range limitations documented in the API reference.

RequestError

INVALID_INPUT

SummaryThe request is malformed.
Common causesThe URL is malformed or the contents of the request are malformed.
How to handleN/A
Prevention tipsN/A

RequestError

REQUIRED_FIELD_MISSING

SummaryThe request is missing required information.
Common causesMissing required fields when attempting to add an entity.
How to handleLog the error and/or present an error message to the user. The fieldPath attribute of the error indicates which field is missing.
Prevention tipsRead 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 causesThere are multiple limits on the number of resources that can exist in certain contexts.
How to handleIdentify the limit that's being encountered by reviewing the System Limits guide. Either reuse an existing resource, or remove resources to create space for new ones.
Prevention tipsReview the API's System Limits and 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 causesHeadlines or descriptions for ads contain too much text.
How to handleIdentify the limit that's being encountered by reviewing the System Limits guide, modify the string accordingly and resend the request.
Prevention tipsReview the API's System Limits to be aware of string length limits.