消费者 'project_number:#' 的配额 'administrator' 和服务 'pubsub.googleapis.com' 的限制 'CLIENT_PROJECT-100s' 的令牌不足

Insufficient tokens for quota 'administrator' and limit 'CLIENT_PROJECT-100s' of service 'pubsub.googleapis.com' for consumer 'project_number:#'

创建订阅时有时会出现以下错误:

Insufficient tokens for quota 'administrator' and limit 'CLIENT_PROJECT-100s' of service 'pubsub.googleapis.com' for consumer 'project_number:'

稍等一下就可以了,但我想增加配额。在 Google Cloud Console 的 IAM & Admin 部分,我可以过滤 Pub/Sub API,但找不到限制...

您运行未达到管理操作的配额。在Quotas page, under "Quota type," select "All quotas," then under "Service" select "Google Cloud Pub/Sub API." The quota you want to increase is "Administrator operations per 100 seconds," which you can update up to the maximum allowed limit of 10,000 per 100 seconds, as detailed on the Pub/Sub quota page. Here is a screenshot of the entity you need to update:

根据 AboulHosen 在 GCP Slack 上的说法:

"It does look like quota is pooled across users of the default application credentials and that the quota is significantly lower for users authenticated in this way. I believe when going to app engine, a service account is created (https://cloud.google.com/appengine/docs/flexible/python/access-control#using_service_accounts), so I would not anticipate this error happening when running on app engine."

所以发生这种情况的原因是因为您的管理员凭据的配额正在其他地方使用,据我所知,没有办法增加它!

我遇到了类似的错误。

我检查了配额部分——按照 Kamal Aboul-Hosn 的建议——但是它已经用完了。

一种解决方法是在代码中放置一个睡眠函数,这样 API 就不会在一百秒的时间内受到重击。希望对您有所帮助。