oura icon indicating copy to clipboard operation
oura copied to clipboard

Crashing due to GCP Pub/Sub API token expiration

Open Vardominator opened this issue 3 years ago • 1 comments

When using the GCP Pub/Sub sink, Oura is crashing due to an access token expiration:

thread '<unnamed>' panicked at 'writer loop failed: PubSub { code: 401, message: "{\n  \"error\": {\n    \"code\": 401,\n    \"message\": \"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.\",\n    \"status\": \"UNAUTHENTICATED\",\n    \"details\": [\n      {\n        \"@type\": \"type.googleapis.com/google.rpc.ErrorInfo\",\n        \"reason\": \"ACCESS_TOKEN_EXPIRED\",\n        \"domain\": \"googleapis.com\",\n        \"metadata\": {\n          \"method\": \"google.pubsub.v1.Publisher.Publish\",\n          \"service\": \"pubsub.googleapis.com\"\n        }\n      }\n    ]\n  }\n}\n", status: "Error occurred attempting to subscribe" }', src/sinks/gcp_pubsub/setup.rs:44:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is it possible to automatically refresh the access token without having to restart Oura?

Vardominator avatar Dec 03 '22 00:12 Vardominator

@Vardominator FYI, latest version of the google pubsub lib seems to have implemented automatic token refresh. The lib has some breaking change, I'll work on applying them on Oura's side.

scarmuega avatar Jan 20 '23 11:01 scarmuega