Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

MacOS JUMPSTARTER_HOST socket disconnects on shell. #444

@mangelajo

Description

@mangelajo

On MacOS, when using a jumpstarter shell the JUMPSTARTER_HOST socket disappears,

the first j commands will work, but suddenly the socket goes away and any further usage becomes impossible.

Example error:

(jumpstarter) ➜  jumpstarter git:(driver_android) ✗ jmp shell --client-config ~/.config/jumpstarter/clients/android-client.yaml -l type=emulator
INFO:jumpstarter.client.lease:Created lease request for selector type=emulator for duration 0:30:00
~/repos/jumpstarter ⚡local ➤ j
Usage: j [OPTIONS] COMMAND [ARGS]...

  Generic composite device

Options:
  --help  Show this message and exit.

Commands:
  connect  Generic composite device
~/repos/jumpstarter ⚡local ➤ j connect
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/kirk/repos/jumpstarter/.venv/bin/j:10 in <module>                                         │
│                                                                                                  │
│    7 │   │   sys.argv[0] = sys.argv[0][:-11]                                                     │
│    8 │   elif sys.argv[0].endswith(".exe"):                                                      │
│    9 │   │   sys.argv[0] = sys.argv[0][:-4]                                                      │
│ ❱ 10 │   sys.exit(j())                                                                           │
│   11                                                                                             │
│                                                                                                  │
│ /Users/kirk/repos/jumpstarter/packages/jumpstarter-cli/jumpstarter_cli/j.py:10 in j              │
│                                                                                                  │
│    7                                                                                             │
│    8                                                                                             │
│    9 def j():                                                                                    │
│ ❱ 10 │   with env() as client:                                                                   │
│   11 │   │                                                                                       │
│   12 │   │   @handle_exceptions                                                                  │
│   13 │   │   def cli():                                                                          │
│                                                                                                  │
│ /Users/kirk/.local/share/uv/python/cpython-3.12.3-macos-aarch64-none/lib/python3.12/contextlib.p │
│ y:137 in __enter__                                                                               │
│                                                                                                  │
│   134 │   │   # they are only needed for recreation, which is not possible anymore               │
│   135 │   │   del self.args, self.kwds, self.func                                                │
│   136 │   │   try:                                                                               │
│ ❱ 137 │   │   │   return next(self.gen)                                                          │
│   138 │   │   except StopIteration:                                                              │
│   139 │   │   │   raise RuntimeError("generator didn't yield") from None                         │
│   140                                                                                            │
│                                                                                                  │
│ /Users/kirk/repos/jumpstarter/packages/jumpstarter/jumpstarter/utils/env.py:43 in env            │
│                                                                                                  │
│   40 │   """                                                                                     │
│   41 │   with start_blocking_portal() as portal:                                                 │
│   42 │   │   with ExitStack() as stack:                                                          │
│ ❱ 43 │   │   │   with portal.wrap_async_context_manager(env_async(portal, stack)) as client:     │
│   44 │   │   │   │   yield client                                                                │
│   45                                                                                             │
│                                                                                                  │
│ /Users/kirk/repos/jumpstarter/.venv/lib/python3.12/site-packages/anyio/from_thread.py:124 in     │
│ __enter__                                                                                        │
│                                                                                                  │
│   121 │   def __enter__(self) -> T_co:                                                           │
│   122 │   │   self._enter_future = Future()                                                      │
│   123 │   │   self._exit_future = self._portal.start_task_soon(self.run_async_cm)                │
│ ❱ 124 │   │   return self._enter_future.result()                                                 │
│   125 │                                                                                          │
│   126 │   def __exit__(                                                                          │
│   127 │   │   self,                                                                              │
│                                                                                                  │
│ /Users/kirk/.local/share/uv/python/cpython-3.12.3-macos-aarch64-none/lib/python3.12/concurrent/f │
│ utures/_base.py:456 in result                                                                    │
│                                                                                                  │
│   453 │   │   │   │   if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:                     │
│   454 │   │   │   │   │   raise CancelledError()                                                 │
│   455 │   │   │   │   elif self._state == FINISHED:                                              │
│ ❱ 456 │   │   │   │   │   return self.__get_result()                                             │
│   457 │   │   │   │   else:                                                                      │
│   458 │   │   │   │   │   raise TimeoutError()                                                   │
│   459 │   │   finally:                                                                           │
│                                                                                                  │
│ /Users/kirk/.local/share/uv/python/cpython-3.12.3-macos-aarch64-none/lib/python3.12/concurrent/f │
│ utures/_base.py:401 in __get_result                                                              │
│                                                                                                  │
│   398 │   def __get_result(self):                                                                │
│   399 │   │   if self._exception:                                                                │
│   400 │   │   │   try:                                                                           │
│ ❱ 401 │   │   │   │   raise self._exception                                                      │
│   402 │   │   │   finally:                                                                       │
│   403 │   │   │   │   # Break a reference cycle with the exception in self._exception            │
│   404 │   │   │   │   self = None                                                                │
│                                                                                                  │
│ /Users/kirk/repos/jumpstarter/.venv/lib/python3.12/site-packages/anyio/from_thread.py:221 in     │
│ _call_func                                                                                       │
│                                                                                                  │
│   218 │   │   │   │   │   else:                                                                  │
│   219 │   │   │   │   │   │   future.add_done_callback(callback)                                 │
│   220 │   │   │   │   │                                                                          │
│ ❱ 221 │   │   │   │   │   retval = await retval_or_awaitable                                     │
│   222 │   │   │   else:                                                                          │
│   223 │   │   │   │   retval = retval_or_awaitable                                               │
│   224 │   │   except self._cancelled_exc_class:                                                  │
│                                                                                                  │
│ /Users/kirk/repos/jumpstarter/.venv/lib/python3.12/site-packages/anyio/from_thread.py:101 in     │
│ run_async_cm                                                                                     │
│                                                                                                  │
│    98 │   async def run_async_cm(self) -> bool | None:                                           │
│    99 │   │   try:                                                                               │
│   100 │   │   │   self._exit_event = Event()                                                     │
│ ❱ 101 │   │   │   value = await self._async_cm.__aenter__()                                      │
│   102 │   │   except BaseException as exc:                                                       │
│   103 │   │   │   self._enter_future.set_exception(exc)                                          │
│   104 │   │   │   raise                                                                          │
│                                                                                                  │
│ /Users/kirk/.local/share/uv/python/cpython-3.12.3-macos-aarch64-none/lib/python3.12/contextlib.p │
│ y:210 in __aenter__                                                                              │
│                                                                                                  │
│   207 │   │   # they are only needed for recreation, which is not possible anymore               │
│   208 │   │   del self.args, self.kwds, self.func                                                │
│   209 │   │   try:                                                                               │
│ ❱ 210 │   │   │   return await anext(self.gen)                                                   │
│   211 │   │   except StopAsyncIteration:                                                         │
│   212 │   │   │   raise RuntimeError("generator didn't yield") from None                         │
│   213                                                                                            │
│                                                                                                  │
│ /Users/kirk/repos/jumpstarter/packages/jumpstarter/jumpstarter/utils/env.py:26 in env_async      │
│                                                                                                  │
│   23 │                                                                                           │
│   24 │   allow, unsafe = _allow_from_env()                                                       │
│   25 │                                                                                           │
│ ❱ 26 │   async with client_from_path(host, portal, stack, allow=allow, unsafe=unsafe) as clie    │
│   27 │   │   try:                                                                                │
│   28 │   │   │   yield client                                                                    │
│   29 │   │   finally:                                                                            │
│                                                                                                  │
│ /Users/kirk/.local/share/uv/python/cpython-3.12.3-macos-aarch64-none/lib/python3.12/contextlib.p │
│ y:210 in __aenter__                                                                              │
│                                                                                                  │
│   207 │   │   # they are only needed for recreation, which is not possible anymore               │
│   208 │   │   del self.args, self.kwds, self.func                                                │
│   209 │   │   try:                                                                               │
│ ❱ 210 │   │   │   return await anext(self.gen)                                                   │
│   211 │   │   except StopAsyncIteration:                                                         │
│   212 │   │   │   raise RuntimeError("generator didn't yield") from None                         │
│   213                                                                                            │
│                                                                                                  │
│ /Users/kirk/repos/jumpstarter/packages/jumpstarter/jumpstarter/client/client.py:20 in            │
│ client_from_path                                                                                 │
│                                                                                                  │
│   17 │   async with grpc.aio.secure_channel(                                                     │
│   18 │   │   f"unix://{path}", grpc.local_channel_credentials(grpc.LocalConnectionType.UDS)      │
│   19 │   ) as channel:                                                                           │
│ ❱ 20 │   │   yield await client_from_channel(channel, portal, stack, allow, unsafe)              │
│   21                                                                                             │
│   22                                                                                             │
│   23 async def client_from_channel(                                                              │
│                                                                                                  │
│ /Users/kirk/repos/jumpstarter/packages/jumpstarter/jumpstarter/client/client.py:35 in            │
│ client_from_channel                                                                              │
│                                                                                                  │
│   32 │   reports = {}                                                                            │
│   33 │   clients = OrderedDict()                                                                 │
│   34 │                                                                                           │
│ ❱ 35 │   response = await jumpstarter_pb2_grpc.ExporterServiceStub(channel).GetReport(empty_p    │
│   36 │                                                                                           │
│   37 │   for index, report in enumerate(response.reports):                                       │
│   38 │   │   topo[index] = []                                                                    │
│                                                                                                  │
│ /Users/kirk/repos/jumpstarter/.venv/lib/python3.12/site-packages/grpc/aio/_call.py:327 in        │
│ __await__                                                                                        │
│                                                                                                  │
│   324 │   │   │   if self._cython_call.is_locally_cancelled():                                   │
│   325 │   │   │   │   raise asyncio.CancelledError()                                             │
│   326 │   │   │   else:                                                                          │
│ ❱ 327 │   │   │   │   raise _create_rpc_error(                                                   │
│   328 │   │   │   │   │   self._cython_call._initial_metadata,                                   │
│   329 │   │   │   │   │   self._cython_call._status,                                             │
│   330 │   │   │   │   )                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AioRpcError: <AioRpcError of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "failed to connect to all addresses; last error: UNKNOWN: unix:/var/folders/15/p1257h091bq1yvxskc1j9lv00000gn/T/jumpstarter-enb7hobw/socket: 
connect: No such file or directory (2)"
        debug_error_string = "UNKNOWN:Error received from peer  {grpc_message:"failed to connect to all addresses; last error: UNKNOWN: 
unix:/var/folders/15/p1257h091bq1yvxskc1j9lv00000gn/T/jumpstarter-enb7hobw/socket: connect: No such file or directory (2)", grpc_status:14, 
created_time:"2025-05-05T10:30:08.336914-04:00"}"

Metadata

Metadata

Labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions