RESOURCE_NOT_FOUND during MutateAdGroupAssets

526 views
Skip to first unread message

Evgeniy Lepikov

unread,
May 31, 2022, 11:52:01 AM5/31/22
to Google Ads API and AdWords API Forum
Hi support!
I want to remove  link between the asset and the ad in Ap_Add  ad_group. Assets may be youtube_videos or html5_media_bundles. Using AdGroupAssetOperation romove method.
Remove operation: A resource name for the removed ad group asset is expected, in this format:
customers/{customer_id}/adGroupAssets/{ad_group_id}~{asset_id}~{field_type}

For getting ad_group_id  and asset_id I'm using query

SELECT
   ad_group.id,
   asset.id,
   asset.type
FROM ad_group_ad_asset_view
  WHERE ad_group.name = 'Ad_group_1'
  AND campaign.name = 'HS_GP_UAC_Value_Buyer14_WW_1_core_22.04.22'
  AND ad_group.status = 'ENABLED'
  AND asset.type ='YOUTUBE_VIDEO'
  AND ad_group_ad_asset_view.enabled  = TRUE


The result (one asset displaing) is

ad_group {
resource_name: "customers/2309565764/adGroups/135495396669"
id: 135495396669
}
asset {
resource_name: "customers/2309565764/assets/23954537753"
type_: YOUTUBE_VIDEO
id: 23954537753
}
ad_group_ad_asset_view {
resource_name: "customers/2309565764/adGroupAdAssetViews/135495396669~594656045916~23954537753~YOUTUBE_VIDEO"
}


Ok, now traing to make remove operation

asset_id = 23954537753  (taken from query results)
ad_group_id = 135495396669 (taken from query results)
_type = 'YOUTUBE_VIDEO'  (taken from query results)
ad_group_asset_service = client.get_service("AdGroupAssetService")
ad_group_asset_operation = client.get_type("AdGroupAssetOperation")

resource_name = ad_group_asset_service.ad_group_asset_path(
    str(customer_id), str(ad_group_id), str(id), _type
)
ad_group_asset_operation.remove = resource_name

ad_group_ad_response = ad_group_asset_service.mutate_ad_group_assets(
    customer_id=customer_id, operations=[ad_group_asset_operation]
)
return ad_group_ad_response.resource_name


But this return errror message 

Request made: ClientCustomerId: 2309565764, Host: googleads.googleapis.com, Method: /google.ads.googleads.v10.services.AdGroupAssetService/MutateAdGroupAssets, RequestId: O2UzgHHqJylZiNtTL5YGhA, IsFault: True, FaultMessage: Resource was not found.

Full output

google.ads.googleads.errors.GoogleAdsException: (<_InactiveRpcError of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Request contains an invalid argument."
debug_error_string = "{"created":"@1654010485.654125500","description":"Error received from peer ipv4:172.217.16.138:443","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Request contains an invalid argument.","grpc_status":3}"
>, <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Request contains an invalid argument."
debug_error_string = "{"created":"@1654010485.654125500","description":"Error received from peer ipv4:172.217.16.138:443","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Request contains an invalid argument.","grpc_status":3}"
>, errors {
error_code {
mutate_error: RESOURCE_NOT_FOUND
}
message: "Resource was not found."
trigger {
string_value: "135495396669, 23954537753, YOU_TUBE_VIDEO"
}
location {
field_path_elements {
field_name: "operations"
index: 0
}
}
}
request_id: "O2UzgHHqJylZiNtTL5YGhA"
, 'O2UzgHHqJylZiNtTL5YGhA')


What I'm duing wrong?

p.s. Interesting moment - response message show type as 
YOU_TUBE_VIDEO not YOUTUBE_VIDEO

Google Ads API Forum Advisor

unread,
May 31, 2022, 12:21:54 PM5/31/22
to lepil...@gmail.com, adwor...@googlegroups.com
Hi Evgeniy,

Thank you for reaching out to the Google Ads API support team.

To investigate the issue further, could you please provide the complete request and response logs, with the request-id? If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.You can provide it via Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead. Let me know if you have any questions.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bFMt5:ref

Evgeniy Lepikov

unread,
May 31, 2022, 4:19:43 PM5/31/22
to Google Ads API and AdWords API Forum
Thanks Nirmita
above, I have attached the server response with the request_id: "O2UzgHHqJylZiNtTL5YGhA". Isn't that enough?

вторник, 31 мая 2022 г. в 18:21:54 UTC+2, adsapi:

Google Ads API Forum Advisor

unread,
Jun 1, 2022, 4:59:02 AM6/1/22
to lepil...@gmail.com, adwor...@googlegroups.com
Hi Evgeniy,

Thank you for getting back to us.

Moving forward, I am afraid that request-id isn't enough. That said, please provide the complete request and response logs.

This can be requested or provided to the developer handling the Google Ads API transactions when logging of the API requests has been enabled. If it hasn't been enabled yet, then I can advise you to refer to the specific guide below:
Regards,
Google Logo
Carmela
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bFMt5:ref

Google Ads API Forum Advisor

unread,
Jun 1, 2022, 5:00:30 AM6/1/22
to lepil...@gmail.com, adwor...@googlegroups.com
Hi Evgeniy,

In addition to my email, you may provide the requested details via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Evgeniy Lepikov

unread,
Jun 1, 2022, 6:19:22 AM6/1/22
to Google Ads API and AdWords API Forum
log response

-------
Method: /google.ads.googleads.v10.services.AdGroupAssetService/MutateAdGroupAssets
Host: googleads.googleapis.com
Headers: {
"developer-token": "REDACTED",
"login-customer-id": "8711936425",
"x-goog-api-client": "gl-python/3.7.5 grpc/1.46.0 gax/2.7.3 gccl/16.0.0",
"x-goog-request-params": "customer_id=2309565764"
}
Request: customer_id: "2309565764"
operations {
remove: "customers/2309565764/adGroupAssets/135495396669~23954537753~YOUTUBE_VIDEO"
}


Response
-------
Headers: {
"google.ads.googleads.v10.errors.googleadsfailure-bin": "\n\\\n\u00028\u0003\u0012\u0017Resource was not found.\u001a+*)135495396669, 23954537753, YOU_TUBE_VIDEO\"\u0010\u0012\u000e\n\noperations\u0018\u0000\u0012\u0016kgaAwzegQ_w_-OoGSWuaWQ",
"grpc-status-details-bin": "\b\u0003\u0012%Request contains an invalid argument.\u001a\u0001\nDtype.googleapis.com/google.ads.googleads.v10.errors.GoogleAdsFailure\u0012v\n\\\n\u00028\u0003\u0012\u0017Resource was not found.\u001a+*)135495396669, 23954537753, YOU_TUBE_VIDEO\"\u0010\u0012\u000e\n\noperations\u0018\u0000\u0012\u0016kgaAwzegQ_w_-OoGSWuaWQ",
"request-id": "kgaAwzegQ_w_-OoGSWuaWQ"
}
Fault: errors {

error_code {
mutate_error: RESOURCE_NOT_FOUND
}
message: "Resource was not found."
trigger {
string_value: "135495396669, 23954537753, YOU_TUBE_VIDEO"
}
location {
field_path_elements {
field_name: "operations"
index: 0
}
}
}
request_id: "kgaAwzegQ_w_-OoGSWuaWQ"

среда, 1 июня 2022 г. в 11:00:30 UTC+2, adsapi:

Google Ads API Forum Advisor

unread,
Jun 1, 2022, 11:57:56 AM6/1/22
to lepil...@gmail.com, adwor...@googlegroups.com
Hi Evgeniy,

Thank you for providing logs.

Upon taking look at your logs, it appears that the asset that you are trying to mutate using AdGroupAssetService.MutateAdGroupAssets is an ad group ad asset, not ad group asset. Please see the attached screenshot of the UI where I found the specific asset. This is the possible reason why the RESOURCE_NOT_FOUND error occurred on your end.

 The issue and provide recommendations to resolve it, could you first confirm which service you used to create your assets? Did you create the assets first using the AssetService then associated or used it on an ad when creating the said ad using the AdGroupAdService?

If yes, then you would not be able to use the AdGroupAssetService to manage the said assets. The ad_group_asset report, also, should be able to return assets created using the AdGroupAssetService. Let me know if you have any question.

Thanks,
Google Logo
Nirmita
Google Ad API Team
 


ref:_00D1U1174p._5004Q2bFMt5:ref
Screenshot 2022-06-01 11.55.33 AM.png

Tommy jarvis

unread,
Aug 22, 2025, 7:14:49 PM8/22/25
to Google Ads API and AdWords API Forum
"""
 The issue and provide recommendations to resolve it, could you first confirm which service you used to create your assets? Did you create the assets first using the AssetService then associated or used it on an ad when creating the said ad using the AdGroupAdService?

If yes, then you would not be able to use the AdGroupAssetService to manage the said assets. The ad_group_asset report, also, should be able to return assets created using the AdGroupAssetService. Let me know if you have any question.
"""

I am, so what can I do to delete a material in the advertising group, through google ADS SDK?

Google Ads API Forum Advisor

unread,
Aug 25, 2025, 1:24:04 AM8/25/25
to liumu...@gmail.com, adwor...@googlegroups.com
Hi,

In order to assist you further, could you please share more details on the statement that you have made 'delete a material in the advertising group'? Do you want to delete an asset from the ad group?
 

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-08-25 05:23:17Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02bFMt5:ref" (ADR-00109584)



Tommy jarvis

unread,
Aug 25, 2025, 2:08:10 AM8/25/25
to Google Ads API and AdWords API Forum
Ad_group_asset here is empty through GAQL query, but ad_group_ad_asset_view can find out the data.

Because ad_group_asset is empty, I can't delete it with AdGroupAssetService.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Google Ads API and AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/f4aP7StUMqU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/adwords-api/f3ca656c-4561-4942-8023-fc716c568f2dn%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages