[Python] Google Chat Bot always shows “not responding” prompt despite valid 200/JSON response...

Discussão em 'Python' iniciado por Stack, Junho 18, 2025.

  1. Stack

    Stack Membro Participativo

    I am developing a Google Chat bot using Python (Flask, Gunicorn, Docker) that acts as a bridge between Google Chat and another system. The bot is deployed at a public HTTPS endpoint and uses a secret path in the URL for security.

    Whenever I send a message to the bot (either in a space or direct message), Google Chat always shows the “not responding” prompt, even though my endpoint returns a 200 status and a valid JSON response.

    I’ve confirmed the bot is responding within 30 milliseconds (well under the 5-second limit). For example: •For message events, the bot returns:

    { "text": "pong" }

    or a more detailed help message using Flask’s jsonify(). • For add/remove events, the bot returns an empty response ('', 200).

    Testing shows: • POST requests using Postman return the correct JSON and a 200 status. • The endpoint is publicly accessible and not behind any firewall. • Google Cloud logs show 200 responses with no errors. • The bot’s internal logs confirm requests are being received and processed.

    I’ve tried: • Returning minimal JSON ({"text": "pong"}) • Returning empty response ('', 200) • Sending help messages and card payloads • Re-adding the bot and verifying all trigger URLs

    Configuration: • The bot is set to “live” in Google Cloud Console • All required APIs (e.g., chat.googleapis.com) are enabled • The bot works as expected in Postman • Access is limited to my Google Workspace domain • Tried both a single endpoint for all events and separate ones

    Example route handler:

    @app.route("/<secret>", methods=["POST"])
    def handle_message(secret):
    from flask import jsonify, request
    data = request.get_json()
    return jsonify({"text": "pong"})


    Despite all of this, in Google Chat, every interaction results in the “not responding” prompt. There’s no visible reply, even though logs show the response is sent.

    What could I be missing? • Does Google Chat require a specific response format beyond status 200 and JSON? • Are there lesser-known settings or headers that must be included? • Is there a validation step or webhook handshake I may have missed?

    Any insight or troubleshooting advice would be greatly appreciated.

    Continue reading...

Compartilhe esta Página