Skip to content

UnhandledProtocolError: Failed to fetch reports: NoneΒ #185

@malmeloo

Description

@malmeloo

As of recently, you may occasionally run into the following error:

Traceback (most recent call last):
  File "/home/mike/Projects/FindMy.py/examples/airtag.py", line 61, in <module>
    sys.exit(main(args.airtag_path))
             ~~~~^^^^^^^^^^^^^^^^^^
  File "/home/mike/Projects/FindMy.py/examples/airtag.py", line 43, in main
    location = acc.fetch_location(airtag)
  File "/home/mike/Projects/FindMy.py/findmy/reports/account.py", line 1171, in fetch_location
    hist = self.fetch_location_history(keys)
  File "/home/mike/Projects/FindMy.py/findmy/reports/account.py", line 1139, in fetch_location_history
    return self._evt_loop.run_until_complete(coro)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/mike/.local/share/uv/python/cpython-3.13.2-linux-x86_64-gnu/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/home/mike/Projects/FindMy.py/findmy/reports/account.py", line 735, in fetch_location_history
    return await self._reports.fetch_location_history(keys)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mike/Projects/FindMy.py/findmy/reports/reports.py", line 387, in fetch_location_history
    return await self._fetch_accessory_reports(device, only_latest=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mike/Projects/FindMy.py/findmy/reports/reports.py", line 481, in _fetch_accessory_reports
    ret |= await _fetch()
           ^^^^^^^^^^^^^^
  File "/home/mike/Projects/FindMy.py/findmy/reports/reports.py", line 440, in _fetch
    new_reports: list[LocationReport] = await self._account.fetch_raw_reports(
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        [(list(cur_keys_primary), (list(cur_keys_secondary)))]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/mike/Projects/FindMy.py/findmy/reports/account.py", line 692, in fetch_raw_reports
    raise UnhandledProtocolError(msg)
findmy.errors.UnhandledProtocolError: Failed to fetch reports: None

This appears to be caused by a change on Apple's side. As of v0.9.3, FindMy.py will automatically re-fire the request if it detects this error. However, this is very much a band-aid fix; the real underlying issue has not been identified yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions