sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

APIError(Missing required attribute in authentication header: sentry_secret) when capture Exception in ThreadPoolExecutor

Open duyixian1234 opened this issue 7 years ago • 1 comments

I want to capture exceptions from a python grpc server where running in a ThreadPoolExecutor

server = grpc.server(futures.ThreadPoolExecutor(max_workers=grpc_workers))

Then i initialized sentry before the grpc server running

if __name__ == '__main__':
    sentry_sdk.init(config.GRPC_SENTRY_DSN)
    serve()

The when exceptions occured in grpc calls, "ERROR:sentry.errors:Sentry responded with an API error: APIError(Missing required attribute in authentication header: sentry_secret)" appeared. While if I use sentry_sdk.capture_message() in main thread, everything is ok.

duyixian1234 avatar Jan 22 '19 03:01 duyixian1234

I find there is a sentry instance in another file with different DSN which is got from environment variable not set

duyixian1234 avatar Jan 22 '19 08:01 duyixian1234