ekonda / sketal

Бот для ВКонтакте. Беседы / группы / развлечения.
MIT License
119 stars 64 forks source link

Can't do in VPS, VDS... #77

Closed zaborshikov closed 6 years ago

zaborshikov commented 6 years ago

Бот должен был запуститься VDS

Бот не запустился, а точнее загрузился немножечко и выдал кучу ошибок. Результат:

bot.py [17.11.23 04:28:38] INFO : Initializing bot bot.py [17.11.23 04:28:38] INFO : Initializing vk clients --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.6/logging/__init__.py", line 994, in emit stream.write(msg) UnicodeEncodeError: 'ascii' codec can't encode characters in position 55-57: ord inal not in range(128) Call stack: File "bot.py", line 391, in <module> bot = Bot(BotSettings) File "bot.py", line 42, in __init__ self.api = VkController(settings, logger=self.logger) File "/home/sketal/vk_plus.py", line 48, in __init__ loop.run_until_complete(self.init_vk()) File "/usr/lib/python3.6/asyncio/base_events.py", line 454, in run_until_compl ete self.run_forever() File "/usr/lib/python3.6/asyncio/base_events.py", line 421, in run_forever self._run_once() File "/usr/lib/python3.6/asyncio/base_events.py", line 1426, in _run_once handle._run() File "/usr/lib/python3.6/asyncio/events.py", line 127, in _run self._callback(*self._args) File "/home/sketal/vk_plus.py", line 66, in init_vk await client.group(user[1]) File "/home/sketal/vk_api.py", line 245, in group self.logger.info(f"Logged in as: {self_data['name']} ({address})") Message: 'Logged in as: \u0411\u043e\u0442 \u0422\u0451\u043c\u0430 0.1.5 BETA b y Zabarshikov! (https://vk.com/bot.tema)' Arguments: () vk_api.py [17.11.23 04:28:38] INFO : Logged in as: \u0411\u043e\u0442 \u0422 \u0451\u043c\u0430 0.1.5 BETA by Zabarshikov! (https://vk.com/bot.tema) --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.6/logging/__init__.py", line 994, in emit stream.write(msg) UnicodeEncodeError: 'ascii' codec can't encode characters in position 55-59: ord inal not in range(128) Call stack: File "bot.py", line 391, in <module> bot = Bot(BotSettings) File "bot.py", line 42, in __init__ self.api = VkController(settings, logger=self.logger) File "/home/sketal/vk_plus.py", line 48, in __init__ loop.run_until_complete(self.init_vk()) File "/usr/lib/python3.6/asyncio/base_events.py", line 454, in run_until_compl ete self.run_forever() File "/usr/lib/python3.6/asyncio/base_events.py", line 421, in run_forever self._run_once() File "/usr/lib/python3.6/asyncio/base_events.py", line 1426, in _run_once handle._run() File "/usr/lib/python3.6/asyncio/events.py", line 127, in _run self._callback(*self._args) File "/home/sketal/vk_plus.py", line 80, in init_vk await client.user(user[1], user[2], self.app_id, self.scope) File "/home/sketal/vk_api.py", line 221, in user await self.user_with_token(self.token) File "/home/sketal/vk_api.py", line 200, in user_with_token self.logger.info(f"Logged in as: {self_data['first_name']} {self_data['last_ name']} " Message: 'Logged in as: \u0410\u0440\u0442\u0451\u043c \u0417\u0430\u0431\u043e\ u0440\u0449\u0438\u043a\u043e\u0432 (https://vk.com/id294743794)' Arguments: () vk_api.py [17.11.23 04:28:39] INFO : Logged in as: \u0410\u0440\u0442\u0451\ u043c \u0417\u0430\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u0432 (https://vk.c om/id294743794) bot.py [17.11.23 04:28:39] INFO : Loading plugins sayer.py [17.11.23 04:28:39] WARNING : You are using public key for Speechkit Cloud! Get your own: https://tech.yandex.ru/speechkit/cloud/ chatter.py [17.11.23 04:28:39] INFO : Loading scripts for ChatterPlugin... Traceback (most recent call last): File "bot.py", line 391, in <module> bot = Bot(BotSettings) File "bot.py", line 50, in __init__ self.handler.initiate_plugins() File "/home/sketal/handler/handler_controller.py", line 26, in initiate_plugin s plugin.initiate() File "/home/sketal/plugins/chatter/chatter.py", line 55, in initiate result = self.read_plugin(root + os.sep + f) File "/home/sketal/plugins/chatter/chatter.py", line 291, in read_plugin for no, li in enumerate(cont): File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 2: ordinal not in range(128) Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x2b7edaf92630> Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x2b7edaf928d0> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x2b7ed94e01d0> , 42454.876281133)]'] connector: <aiohttp.connector.TCPConnector object at 0x2b7edaf92668> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x2b7edbabcc50> , 42455.49606575)]'] connector: <aiohttp.connector.TCPConnector object at 0x2b7edaf92908>

Повторить ошибку можно запустив бота на VDS, VPS и т. п., с ubuntu 16.04 LTS с помощью команды python 3.6 bot.py

Использовался python 3.6.2, VDS: https://firstvds.ru/products/vds_vps_cheap. При том на ПК работает

ghost commented 6 years ago

Попробуйте изменить системную кодировку на VPS на UTF8

zaborshikov commented 6 years ago

Как??? Я просто с Linux и Ubuntu не очень дружу)

ghost commented 6 years ago

@ZaArTa мы тут не оказывает поддержки с VPS/VDS, уж извините.

zaborshikov commented 6 years ago

Хорошо. Но я сменил, бесполезно