Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Search Index get_url_notification_metadata throws ClientError: notFound

Aperta
#23,176 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
ruby
Ambito
api

Direzione di ricerca

Inizia eseguendo l'esempio Ruby fornito con la versione indicata di google-api-client e confronta la risposta corretta di publish_url_notification con il 404 restituito da get_url_notification_metadata. Il lavoro è completato quando si determina se la richiesta dei metadati dovrebbe avere esito positivo dopo la pubblicazione oppure si documenta un difetto riproducibile del client o dell'API utilizzando i log forniti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I am trying to use the search indexing api. I got it all setup and can see in the google api metrics page that i was authenticated and send the correct requests. The Problem is even if i update an url and get an 200 i get an error when i try to retrive the informations via get_url_notification_metadata. I dont now if i am doing something wrong, because i havent used this api yet or if there is a bug.

Environment details
  • OS: MacOS 15.4.1 (24E263)
  • Ruby version: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
  • Gem name and version: google-api-client (0.53.0)
  • Partial gem lock:
google-api-client (0.53.0)
  google-apis-core (~> 0.1)
  google-apis-generator (~> 0.1)
google-apis-core (0.17.0)
  addressable (~> 2.5, >= 2.5.1)
  googleauth (~> 1.9)
  httpclient (>= 2.8.3, < 3.a)
  mini_mime (~> 1.0)
  mutex_m
  representable (~> 3.0)
  retriable (>= 2.0, < 4.a)
google-apis-discovery_v1 (0.20.0)
  google-apis-core (>= 0.15.0, < 2.a)
google-apis-generator (0.17.0)
  activesupport (>= 5.0)
  gems (~> 1.2)
  google-apis-core (>= 0.15.0, < 2.a)
  google-apis-discovery_v1 (~> 0.18)
  thor (>= 0.20, < 2.a)
google-cloud-env (2.3.0)
  base64 (~> 0.2)
  faraday (>= 1.0, < 3.a)
google-logging-utils (0.2.0)
googleauth (1.14.0)
  faraday (>= 1.0, < 3.a)
  google-cloud-env (~> 2.2)
  google-logging-utils (~> 0.1)
  jwt (>= 1.4, < 3.0)
  multi_json (~> 1.11)
  os (>= 0.9, < 2.0)
  signet (>= 0.16, < 2.a)
Steps to reproduce
  1. Use the code below
  2. Change url to where you have access
  3. run
Code example
require 'google/apis/indexing_v3'
require 'googleauth'

scope = 'https://www.googleapis.com/auth/indexing'
index_service = Google::Apis::IndexingV3::IndexingService.new
index_service.authorization = Google::Auth::ServiceAccountCredentials.make_creds(json_key_io: File.open('app/controllers/content-api-key.json'),
                                                                                 scope: scope)
index_service.authorization.fetch_access_token!
url = "https://audiobookdb.net/audiobooks/x2Af9YPJ"
update_request_parameter = Google::Apis::IndexingV3::UrlNotification.new(url: url, type: "URL_UPDATED")
index_service.publish_url_notification(update_request_parameter)

begin
  index_service.get_url_notification_metadata(url: url)
rescue
end
Log
Sending HTTP post https://indexing.googleapis.com/v3/urlNotifications:publish?
200
#<HTTP::Message:0x0000000133e781d0 @http_body=#<HTTP::Message::Body:0x0000000133e78180 @body="{\n" + "  \"urlNotificationMetadata\": {\n" + "    \"url\": \"https://audiobookdb.net/audiobooks/x2Af9YPJ\"\n" + "  }\n" + "}\n", @chunk_size=nil, @positions=nil, @size=0>, @http_header=#<HTTP::Message::Headers:0x000000013255b378 @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @body_size=0, @body_type=nil, @chunked=false, @dumped=false, @header_item=[["Content-Type", "application/json; charset=UTF-8"], ["Vary", "Origin"], ["Vary", "X-Origin"], ["Vary", "Referer"], ["Content-Encoding", "gzip"], ["Date", "Wed, 21 May 2025 07:45:04 GMT"], ["Server", "ESF"], ["X-XSS-Protection", "0"], ["X-Frame-Options", "SAMEORIGIN"], ["X-Content-Type-Options", "nosniff"], ["Alt-Svc", "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"], ["Transfer-Encoding", "chunked"]], @http_version="1.1", @is_request=false, @reason_phrase="OK", @request_absolute_uri=nil, @request_method="POST", @request_query=nil, @request_uri=#<Addressable::URI:0x6eeb0 URI:https://indexing.googleapis.com/v3/urlNotifications:publish?>, @status_code=200>, @peer_cert=#<OpenSSL::X509::Certificate subject=#<OpenSSL::X509::Name CN=upload.video.google.com>, issuer=#<OpenSSL::X509::Name CN=WR2,O=Google Trust Services,C=US>, serial=#<OpenSSL::BN 269188937281416482999652193496082308393>, not_before=2025-04-21 08:41:49 UTC, not_after=2025-07-14 08:41:48 UTC>, @previous=nil>
Success - #<Google::Apis::IndexingV3::PublishUrlNotificationResponse:0x0000000132217478
 @url_notification_metadata=
  #<Google::Apis::IndexingV3::UrlNotificationMetadata:0x0000000132217040
   @url="https://audiobookdb.net/audiobooks/x2Af9YPJ">>

Sending HTTP get https://indexing.googleapis.com/v3/urlNotifications/metadata?url=https%3A%2F%2Faudiobookdb.net%2Faudiobooks%2Fx2Af9YPJ
404
#<HTTP::Message:0x0000000133cbcee0 @http_body=#<HTTP::Message::Body:0x0000000133cbce90 @body="{\n" + "  \"error\": {\n" + "    \"code\": 404,\n" + "    \"message\": \"Requested entity was not found.\",\n" + "    \"errors\": [\n" + "      {\n" + "        \"message\": \"Requested entity was not found.\",\n" + "        \"domain\": \"global\",\n" + "        \"reason\": \"notFound\"\n" + "      }\n" + "    ],\n" + "    \"status\": \"NOT_FOUND\"\n" + "  }\n" + "}\n", @chunk_size=nil, @positions=nil, @size=0>, @http_header=#<HTTP::Message::Headers:0x00000001324ff0a0 @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @body_size=0, @body_type=nil, @chunked=false, @dumped=false, @header_item=[["Vary", "Origin"], ["Vary", "X-Origin"], ["Vary", "Referer"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Encoding", "gzip"], ["Date", "Wed, 21 May 2025 07:45:04 GMT"], ["Server", "ESF"], ["X-XSS-Protection", "0"], ["X-Frame-Options", "SAMEORIGIN"], ["X-Content-Type-Options", "nosniff"], ["Alt-Svc", "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"], ["Transfer-Encoding", "chunked"]], @http_version="1.1", @is_request=false, @reason_phrase="Not Found", @request_absolute_uri=nil, @request_method="GET", @request_query=nil, @request_uri=#<Addressable::URI:0x6eec4 URI:https://indexing.googleapis.com/v3/urlNotifications/metadata?url=https%3A%2F%2Faudiobookdb.net%2Faudiobooks%2Fx2Af9YPJ>, @status_code=404>, @peer_cert=#<OpenSSL::X509::Certificate subject=#<OpenSSL::X509::Name CN=upload.video.google.com>, issuer=#<OpenSSL::X509::Name CN=WR2,O=Google Trust Services,C=US>, serial=#<OpenSSL::BN 269188937281416482999652193496082308393>, not_before=2025-04-21 08:41:49 UTC, not_after=2025-07-14 08:41:48 UTC>, @previous=nil>
Caught error notFound: Requested entity was not found.
Error - #<Google::Apis::ClientError: notFound: Requested entity was not found. status_code: 404 header: #<HTTP::Message::Headers:0x00000001324bc638 @http_version="1.1", @body_size=0, @chunked=false, @request_method="GET", @request_uri=#<Addressable::URI:0x6eec4 URI:https://indexing.googleapis.com/v3/urlNotifications/metadata?url=https%3A%2F%2Faudiobookdb.net%2Faudiobooks%2Fx2Af9YPJ>, @request_query=nil, @request_absolute_uri=nil, @status_code=404, @reason_phrase="Not Found", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false, @header_item=[["Vary", "Origin"], ["Vary", "X-Origin"], ["Vary", "Referer"], ["Content-Type", "application/json; charset=UTF-8"], ["Content-Encoding", "gzip"], ["Date", "Wed, 21 May 2025 07:45:04 GMT"], ["Server", "ESF"], ["X-XSS-Protection", "0"], ["X-Frame-Options", "SAMEORIGIN"], ["X-Content-Type-Options", "nosniff"], ["Alt-Svc", "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"], ["Transfer-Encoding", "chunked"]], @dumped=false> body: "{\n  \"error\": {\n    \"code\": 404,\n    \"message\": \"Requested entity was not found.\",\n    \"errors\": [\n      {\n        \"message\": \"Requested entity was not found.\",\n        \"domain\": \"global\",\n        \"reason\": \"notFound\"\n      }\n    ],\n    \"status\": \"NOT_FOUND\"\n  }\n}\n">
Api Metric
Image
Lingua principale
Ruby
Stelle
2.9k
Fork
888
Merge medio
8m
PR unite (30g)
243

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googleapis/google-api-ruby-client

Tutte le issue di googleapis/google-api-ruby-client

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.