Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Os assinantes push são um tipo de assinante do Pub/Sub em que as mensagens são enviadas do Pub/Sub para um endpoint HTTPS especificado pelo usuário. O usuário confirma uma mensagem push retornando uma resposta HTTP 200 à solicitação do servidor de push. Este documento oferece algumas dicas comuns de solução de problemas para assinaturas push do Pub/Sub. Leia mais sobre as assinaturas de push no guia do assinante de push.
Se o endpoint retornar um código de resposta de erro, o envio da mensagem será considerado como falha e será tentado novamente mais tarde. Isso pode levar o ponto de extremidade a receber mensagens duplicadas.
Há várias métricas que podem ser usadas para monitorar assinaturas de push. A métrica subscription/push_request_count nas Métricas do Google Cloud categoriza as respostas do endpoint de push por response_code e response_class. As respostas são úteis para identificar possíveis problemas de funcionamento do endpoint. Se essa métrica tiver dados com um response_class diferente de ack, isso indica que o endpoint de push está retornando erros para o Pub/Sub. Alguns dos erros mais comuns incluem:
Uma classe de resposta deadline_exceeded indica que o endpoint de push não respondeu dentro do prazo de confirmação (ACK) necessário. A métrica subscription/push_request_latencies ajuda a rastrear a latência de push ack.
Uma classe de resposta invalid indica que o endpoint enviou uma resposta que o Pub/Sub não conseguiu entender ou processar corretamente.
Uma classe de resposta remote_server_4xx geralmente indica problemas de autenticação ou permissão. Esses são códigos de resposta HTTP retornados pelo endpoint. Confira os cenários em que esse código de resposta é retornado. Se a autenticação estiver ativada, confirme se a conta tem a permissão correta no endpoint. Saiba como a autenticação funciona nas assinaturas por push.
Uma classe de resposta remote_server_5xx indica um problema do lado do servidor no endpoint. O endpoint não consegue processar a solicitação. Isso pode ser devido a uma manutenção ou interrupção em andamento. Verifique o status do servidor que hospeda o endpoint.
Uma classe de resposta unreachable indica que o servidor de endpoint não pode ser acessado. Verifique se há erros de digitação no URL do endpoint.
Restrições em assinaturas push dentro de um perímetro VPC-SC
Se a proteção do VPC Service Controls (VPC-SC) estiver ativada em um projeto, haverá limitações na criação de assinaturas push. As inscrições push atuais continuam funcionando, mas, ao criar uma nova, você recebe o erro: Request is prohibited by organization's policy. Especificamente, novas assinaturas de push só podem ser criadas se o endpoint de push for um serviço do Cloud Run usando o URL run.app padrão. Para mais detalhes e limitações específicas, consulte a documentação do Pub/Sub e a documentação do VPC-SC.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-17 UTC."],[],[],null,["# Troubleshooting a push subscription\n\nPush subscribers are a type of Pub/Sub subscriber where messages are sent from Pub/Sub to a user-specified HTTPS endpoint. The user acknowledges a pushed message by returning an HTTP 200 response to the push server's request. This document provides some common troubleshooting tips for Pub/Sub push subscriptions. Read more about push subscriptions in the [Push subscriber guide](/pubsub/docs/push).\n\nTo effectively monitor your Pub/Sub subscription, it is recommended to first look at the [delivery latency health score](/pubsub/docs/monitoring#delivery_latency_health) ([`subscription/delivery_latency_health_score`](/monitoring/api/metrics_gcp_p_z#pubsub/subscription/delivery_latency_health_score)) to check which factors could be contributing to an unexpected latency.\n\nFailing or slow push endpoints\n------------------------------\n\nIf the endpoint returns an error response code, then the message delivery is considered to have failed and is retried later. This can potentially lead to the endpoint receiving duplicate messages.\n\nThere are multiple metrics that you can use to [monitor push subscriptions](/pubsub/docs/monitoring#monitoring_push_subscriptions). The [`subscription/push_request_count`](/monitoring/api/metrics_gcp_p_z#pubsub/subscription/push_request_count) metric in Cloud Metrics categorizes responses from the push endpoint by `response_code` and `response_class`. The responses are useful for the identification of potential endpoint malfunctions. If this metric has data with a `response_class` other than `ack`, this indicates that the push endpoint is returning errors to Pub/Sub. Some of the most common errors include:\n\n- A `deadline_exceeded` response class indicates that the push endpoint didn't respond within the required acknowledgment (ack) deadline. The [`subscription/push_request_latencies`](/monitoring/api/metrics_gcp_p_z#pubsub/subscription/push_request_latencies) metric helps to track push ack latency.\n\n- An `invalid` response class indicates that the endpoint sent back a response that Pub/Sub couldn't understand or process correctly.\n\n- A `remote_server_4xx` response class usually indicates authentication or permission issues. These are HTTP response codes returned by the endpoint, so look at the scenarios under which this response code is returned. If authentication is enabled, confirm your account has the right permission on the endpoint. Learn more about how [authentication](/pubsub/docs/create-push-subscription#authentication) works in push subscriptions.\n\n- A `remote_server_5xx` response class indicates a server-side problem on the endpoint side. The endpoint is unable to process the request. This might be due to an ongoing maintenance or outage. Review the status of the server hosting the endpoint.\n\n- An `unreachable` response class indicates that the endpoint server cannot be reached at all. Verify the endpoint URL for typos.\n\nLearn more about the most common [error codes](/pubsub/docs/reference/error-codes) of the Pub/Sub API.\n\nRestrictions on push subscriptions inside a VPC-SC perimeter\n------------------------------------------------------------\n\nIf VPC Service Controls (VPC-SC) protection is enabled in a project, there are limitations on creating push subscriptions. Existing push subscriptions continue to work, but when you create a new push subscription, you see the error: `Request is prohibited by organization's policy`. Specifically, new push subscriptions can only be created if the push endpoint is a Cloud Run service using the default `run.app` URL. For more details and specific limitations, see [Pub/Sub documentation](/pubsub/docs/create-push-subscription#vpc-service-control) and [VPC-SC documentation](/vpc-service-controls/docs/supported-products#table_pubsub)."]]