alfred82santa / whalesong

Whalesong is an asyncio python library to manage WebApps remotely. Currently WhatsappWeb is implemented
https://whalesong.readthedocs.io
MIT License
50 stars 19 forks source link

ManagerNotFound: Manager messages not found #121

Closed gladimaz closed 4 years ago

gladimaz commented 4 years ago
Monitor stream

Stream: Stream.DISCONNECTED
State: State.UNLAUNCHED
Stream value: Stream.DISCONNECTED
Stream value: Stream.SYNCING
Stream value: Stream.CONNECTED
Monitor new messages
Monitor message ack
Task exception was never retrieved
future: <Task finished coro=<GetMessages.monitor_new_messages() done, defined at bots/s****/s****.py:81> exception=ManagerNotFound('Manager messages not found',)>
Traceback (most recent call last):
  File "bots/s*****/s*****.py", line 83, in monitor_new_messages
    async for message in it:
  File "/home/*****/whalesong/whalesong/results.py", line 195, in __anext__
    evt: T = await super(MonitorResult, self).__anext__()
  File "/home/****/whalesong/whalesong/results.py", line 137, in __anext__
    raise item
whalesong.errors.ManagerNotFound: Manager messages not found
Task exception was never retrieved
future: <Task finished coro=<GetMessages.monitor_message_acks() done, defined at bots/s*****/s****.py:95> exception=ManagerNotFound('Manager messages not found',)>
Traceback (most recent call last):
  File "bots/s****/s*****.py", line 97, in monitor_message_acks
    async for ack in it
  File "/home/****/whalesong/whalesong/results.py", line 195, in __anext__
    evt: T = await super(MonitorResult, self).__anext__()
  File "/home/****/whalesong/whalesong/results.py", line 137, in __anext__
    raise item
whalesong.errors.ManagerNotFound: Manager messages not found

Today i have this issue. Whatsapp updates code?

gladimaz commented 4 years ago

@alfred82santa help

jesusvalverde commented 4 years ago

Same here :-(

gladimaz commented 4 years ago

i have just solved this problem, i just increase the wait time in driver_firefox.py (await sleep(1) to 20) at line 107 and 115.

jesusvalverde commented 4 years ago

not all the time... some reboot may work , some not :-(

victorriba commented 4 years ago

i have just solved this problem, i just increase the wait time in driver_firefox.py (await sleep(1) to 20) at line 107 and 115.

it work thanks

async def connect(self):
    await self._run_async(self.driver.get, self._URL)
    self.result_manager.cancel_all()
    await sleep(20)
    await self.run_scriptlet()
    self._fut_running = Future()
    self._fut_polling = ensure_future(self._polling())

async def refresh(self):
    await self._run_async(self.driver.refresh)
    self.result_manager.cancel_all()
    await sleep(20)
    await self.run_scriptlet()
dafner commented 4 years ago

I made the suggested changes but the problem persists Any idea how to fix it?

Task exception was never retrieved future: <Task finished coro=<WeBot.monitor_new_messages() done, defined at /home/administrador/workspace/whatsappx/webot/itas/webot/init.py:261> exception=ManagerNotFound('Manager messages not found',)> Traceback (most recent call last): File "/home/administrador/workspace/whatsappx/webot/itas/webot/init.py", line 278, in monitor_new_messages async for message in it: File "/home/administrador/workspace/whatsappx/webot/itas/whalesong/results.py", line 195, in anext evt: T = await super(MonitorResult, self).anext() File "/home/administrador/workspace/whatsappx/webot/itas/whalesong/results.py", line 137, in anext raise item whalesong.errors.ManagerNotFound: Manager messages not found

dafner commented 4 years ago

I confirm that the problem occurs in both firefox and chrome

dafner commented 4 years ago

I was testing other examples and found that, for example; The statemonitor.py demo has problems with other managers, not just messages.

I will appreciate a prompt solution to this problem

administrador@ubuntu:~/workspace/whalesong$ PYTHONPATH=.:$PYTHONPATH python3 examples/statemonitor.py Monitor stream Monitor state Monitor ref Monitor battery Monitor storage Task exception was never retrieved future: <Task finished coro=<StatusMonitor.check_conn() done, defined at examples/statemonitor.py:33> exception=ManagerNotFound('Manager conn not found',)> Traceback (most recent call last): File "examples/statemonitor.py", line 34, in check_conn stream = await self._driver.conn.get_model() whalesong.errors.ManagerNotFound: Manager conn not found Task exception was never retrieved future: <Task finished coro=<StatusMonitor.monitor_ref() done, defined at examples/statemonitor.py:64> exception=ManagerNotFound('Manager conn not found',)> Traceback (most recent call last): File "examples/statemonitor.py", line 66, in monitor_ref async for evt in self._driver.conn.monitor_field('ref'): File "/home/administrador/workspace/whalesong/examples/whalesong/results.py", line 195, in anext evt: T = await super(MonitorResult, self).anext() File "/home/administrador/workspace/whalesong/examples/whalesong/results.py", line 137, in anext raise item whalesong.errors.ManagerNotFound: Manager conn not found Task exception was never retrieved future: <Task finished coro=<StatusMonitor.monitor_battery() done, defined at examples/statemonitor.py:79> exception=ManagerNotFound('Manager conn not found',)> Traceback (most recent call last): File "examples/statemonitor.py", line 81, in monitor_battery async for evt in self._driver.conn.monitor_field('battery'): File "/home/administrador/workspace/whalesong/examples/whalesong/results.py", line 195, in anext evt: T = await super(MonitorResult, self).anext() File "/home/administrador/workspace/whalesong/examples/whalesong/results.py", line 137, in anext raise item whalesong.errors.ManagerNotFound: Manager conn not found Stream: Stream.DISCONNECTED State: State.UNPAIRED

gladimaz commented 4 years ago

i think u should increse sleep to 60 or higher

dafner commented 4 years ago

thanks gladimaz for your help!! It's working again. I tried differents values and the best result was setting the delay in 90 seconds

For now, It's working only with firefox driver

vasani-arpit commented 4 years ago

It should be based on time. I don't know much about python but it should be based on selector.

basically, Script/python will wait until it sees "keep your phone connected" or some selector which indicates that the loading process is complete.

yoeliguzman commented 4 years ago

Hello dear folks;

after change sleep value i got the following issue:

2019-10-07 23:25:07,638 ERROR Task exception was never retrieved future: <Task finished coro=<BaseWhalesongDriver.start_driver() done, defined at /usr/local/lib/python3.6/dist-packages/whalesong/driver.py:41> exception=WebDriverException('connection refused', None, None)> Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/whalesong/driver.py", line 53, in start_driver await self._fut_start File "/usr/local/lib/python3.6/dist-packages/whalesong/driver_firefox.py", line 76, in _internal_start_driver self.driver = await self._run_async(self._internal_start_driver_sync) File "/usr/local/lib/python3.6/dist-packages/whalesong/driver_firefox.py", line 73, in _run_async return await self.loop.run_in_executor(self._pool_executor, partial(method, *args, *kwargs)) File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(self.args, self.kwargs) File "/usr/local/lib/python3.6/dist-packages/whalesong/driver_firefox.py", line 98, in _internal_start_driver_sync self.options['extra_params']) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/firefox/webdriver.py", line 174, in init keep_alive=True) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: connection refused

victorriba commented 4 years ago

same problem

monitor.loop.run_until_complete(monitor.start())

File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete return future.result() File "/home/whalesong/examples/statemonitor.py", line 90, in start await self._driver.start() File "/usr/local/lib/python3.6/site-packages/whalesong/init.py", line 95, in start await self._driver.start_driver() File "/usr/local/lib/python3.6/site-packages/whalesong/driver.py", line 49, in start_driver await self._fut_start File "/usr/local/lib/python3.6/site-packages/whalesong/driver.py", line 53, in start_driver await self._fut_start File "/usr/local/lib/python3.6/site-packages/whalesong/driver_firefox.py", line 76, in _internal_start_driver self.driver = await self._run_async(self._internal_start_driver_sync) File "/usr/local/lib/python3.6/site-packages/whalesong/driver_firefox.py", line 73, in _run_async return await self.loop.run_in_executor(self._pool_executor, partial(method, *args, *kwargs)) File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(self.args, self.kwargs) File "/usr/local/lib/python3.6/site-packages/whalesong/driver_firefox.py", line 98, in _internal_start_driver_sync self.options['extra_params']) File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in init keep_alive=True) File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: connection refused

victorriba commented 4 years ago

statemonitor not work

victorriba commented 4 years ago

npm install --devDependencies npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN @babel/plugin-syntax-class-properties@7.2.0 requires a peer of @babel/core@^7.0.0-0 but none was installed. npm WARN whalesong@0.1.0 No repository field.

shmosta commented 4 years ago

FWIW I too have been running into the same problem as of late. Tried changing the aforementioned sleep call args to 10, 20, 30, 60, 90, 100, and still no luck. Any tips/hints or ideas for a workaround are greatly appreciated. Let me know if there's anything I can do to help, thanks!

shmosta commented 4 years ago

thanks gladimaz for your help!! It's working again. I tried differents values and the best result was setting the delay in 90 seconds

For now, It's working only with firefox driver

@dafner Is it still working for you? @alfred82santa any ideas on how to fix this or if you have time to do as much? Thanks all.

victorriba commented 4 years ago

thanks gladimaz for your help!! It's working again. I tried differents values and the best result was setting the delay in 90 seconds For now, It's working only with firefox driver

@dafner Is it still working for you? @alfred82santa any ideas on how to fix this or if you have time to do as much? Thanks all.

i can help you ws plus 573505620505