104 Connection Errors from Box API

Hello! Just wondering if anyone else has been getting a lot of 104 Connection reset errors being sent from the Python BoxSDK client. We have an API set up to receive webhook events from Box but will receive 104 connection events randomly that seem to cause an error executing the webhook endpoint. Most of the time it executes fine but when there is an error I noticed the 104 connection reset state will persist for a bit blocking the endpoint from executing properly. Wondering if there is a way to limit the amount of resets the boxclient will do to prevent blocking from what Im assuming is the retry logic.

Hi @user242

Can you share the example of the code you are using? Are you getting the events by stream or you are setting up some endpoints to Box send the event into?

Thanks for the response! Sure heres the relevant part where its failing on using the BoxSDK client to get a webhook

async def box_folder_webhook(request: Request, model: WebhookPayloadModel):
    """
    This endpoint will recieve the webhook requests
    from the box on file upload to a particular folder
    """
    try:
        file_id = model.source.id
        file_name = model.source.name
        # signature verification
        if not await verify_signature(request):
            logging.error("Incoming Box webhook signature is invalid.")
            # Returning 401 will schedule a retry on Box
            # https://developer.box.com/guides/webhooks/v2/#retries
            return Response(status_code=status.HTTP_401_UNAUTHORIZED)

        box_api = BoxAPI(client=BoxSDK.client)
        # Grabbing webhook id to get folder id
        webhook_id = model.webhook.id
        webhook = BoxSDK.client.webhook(webhook_id).get()

Our logs say its getting a time out at the last line but we try to do more stuff after getting the webhook. It happens intermittently too which is weird.

Hi @user242

It seems like the connection between your service and Box is not stable. We have some kind of retry mechanism that can help you reduce this issue. Please adjust the maximum retry attempt number to see if it can help.