google-cloud-python icon indicating copy to clipboard operation
google-cloud-python copied to clipboard

Share exceptions when opening AppendRowsStream instead of the generic "Try turning on DEBUG level logs to see the error." exception

Open dhendry opened this issue 2 years ago • 3 comments

  • When an exception occurs opening a AppendRowsStream (for example when there is a protobuf-bq schema mismatch), a generic ` "There was a problem opening the stream. Try turning on DEBUG level logs to see the error." exception is raised which is incredibly unhelpful.
    • Our production services do not run with debug logs and I recently spent a lot of time trying to reproduce the conditions which would trigger a stream open error which would have been MUCH simpler if the exception was simply forwarded through.
  • There is the following TODO in the code here
        # Something went wrong when opening the RPC.
        if not is_consumer_active:
            # TODO: Share the exception from _rpc.open(). Blocked by
            # https://github.com/googleapis/python-api-core/issues/268
            request_exception = exceptions.Unknown(
                "There was a problem opening the stream. "
                "Try turning on DEBUG level logs to see the error."
            )
            self.close(reason=request_exception)
            raise request_exception

It appears https://github.com/googleapis/python-api-core/issues/268 has been closed. It would be really awesome if this could be revisited.

dhendry avatar Jan 10 '24 16:01 dhendry

Hi @dhendry, thank you for raising this issue! Actionable error is something we want to ensure for our users. Just so I know the exact situation, could you share a code snippet that reproduces the issue, and even better, the exact unhelpful exception raised (the printed stack tracing and stuff)? Thank you for your help :)

Linchin avatar Jan 31 '24 22:01 Linchin

@Linchin I am working on something related to this. I can provide you with code and a demo during our next 1:1.

chalmerlowe avatar May 14 '24 13:05 chalmerlowe

This issue was transferred from python-bigquery-storage to google-cloud-python as part of the work for https://github.com/googleapis/google-cloud-python/issues/10991.

parthea avatar Aug 22 '25 11:08 parthea