Example driver code don't work for me
See original GitHub issueI ran the example driver code and got TimeoutError
[9618:9655:0117/170740.834686:ERROR:browser_gpu_channel_host_factory.cc(108)] Failed to launch GPU process.
DEBUG:asyncio:Using selector: EpollSelector
INFO:chromewhip.chrome.ChromeTab:Connected to Chrome tab ws://127.0.0.1:9222/devtools/page/39cff3b7-fed6-43e6-90da-12e1b003f291
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Waiting for message...
INFO:chromewhip.chrome.ChromeTab:Connected to Chrome tab ws://127.0.0.1:9222/devtools/page/83a74865-c5c1-4453-b5cc-b798becc9c5a
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Waiting for message...
INFO:chromewhip.chrome.ChromeTab:Connected to Chrome tab ws://127.0.0.1:9222/devtools/page/e70f45a0-793c-4a20-a5ce-2fb2cf45837a
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Waiting for message...
INFO:chromewhip.chrome.ChromeTab:Connected to Chrome tab ws://127.0.0.1:9222/devtools/page/61dbddaf-a646-4aa3-98d0-7a242f27ec03
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Waiting for message...
INFO:chromewhip.chrome.ChromeTab:Connected to Chrome tab ws://127.0.0.1:9222/devtools/page/0780b1da-3bdb-42bd-aae9-762ca6fe95e2
DEBUG:chromewhip.chrome.Chrome:Connected to Chrome! Found 5 tabs
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Waiting for message...
INFO:chromewhip.chrome.ChromeTab.send_handler:Sending command = {"method": "Page.enable", "params": {}, "id": 1}
DEBUG:websockets.protocol:client >> Frame(fin=True, opcode=1, data=b'{"method": "Page.enable", "params": {}, "id": 1}')
DEBUG:chromewhip.chrome.ChromeTab.send_handler:Waiting for ack event set for id=1
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"id":1,"result":{}}')
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Received message, processing...
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Notifying ack event with id=1
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Waiting for message...
DEBUG:chromewhip.chrome.ChromeTab.send_handler:Received ack event set for id=1
INFO:chromewhip.chrome.ChromeTab.send_handler:Successfully sent command = {"method": "Page.enable", "params": {}, "id": 1}
INFO:chromewhip.chrome.ChromeTab.send_handler:Sending command = {"method": "Page.navigate", "params": {"url": "http://myip.dnsomatic.com/"}, "id": 2}
DEBUG:websockets.protocol:client >> Frame(fin=True, opcode=1, data=b'{"method": "Page.navigate", "params": {"url": "http://myip.dnsomatic.com/"}, "id": 2}')
DEBUG:chromewhip.chrome.ChromeTab.send_handler:Waiting for ack event set for id=2
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.frameStartedLoading","params":{"frameId":"9704.1"}}')
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Received message, processing...
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Received event message!
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Received a "Page.frameStartedLoading" event , storing against hash and name...
DEBUG:chromewhip.helpers:generated hash = Page.frameStartedLoading:frameId=9704.1
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Waiting for message...
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.lifecycleEvent","params":{"name":"commit","timestamp":197780.337573}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.frameNavigated","params":{"frame":{"id":"9704.1","loaderId":"9704.1","url":"http://myip.dnsomatic.com/","securityOrigin":"http://myip.dnsomatic.com","mimeType":"text/html"}}}')
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Received message, processing...
DEBUG:chromewhip.chrome.ChromeTab.recv_handler:Received event message!
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.loadEventFired","params":{"timestamp":197780.340161}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.lifecycleEvent","params":{"name":"load","timestamp":197780.340161}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.frameStoppedLoading","params":{"frameId":"9704.1"}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.domContentEventFired","params":{"timestamp":197780.348346}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.lifecycleEvent","params":{"name":"DOMContentLoaded","timestamp":197780.348346}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"id":2,"result":{"frameId":"9704.1"}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.lifecycleEvent","params":{"name":"firstPaint","timestamp":197780.39997}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.lifecycleEvent","params":{"name":"firstContentfulPaint","timestamp":197780.399986}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.lifecycleEvent","params":{"name":"firstTextPaint","timestamp":197780.399987}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.lifecycleEvent","params":{"name":"firstMeaningfulPaintCandidate","timestamp":197780.399988}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.lifecycleEvent","params":{"name":"networkAlmostIdle","timestamp":197780.880721}}')
DEBUG:websockets.protocol:client << Frame(fin=True, opcode=1, data=b'{"method":"Page.lifecycleEvent","params":{"name":"networkIdle","timestamp":197781.097418}}')
ERROR:chromewhip.chrome.ChromeTab.send_handler:{"method": "Page.navigate", "params": {"url": "http://myip.dnsomatic.com/"}, "id": 2}
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/chromewhip/chrome.py", line 167, in _send
await asyncio.wait_for(ack_event.wait(), timeout=TIMEOUT_S) # recv
File "/usr/lib/python3.6/asyncio/tasks.py", line 362, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/mouse/.PyCharmCE2017.1/config/scratches/scratch_25.py", line 32, in <module>
result = loop.run_until_complete(tab.send_command(cmd, await_on_event_type=await_on_event_type))
File "/usr/lib/python3.6/asyncio/base_events.py", line 467, in run_until_complete
return future.result()
File "/usr/local/lib/python3.6/dist-packages/chromewhip/chrome.py", line 264, in send_command
return await self._send(*command, input_event_cls=input_event_type, trigger_event_cls=await_on_event_type)
File "/usr/local/lib/python3.6/dist-packages/chromewhip/chrome.py", line 241, in _send
raise TimeoutError('Unknown cause for timeout to occurs for "%s" with id=%s' % (method, id_))
chromewhip.chrome.TimeoutError: Unknown cause for timeout to occurs for "Page.navigate" with id=2
ERROR:asyncio:Task exception was never retrieved
future: <Task finished coro=<ChromeTab.recv_handler() done, defined at /usr/local/lib/python3.6/dist-packages/chromewhip/chrome.py:71> exception=TypeError("LifecycleEventEvent unable to deserialise: __init__() missing 2 required positional arguments: 'frameId' and 'loaderId'",)>
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/chromewhip/helpers.py", line 91, in json_to_event
result = event_cls(**payload['params'])
TypeError: __init__() missing 2 required positional arguments: 'frameId' and 'loaderId'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/chromewhip/chrome.py", line 97, in recv_handler
event = helpers.json_to_event(result)
File "/usr/local/lib/python3.6/dist-packages/chromewhip/helpers.py", line 93, in json_to_event
raise TypeError('%s unable to deserialise: %s' % (event_cls.__name__, e))
TypeError: LifecycleEventEvent unable to deserialise: __init__() missing 2 required positional arguments: 'frameId' and 'loaderId'
Process finished with exit code 1
/usr/local/lib/python3.6/dist-packages/chromewhip/helpers.py
As you can see in debugger there is no frameId and loaderId in params and LifecycleEventEvent constructor needs it!
Is that an error in chromewhip or i understand something wrong? This error also arrised when using docker and http api.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Error codes in Device Manager in Windows - Microsoft Support
Lists the error codes that may be reported by Device Manager and the possible resolutions in Windows.
Read more >13 Methods to Fix This Device Cannot Start (code 10) Error
Code10 occurs when the Device Manager fails to start the hardware device. It generally points out that corrupted or unspecified drivers or faulty...
Read more >Driver Development Part 1: Introduction to Drivers - CodeProject
This article will go into the basics of creating a simple driver.
Read more >Doordash Promo Code Not Working: 5 Reasons Why And Fixes
Indeed, promo codes and discounts can affect consumer behavior. For example, a consumer may be more likely to try a new local restaurant...
Read more >[Solved] NVIDIA Code 43: Windows has stopped this device ...
Method #03 worked for me. Thanks for sharing this tip. Noel Toro • 3 years ago. The easy driver fixed it. Not sure...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@andreymeretsky I’ve been able to recreate error in my Docker container (works fine locally under MacOS), will let you know how I go.
I think the Docker Error might be that you never start Chrome. This causes it to time out while connecting to the remote debug port. This is fixed by you having Chrome running locally with --remote-debug-port=9222 as per the readme.