Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Se non ricevi una risposta positiva da una richiesta all'API Cloud Endpoints Frameworks, puoi utilizzare Cloud Logging nella consoleGoogle Cloud per risolvere i problemi.
Visualizzazione dei log
Nella Google Cloud console, vai alla pagina Logging >
Esplora log.
Nell'elenco a discesa del progetto nella parte superiore della pagina, seleziona il
Google Cloud progetto in cui hai creato l'API.
Seleziona GAE Application e All logs.
Modifica l'intervallo di tempo finché non viene visualizzata una riga che mostra un errore.
Fai clic su Espandi tutto per visualizzare l'intero log relativo all'errore.
La sezione seguente fornisce informazioni sulla risoluzione dei problemi relativi a messaggi di errore specifici. Se non riesci a risolvere il problema, copia una delle voci di log che mostra l'errore e incollala in un file di testo. Includi il log in qualsiasi comunicazione con Google.
503 Service Unavailable
App Engine potrebbe richiedere alcuni minuti per rispondere correttamente alle richieste. Se invii una richiesta e ricevi un errore 503, attendi qualche minuto e riprova. Se non ricevi ancora una risposta positiva, controlla i log di Cloud Logging. Di seguito sono riportati alcuni messaggi di errore che potresti
trovare nei log di Cloud Logging.
Messaggio di errore
Risoluzione dei problemi
Nessun servizio YOUR_PROJECT_ID.appspot.com trovato o
autorizzazione negata. Se si tratta di un nuovo servizio Endpoints, assicurati di aver eseguito il deployment della configurazione del servizio utilizzando gcloud.
Endpoints Frameworks for Python registra questo errore quando non riesce a caricare la configurazione del servizio specificata nel file app.yaml. Questo errore può verificarsi se non hai eseguito il deployment del documento OpenAPI per la tua API utilizzando gcloud endpoints services
deploy o se l'API Service Management non è abilitata. Quando esegui il deployment del documento OpenAPI per la tua API, il comando gcloud attiva automaticamente quanto segue:
API Service Management
(servicemanagement.googleapis.com)
Il servizio YOUR_PROJECT_ID.appspot.com è stato trovato, ma non è stata trovata alcuna configurazione del servizio per la versione SERVICE_CONFIG_ID.
Endpoints Frameworks per Python registra questo errore quando non riesce a trovare l'ID di configurazione del servizio specificato per ENDPOINTS_SERVICE_VERSION nel file app.yaml.
Per risolvere l'errore:
Modifica il file app.yaml e imposta
ENDPOINTS_SERVICE_VERSION sull'ID configurazione del servizio.
Esegui il redeployment dell'app:
gcloudappdeploy
404 Not Found
Se di recente hai eseguito la migrazione alla versione 2 di Endpoints Frameworks e ricevi il messaggio di errore 404 Not Found, consulta le seguenti sezioni per risolvere il problema:
In alcune versioni di Windows PowerShell, l'esempio Invoke-WebRequest nei
tutorial non va a buon fine. Abbiamo anche ricevuto un
report che indicava che la risposta conteneva un elenco di byte non firmati che dovevano essere
convertiti in caratteri. Se l'esempio Invoke-WebRequest non ha restituito il risultato previsto, prova a inviare la richiesta utilizzando un'altra applicazione. Di seguito sono riportati alcuni suggerimenti:
Avvia Cloud Shell e segui i passaggi per Linux nel tutorial che stavi utilizzando per inviare la richiesta.
Utilizza un'applicazione di terze parti come l'estensione del browser Chrome Postman
(offerta da www.getpostman.com). Quando crei la richiesta in Postman:
Seleziona POST come verbo HTTP.
Per l'intestazione, seleziona la chiave content-type e il valore
application/json.
Per il corpo, inserisci: {"message":"hello world"}
Inserisci l'URL dell'applicazione di esempio. Ad esempio:
Scarica e installa curl, che devi eseguire nel prompt dei comandi. Poiché Windows non gestisce le virgolette doppie nidificate all'interno di virgolette singole, devi modificare l'opzione --data nell'esempio, come segue: --data "{\"message\":\"hello world\"}"
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eCloud Logging helps troubleshoot unsuccessful responses from Cloud Endpoints Frameworks APIs, accessible via the Logs Explorer in the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003e503 Service Unavailable\u003c/code\u003e error may occur initially with App Engine; waiting a few minutes and retrying the request is recommended before checking logs.\u003c/p\u003e\n"],["\u003cp\u003eErrors like "No service found" or "permission denied" often indicate a missing service configuration or disabled APIs, which can be resolved by deploying the OpenAPI document and ensuring necessary APIs are enabled.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003e404 Not Found\u003c/code\u003e error after migrating to Endpoints Frameworks version 2 requires specific troubleshooting steps detailed in Java and Python migration guides.\u003c/p\u003e\n"],["\u003cp\u003eIf \u003ccode\u003eInvoke-WebRequest\u003c/code\u003e fails in Windows PowerShell, try using Cloud Shell, Postman, or \u003ccode\u003ecurl\u003c/code\u003e with specific formatting for nested quotation marks.\u003c/p\u003e\n"]]],[],null,["# Troubleshooting response errors\n\nIf you don't get a successful response from a request to your\nCloud Endpoints Frameworks API, you can use Cloud Logging in the\nGoogle Cloud console to help troubleshoot.\n\nViewing logs\n------------\n\n1. In the Google Cloud console, go to the **Logging** \\\u003e\n **Logs Explorer** page.\n\n\n [Go to the Logs Explorer page](https://console.cloud.google.com/logs/query)\n\n \u003cbr /\u003e\n\n2. From the project drop-down list at the top of the page, select the\n Google Cloud project in which you created your API.\n\n3. Select **GAE Application** and **All logs**.\n\n4. Adjust the time range until you see a row that shows an error.\n\n5. Click **Expand All** to see the entire log for the error.\n\nThe following section provides troubleshooting information for specific error\nmessages. If you are unable to fix the issue, copy one of the log entries that\nshows the error and paste it in a text file. Include the log in any\ncommunication that you have with Google.\n\n### `503 Service Unavailable`\n\nApp Engine might take a few minutes to respond successfully to requests. If you\nsend a request and get a `503` error, wait a few minutes and try the\nrequest again. If you still don't get a successful response, check the\nCloud Logging logs. The following are some error messages that you might\nsee in the Cloud Logging logs.\n\n### `404 Not Found`\n\nIf you recently migrated to Endpoints Frameworks version 2, and you\nget the `404 Not Found` error message, see the following sections to\ntroubleshoot the issue:\n\n- [Java: Troubleshooting](/endpoints/docs/frameworks/java/migrating#api_returns_404_errors_but_api_explorer_still_lists_apis_correctly)\n- [Python: Troubleshooting](/endpoints/docs/frameworks/python/migrating#api_returns_404_errors_but_api_explorer_still_lists_apis_correctly)\n\nIssues with the example `Invoke-WebRequest`\n-------------------------------------------\n\nIn some versions of Windows PowerShell, the example `Invoke-WebRequest` in the\n[tutorials](/endpoints/docs/frameworks/tutorials) fails. We have also received a\nreport that the response contained a list of unsigned bytes that had to be\nconverted to characters. If the example `Invoke-WebRequest` didn't return the\nexpected result, try sending the request using another application. Following\nare a few suggestions:\n\n- [Start Cloud Shell](/shell/docs/starting-cloud-shell), and follow the Linux steps in the tutorial that you were using to send the request.\n- Use a third-party application such as the Chrome browser extension Postman\n (offered by `www.getpostman.com`). When creating the request in Postman:\n\n - Select `POST` as the HTTP verb.\n - For the header, select the key `content-type` and the value `application/json`.\n - For the body, enter: `{\"message\":\"hello world\"}`\n - Enter the URL for the sample application. For example:\n\n https://example-project-12345.appspot.com/_ah/api/echo/v1/echo\n\n- Download and install [`curl`](https://curl.haxx.se/download.html), which you\n run in the Command prompt. Because Windows doesn't handle double quotation\n marks nested inside single quotation marks, you have to change the `--data`\n option in the example, as follows: `--data \"{\\\"message\\\":\\\"hello world\\\"}\"`\n\nWhat's next\n\n- Get started using the [Logs Explorer](/logging/docs/view/logs-explorer-interface).\n\n- Learn how to [route logs](/logging/docs/export/configure_export_v2).\n\n- Use [filters](/logging/docs/view/advanced_filters)\n for advanced filtering, such as getting all requests with a latency greater\n than 300 milliseconds."]]