Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR Exception in callback _SelectorDatagramTransport._read_ready() handle #38

Open
nix1016 opened this issue Feb 22, 2024 · 5 comments

Comments

@nix1016
Copy link

nix1016 commented Feb 22, 2024

Getting this error after giving pairing consent. Anyone got any ideas?

[(.venv) nix1016 ~/Projects/Other/kinesis [main]$ sudo python3 main.py           
2024-02-22 17:56:49 nix1016-MacBook-Pro pymobiledevice3.remote.core_device_tunnel_service[81416] INFO Waiting user pairing consent
2024-02-22 17:57:12 nix1016-MacBook-Pro asyncio[81416] ERROR Exception in callback _SelectorDatagramTransport._read_ready()
handle: <Handle _SelectorDatagramTransport._read_ready()>
Traceback (most recent call last):
  File "/Users/nix1016.pyenv/versions/3.11.7/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/Users/nix1016/.pyenv/versions/3.11.7/lib/python3.11/asyncio/selector_events.py", line 1169, in _read_ready
    self._protocol.datagram_received(data, addr)
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/qh3/asyncio/protocol.py", line 135, in datagram_received
    self._quic.receive_datagram(cast(bytes, data), addr, now=self._loop.time())
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/qh3/quic/connection.py", line 1026, in receive_datagram
    is_ack_eliciting, is_probing = self._payload_received(
                                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/qh3/quic/connection.py", line 2334, in _payload_received
    frame_handler(context, frame_type, buf)
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/qh3/quic/connection.py", line 1554, in _handle_crypto_frame
    self.tls.handle_message(event.data, self._crypto_buffers)
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/qh3/tls.py", line 1494, in handle_message
    self._client_handle_hello(input_buf, output_buf[Epoch.INITIAL])
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/qh3/tls.py", line 1716, in _client_handle_hello
    self._setup_traffic_protection(
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/qh3/tls.py", line 2196, in _setup_traffic_protection
    self.update_traffic_key_cb(
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/qh3/quic/connection.py", line 2637, in _update_traffic_key
    secrets_log_file.write(
    ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: '_RSAPrivateKey' object has no attribute 'write'
Traceback (most recent call last):
  File "/Users/nix1016/Projects/Other/kinesis/main.py", line 84, in <module>
    create_tunnel()
  File "/Users/nix1016/Projects/Other/kinesis/main.py", line 79, in create_tunnel
    asyncio.run(start_quic_tunnel(rsd))
  File "/Users/nix1016/.pyenv/versions/3.11.7/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/Users/nix1016/.pyenv/versions/3.11.7/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nix1016/.pyenv/versions/3.11.7/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/nix1016/Projects/Other/kinesis/main.py", line 53, in start_quic_tunnel
    async with service.start_quic_tunnel(private_key) as tunnel_result:
  File "/Users/nix1016/.pyenv/versions/3.11.7/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/pymobiledevice3/remote/core_device_tunnel_service.py", line 349, in start_quic_tunnel
    async with aioquic_connect(
  File "/Users/nix1016/.pyenv/versions/3.11.7/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/qh3/asyncio/client.py", line 97, in connect
    await protocol.wait_connected()
  File "/Users/nix1016/.venv/lib/python3.11/site-packages/qh3/asyncio/protocol.py", line 127, in wait_connected
    await asyncio.shield(self._connected_waiter)
ConnectionError

@nix1016 nix1016 changed the title KeyError: EnumIntegerString.new(3, 'PUBLIC_KEY') ERROR Exception in callback _SelectorDatagramTransport._read_ready() handle Feb 22, 2024
@Dre-Van-den-Hooff
Copy link

Exact same problem here.

@iiiyu
Copy link

iiiyu commented Feb 29, 2024

I got the same problem. Do you have any update?

@nix1016
Copy link
Author

nix1016 commented Feb 29, 2024

Yeah if you change pymobiledevice3 from 2.18.1 to 2.30.1 in requirements.txt, and rerun pip install -r requirements it should work.

@iiiyu
Copy link

iiiyu commented Feb 29, 2024

Yeah if you change pymobiledevice3 from 2.18.1 to 2.30.1 in requirements.txt, and rerun pip install -r requirements it should work.

Thanks for your reply.

Actually, I wanted to quickly update my iPhone's location, so I spent time studying pymobiledevice3. Now I can use two sample commands to accomplish it.

sudo pymobiledevice3 remote start-tunnel

pymobiledevice3 developer dvt simulate-location set --rsd HOST PORT -- x y

@chikiball
Copy link

I downgraded my pymobiledevice3 from 2.46.1 to 2.30.1 and now it is working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants