我在使用Google Cloud PubSub API时遇到了一些问题.最近,我开始使用Cloud PubSub为我正在处理的聊天服务器排队消息.来自PubSub订阅的消息将使用socket.io节点库转发给用户.我没有遇到这个设置问题 - 我运行我的node.js服务器,打开几个浏览器窗口,我可以毫无问题地聊天.
但是,我注意到,经常在服务器运行几个小时后,它开始吐出以下错误:
(node:2525) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: 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.
(node:2525) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: 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.
...
(node:2525) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1253): Error: Request had invalid authentication credentials. Expected …