Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unexpected unacked messages for Push to BigQuery subscriptions

Hello, community!

I'm facing an issue with Pub/Sub subscription metrics (Push delivery type with Write to BigQuery). Specifically, I see unacked messages in some subscriptions, even though all other metrics indicate normal behavior. I can't figure out why these unacknowledged messages exist or what causes them.

For example, one of my subscriptions is configured as follows:

Screenshot 2025-02-27 at 15.00.07.png

Unacked messages metric (last 6 hours):

Screenshot 2025-02-27 at 15.04.39.png

Delivery metrics and Delivery latency health score (last 6 hours):

Screenshot 2025-02-27 at 15.04.50.pngScreenshot 2025-02-27 at 15.05.17.png

Based on these metrics, there shouldn't be any unacknowledged messages — every message appears to be acknowledged.

Could anyone share insights on potential reasons for this? Is this an expected behavior under certain conditions, or could it be a bug? Any guidance on troubleshooting or relevant documentation would be greatly appreciated.

Thank you in advance.

0 1 157
1 REPLY 1

Hi tiger2417,

Welcome to the Google Cloud Community!

The likely cause why you're seeing unacknowledged messages in your Pub/Sub subscription is BigQuery write failures, which could result from transient errors, schema mismatches, quota limits, or invalid data. Another possibility is the expiry of the acknowledgement deadline if BigQuery insertions take too long, causing delays in acknowledging messages.

Here are some suggestions that might help you with troubleshooting:

  • Use Cloud Logging to examine errors related to BigQuery insertions around the times the unacked messages increased. Look for schema issues, quota limits, or service outages.
  • See if messages are ending up in the Dead Letter Queue, and examine their contents to understand why they failed. If messages are in the DLQ, check their payload and attributes for clues. Common issues might be null fields in required columns, data type mismatches (string vs. integer), or values exceeding field length limits.
  • Ensure your BigQuery table schema matches the Pub/Sub topic schema.
  • If transient errors are the problem, consider increasing retry attempts or using exponential backoff.
  • Double-check that your subscription filters are working as expected and not unintentionally rejecting messages.

You may also find this documentation helpful, as it provides additional information why you are receiving duplicate messages.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.