Как я могу исправить ошибку yowsup stream: code 503? - PullRequest
0 голосов
/ 24 апреля 2020

Я использую подписку о присутствии на слишком много номеров через yowsup-cli. Но через некоторое время я получаю поток: error code = "503" error. Обычно это происходит через 15 минут. Как я могу решить эту проблему?

Я получаю эту ошибку:

{
  "data": "D 2020-04-24 01:05:52,234 yowsup.layers.logger.layer - rx:\n<stream:error code=\"503\" />\nE 2020-04-24 01:05:52,235 yowsup.layers.network.dispatcher.dispatcher_asyncore - Traceback (most recent call last):\n  File \"/usr/lib/python2.7/asyncore.py\", line 83, in read\n    obj.handle_read_event()\n  File \"/usr/lib/python2.7/asyncore.py\", line 449, in handle_read_event\n    self.handle_read()\n  File \"/var/www/html/yowsup/yowsup/layers/network/dispatcher/dispatcher_asyncore.py\", line 48, in handle_read\n    self.connectionCallbacks.onRecvData(data)\n  File \"/var/www/html/yowsup/yowsup/layers/network/layer.py\", line 107, in onRecvData\n    self.receive(data)\n  File \"/var/www/html/yowsup/yowsup/layers/network/layer.py\", line 110, in receive\n    self.toUpper(data)\n  File \"/var/www/html/yowsup/yowsup/layers/__init__.py\", line 79, in toUpper\n    self.__upper.receive(data)\n  File \"/var/www/html/yowsup/yowsup/layers/noise/layer_noise_segments.py\", line 39, in receive\n    self.toUpper(bytes(data))\n  File \"/var/www/html/yowsup/yowsup/layers/__init__.py\", line 79, in toUpper\n    self.__upper.receive(data)\n  File \"/var/www/html/yowsup/yowsup/layers/noise/layer.py\", line 181, in receive\n    self._flush_incoming_buffer()\n  File \"/var/www/html/yowsup/yowsup/layers/noise/layer.py\", line 169, in _flush_incoming_buffer\n    self.toUpper(self._wa_noiseprotocol.receive())\n  File \"/var/www/html/yowsup/yowsup/layers/__init__.py\", line 79, in toUpper\n    self.__upper.receive(data)\n  File \"/var/www/html/yowsup/yowsup/layers/coder/layer.py\", line 21, in receive\n    self.toUpper(node)\n  File \"/var/www/html/yowsup/yowsup/layers/__init__.py\", line 79, in toUpper\n    self.__upper.receive(data)\n  File \"/var/www/html/yowsup/yowsup/layers/logger/layer.py\", line 14, in receive\n    self.toUpper(data)\n  File \"/var/www/html/yowsup/yowsup/layers/__init__.py\", line 79, in toUpper\n    self.__upper.receive(data)\n  File \"/var/www/html/yowsup/yowsup/layers/axolotl/layer_control.py\", line 35, in receive\n    self.toUpper(protocolTreeNode)\n  File \"/var/www/html/yowsup/yowsup/layers/__init__.py\", line 79, in toUpper\n    self.__upper.receive(data)\n  File \"/var/www/html/yowsup/yowsup/layers/__init__.py\", line 194, in receive\n    s.receive(data)\n  File \"/var/www/html/yowsup/yowsup/layers/axolotl/layer_receive.py\", line 35, in receive\n    self.toUpper(protocolTreeNode)\n  File \"/var/www/html/yowsup/yowsup/layers/__init__.py\", line 79, in toUpper\n    self.__upper.receive(data)\n  File \"/var/www/html/yowsup/yowsup/layers/__init__.py\", line 194, in receive\n    s.receive(data)\n  File \"/var/www/html/yowsup/yowsup/layers/__init__.py\", line 130, in receive\n    recv(node)\n  File \"/var/www/html/yowsup/yowsup/layers/auth/layer_authentication.py\", line 67, in handleStreamError\n    raise NotImplementedError(\"Unhandled stream:error node:\n%s\" % node)\nNotImplementedError: Unhandled stream:error node:\n<stream:error code=\"503\" />\n\nD 2020-04-24 01:05:52,235 yowsup.layers.network.dispatcher.dispatcher_asyncore - handle_close\nD 2020-04-24 01:05:52,235 yowsup.layers.network.layer - Disconnected",
  "deb": true
}

1 Ответ

0 голосов
/ 24 апреля 2020
Ошибка

503 часто означает, что сервер не может ответить в этот момент. Есть много причин для ошибки, но если вы просто хотите go выполнить запрос, вы можете получить оператор if, когда сервер возвращает ошибку 503, и немного повторить запрос, пока он не ответит 200 .

...