Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Pelanggan push adalah jenis pelanggan Pub/Sub tempat pesan dikirim dari Pub/Sub ke endpoint HTTPS yang ditentukan pengguna. Pengguna mengonfirmasi pesan yang dikirim dengan menampilkan respons HTTP 200 ke permintaan server push. Dokumen ini memberikan beberapa tips pemecahan masalah umum untuk langganan push Pub/Sub. Baca selengkapnya tentang langganan push di Panduan subscriber push.
Jika endpoint menampilkan kode respons error, pengiriman pesan dianggap gagal dan akan dicoba lagi nanti. Hal ini berpotensi menyebabkan endpoint menerima pesan duplikat.
Ada beberapa metrik yang dapat Anda gunakan untuk memantau langganan push. Metrik subscription/push_request_count di Cloud Metrics mengategorikan respons dari endpoint push berdasarkan response_code dan response_class. Respons ini berguna untuk mengidentifikasi potensi malfungsi endpoint. Jika metrik ini memiliki data dengan response_class selain ack, hal ini menunjukkan bahwa endpoint push menampilkan error ke Pub/Sub. Beberapa error yang paling umum meliputi:
Class respons deadline_exceeded menunjukkan bahwa endpoint push tidak merespons dalam batas waktu konfirmasi (ack) yang diperlukan. Metrik subscription/push_request_latencies membantu melacak latensi ack push.
Class respons invalid menunjukkan bahwa endpoint mengirim kembali respons yang tidak dapat dipahami atau diproses dengan benar oleh Pub/Sub.
Class respons remote_server_4xx biasanya menunjukkan masalah autentikasi atau izin. Ini adalah kode respons HTTP yang ditampilkan oleh endpoint, jadi lihat skenario saat kode respons ini ditampilkan. Jika autentikasi diaktifkan, konfirmasi bahwa akun Anda memiliki izin yang tepat di endpoint. Pelajari lebih lanjut cara kerja autentikasi di langganan push.
Class respons remote_server_5xx menunjukkan masalah sisi server di sisi endpoint. Endpoint tidak dapat memproses permintaan. Hal ini mungkin disebabkan oleh pemeliharaan atau pemadaman layanan yang sedang berlangsung. Tinjau status server yang menghosting endpoint.
Class respons unreachable menunjukkan bahwa server endpoint tidak dapat dijangkau sama sekali. Verifikasi URL endpoint untuk mengetahui kesalahan ketik.
Pelajari kode error Pub/Sub API yang paling umum lebih lanjut.
Batasan pada langganan push di dalam perimeter VPC-SC
Jika perlindungan Kontrol Layanan VPC (VPC-SC) diaktifkan di project, ada batasan untuk membuat langganan push. Langganan push yang ada akan terus berfungsi, tetapi saat membuat langganan push baru, Anda akan melihat error: Request is prohibited by organization's policy. Secara khusus, langganan push baru hanya dapat dibuat jika endpoint push adalah layanan Cloud Run yang menggunakan URL run.app default. Untuk detail selengkapnya dan batasan tertentu, lihat dokumentasi Pub/Sub dan dokumentasi VPC-SC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]