{"record":{"id":"54b8984c2f2789aa","repo":"XX-net/XX-Net","slug":"all-appid-out-of-quota-wait-d-seconds-to-reset","errorCode":null,"errorMessage":"all appid out of quota, wait %d seconds to reset","messagePattern":"all appid out of quota, wait (.+?) seconds to reset","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/gae_proxy/local/appid_manager.py","lineNumber":46,"sourceCode":"    def reset_appid(self):\n        # called by web_control\n        with self.lock:\n            self.working_appid_list = list()\n            for appid in self.config.GAE_APPIDS:\n                if not appid:\n                    self.config.GAE_APPIDS.remove(appid)\n                    continue\n                self.working_appid_list.append(appid)\n            self.not_exist_appids = []\n            self.out_of_quota_appids = []\n        self.last_reset_time = time.time()\n\n    def get(self):\n        if len(self.config.GAE_APPIDS):\n            if len(self.working_appid_list) == 0:\n                time_to_reset = 600 - (time.time() - self.last_reset_time)\n                if time_to_reset > 0:\n                    self.logger.warn(\"all appid out of quota, wait %d seconds to reset\", time_to_reset)\n                    sleep_end = time.time() + time_to_reset\n                    while len(self.working_appid_list) == 0 and time.time() < sleep_end:\n                        time.sleep(1)\n                    return None\n                else:\n                    self.logger.warn(\"reset appid\")\n                    self.reset_appid()\n\n            appid = random.choice(self.working_appid_list)\n            return str(appid)\n        else:\n            for _ in range(0, 10):\n                appid = self.public_appid.get()\n                if appid in self.out_of_quota_appids or appid in self.not_exist_appids:\n                    continue\n                else:\n                    return appid\n            return None","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/gae_proxy/local/appid_manager.py#L28-L64","documentation":"All configured GAE appids are out of quota and the 600-second reset window hasn't elapsed. get() blocks (1s poll) until either an appid recovers or the window expires, then returns None. The 'wait %d seconds' message states remaining wait time.","triggerScenarios":"Every appid in working_appid_list has been reported out of quota; get() called again within 10 minutes of last_reset_time.","commonSituations":"Free GAE appids exhausted their daily quota, too few appids configured for the traffic volume, or heavy usage period.","solutions":["Add more GAE appids to config (GAE_APPIDS)","Wait for the ~10-minute quota reset window to pass","Deploy appids across multiple Google accounts/projects to spread quota","Upgrade to a paid GCP project with higher quota"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if appid_manager.get() is None:\n    switch_to_alternate_front()  # e.g. x-tunnel","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure 3+ appids across separate GCP projects","Check appid availability before high-traffic jobs","Monitor working_appid_list length and alert when low"],"tags":["gae-proxy","appid","quota","throttle"],"backgroundTag":"api-quota-exceeded","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}