I've written a microservice using the nestjs architecture (specifically based on
https://github.com/crallen/nestjs-google-pubsub). Locally i'm running this using cloud code and its working fine, however when I deploy the service to App Engine I get the following error when I tries to subscribe to the pubsub topics.
at processTicksAndRejections (node:internal/process/task_queues:78:11)
at /workspace/node_modules/@grpc/grpc-js/build/src/call-stream.js:187:78)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:328:181)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:365:141)
at Object.onReceiveStatus (/workspace/node_modules/@grpc/grpc-js/build/src/client.js:189:52)
at Object.callErrorFromStatus (/workspace/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
[PubSubServer] [Error: 16 UNAUTHENTICATED: Failed to retrieve auth metadata with error: Could not refresh access token: Unsuccessful response status code. Request failed with status code 500
I've granted the app engine service account the PubSub Editor role, is there an additional role it needs or is the PubSub API not properly setup to use the service account in app engine via ADC and I need to explicitly set the GOOGLE_APPLICATION_CREDENTIALS? Thanks for your attention.