Skip to content

Marimo ignores ctrl-c when running with --sandbox on Windows #4842

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

Open
1 task
daviewales opened this issue May 8, 2025 · 2 comments
Open
1 task

Marimo ignores ctrl-c when running with --sandbox on Windows #4842

daviewales opened this issue May 8, 2025 · 2 comments
Labels
bug Something isn't working platform:windows

Comments

@daviewales
Copy link

daviewales commented May 8, 2025

Describe the bug

I ran marimo edit --sandbox example.py in PowerShell on Windows. (Fresh file)

Sometimes ctrl-c works.
Sometimes it is completely ignored.
Sometimes when I cancel quit with 'n' the kernel dies.

I've looked at the previous issues relating to ctrl-c, but they are closed.
I've installed the latest versions of Marimo and uv.

The following screenshot shows the initial run, where the ctrl-c worked, then the I selected 'n', then the kernel died. Then it shows the second run where ctrl-c never worked:

Image

This is the debug log from cancelling the exit (ctrl-c, then 'n'), which leads to the kernel crashing:

[D 250508 16:18:26 runtime:1325] Finished run.
[D 250508 16:18:26 runtime:2093] Handled control request: ExecuteMultipleRequest(cells=1)
INFO:     127.0.0.1:56410 - "POST /api/kernel/sync/cell_ids HTTP/1.1" 200 OK
[D 250508 16:18:27 file_manager:135] Saving app to C:\Users\dwales\example.py
INFO:     127.0.0.1:56410 - "POST /api/kernel/save HTTP/1.1" 200 OK
[D 250508 16:18:29 handlers:26] Interrupt request received
[D 250508 16:18:29 runtime:2674] kernel queue.get() failed [Errno 4] Interrupted function call
        Are you sure you want to quit? (y/n): n
[D 250508 16:18:31 sessions:525] Closing session C:\Users\dwales\example.py because kernel died

        The Python kernel for file C:\Users\dwales\example.py died unexpectedly.

[D 250508 16:18:31 ws:735] Websocket terminated with CancelledError
INFO:     127.0.0.1:56410 - "GET /api/usage HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\middleware\errors.py", line 187, in __call__
    raise exc
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\middleware\errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\marimo\_server\api\auth.py", line 219, in __call__
    return await super().__call__(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\middleware\sessions.py", line 85, in __call__
    await self.app(scope, receive, send_wrapper)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\middleware\base.py", line 176, in __call__
    with recv_stream, send_stream, collapse_excgroups():
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\_utils.py", line 82, in collapse_excgroups
    raise exc
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\middleware\base.py", line 178, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\marimo\_server\api\middleware.py", line 168, in dispatch
    return await call_next(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\middleware\base.py", line 156, in call_next
    raise app_exc
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\middleware\base.py", line 141, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\marimo\_server\api\auth.py", line 250, in __call__
    await super().__call__(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\middleware\authentication.py", line 48, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\marimo\_server\api\auth.py", line 239, in wrapped_app
    await app(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\middleware\cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\marimo\_server\api\middleware.py", line 99, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\marimo\_server\api\middleware.py", line 381, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\marimo\_server\api\middleware.py", line 381, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\marimo\_server\api\middleware.py", line 381, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\middleware\exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\routing.py", line 714, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\routing.py", line 734, in app
    await route.handle(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\routing.py", line 460, in handle
    await self.app(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\routing.py", line 714, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\routing.py", line 734, in app
    await route.handle(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\routing.py", line 73, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\marimo\_server\router.py", line 108, in wrapper_func
    response = await response
               ^^^^^^^^^^^^^^
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\starlette\authentication.py", line 75, in async_wrapper
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\marimo\_server\api\endpoints\health.py", line 215, in usage
    kernel_process = psutil.Process(session.kernel_manager.kernel_task.pid)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\psutil\__init__.py", line 317, in __init__
    self._init(pid)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\6zd4X2lMTJWJtgw6m4s0n\Lib\site-packages\psutil\__init__.py", line 363, in _init
    raise NoSuchProcess(pid, msg=msg) from None
psutil.NoSuchProcess: process PID not found (pid=39960)
INFO:     connection closed
[D 250508 16:18:32 middleware:373] Done with websocket proxy for ws://localhost:3119/lsp/pylsp
INFO:     connection closed

I've tried running it in debug mode, but this yields a new error:

--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\logging\__init__.py", line 1163, in emit
    stream.write(msg + self.terminator)
OSError: [WinError 1] Incorrect function
Call stack:
  File "<string>", line 1, in <module>
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\spawn.py", line 135, in _main
    return self._bootstrap(parent_sentinel)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2689, in launch_kernel
    asyncio.run(control_loop(kernel))
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\base_events.py", line 641, in run_forever
    self._run_once()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\base_events.py", line 1986, in _run_once
    handle._run()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2683, in control_loop
    await kernel.handle_message(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2092, in handle_message
    await self.request_handler.handle(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2513, in handle
    return await handler(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1987, in handle_instantiate
    await self.instantiate(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1957, in instantiate
    await self.run(request.execution_requests)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1511, in run
    await _run_with_uninstantiated_requests(execution_requests)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1451, in _run_with_uninstantiated_requests
    await self._run_cells(
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1320, in _run_cells
    while cell_ids := await self._run_cells_internal(cell_ids):
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1399, in _run_cells_internal
    await runner.run_all()
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runner\cell_runner.py", line 589, in run_all
    LOGGER.debug("Running post_execution hooks in context")
Message: 'Running post_execution hooks in context'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\logging\__init__.py", line 1163, in emit
    stream.write(msg + self.terminator)
OSError: [WinError 1] Incorrect function
Call stack:
  File "<string>", line 1, in <module>
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\spawn.py", line 135, in _main
    return self._bootstrap(parent_sentinel)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2689, in launch_kernel
    asyncio.run(control_loop(kernel))
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\base_events.py", line 641, in run_forever
    self._run_once()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\base_events.py", line 1986, in _run_once
    handle._run()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2683, in control_loop
    await kernel.handle_message(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2092, in handle_message
    await self.request_handler.handle(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2513, in handle
    return await handler(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1987, in handle_instantiate
    await self.instantiate(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1957, in instantiate
    await self.run(request.execution_requests)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1511, in run
    await _run_with_uninstantiated_requests(execution_requests)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1451, in _run_with_uninstantiated_requests
    await self._run_cells(
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1320, in _run_cells
    while cell_ids := await self._run_cells_internal(cell_ids):
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1399, in _run_cells_internal
    await runner.run_all()
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runner\cell_runner.py", line 591, in run_all
    post_hook(cell, self, run_result)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\contextlib.py", line 81, in inner
    return func(*args, **kwds)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runner\hooks_post_execution.py", line 63, in _set_imported_defs
    LOGGER.debug("Acquiring graph lock to update cell import workspace")
Message: 'Acquiring graph lock to update cell import workspace'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\logging\__init__.py", line 1163, in emit
    stream.write(msg + self.terminator)
OSError: [WinError 1] Incorrect function
Call stack:
  File "<string>", line 1, in <module>
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\spawn.py", line 135, in _main
    return self._bootstrap(parent_sentinel)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2689, in launch_kernel
    asyncio.run(control_loop(kernel))
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\base_events.py", line 641, in run_forever
    self._run_once()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\base_events.py", line 1986, in _run_once
    handle._run()
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\asyncio\events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2683, in control_loop
    await kernel.handle_message(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2092, in handle_message
    await self.request_handler.handle(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 2513, in handle
    return await handler(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1987, in handle_instantiate
    await self.instantiate(request)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1957, in instantiate
    await self.run(request.execution_requests)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1511, in run
    await _run_with_uninstantiated_requests(execution_requests)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1451, in _run_with_uninstantiated_requests
    await self._run_cells(
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1320, in _run_cells
    while cell_ids := await self._run_cells_internal(cell_ids):
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runtime.py", line 1399, in _run_cells_internal
    await runner.run_all()
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runner\cell_runner.py", line 591, in run_all
    post_hook(cell, self, run_result)
  File "C:\Users\dwales\AppData\Roaming\uv\python\cpython-3.12.5-windows-x86_64-none\Lib\contextlib.py", line 81, in inner
    return func(*args, **kwds)
  File "C:\Users\dwales\AppData\Local\uv\cache\archive-v0\GkP4c5-2dEMTJLhhRUps7\Lib\site-packages\marimo\_runtime\runner\hooks_post_execution.py", line 65, in _set_imported_defs
    LOGGER.debug("Acquired graph lock to update import workspace.")
Message: 'Acquired graph lock to update import workspace.'
Arguments: ()

I can't reproduce this 100% every time, but typically after a few tries I can reproduce this by running marimo edit --sandbox example.py, then creating a few simple cells such as the following:

print('hi')

1/0

print('test')

While ctrl-c typically works immediately after launching marimo, after a couple of minutes, and adding test cells like the above, ctrl-c often stops working.

Here is a debug log from a time when ctrl-c stopped working:

❯ marimo -d edit --sandbox .\example.py
Running in a sandbox: uv run --isolated --no-project --compile-bytecode --with-requirements C:\Users\dwales\AppData\Local\Temp\tmp47c6i174.txt --python >=3.12 marimo -d edit .\example.py
[D 250508 16:22:20 file_router:44] Routing to file .\example.py
WARNING:  Current configuration will not reload as not all conditions are met, please refer to documentation.
INFO:     Started server process [37568]
INFO:     Waiting for application startup.
[D 250508 16:22:21 lifespans:50] Setup: lsp
[D 250508 16:22:21 manager:375] Using config at C:\Users\dwales\.config\marimo\marimo.toml
[D 250508 16:22:21 lifespans:43] Language Servers are enabled
[D 250508 16:22:21 manager:375] Using config at C:\Users\dwales\.config\marimo\marimo.toml
[D 250508 16:22:21 lsp:59] Starting LSP server at port 3119...
[D 250508 16:22:21 lsp:66] ... running command: ['C:\\Users\\dwales\\AppData\\Local\\uv\\cache\\archive-v0\\6zd4X2lMTJWJtgw6m4s0n\\Scripts\\python.exe', '-m', 'pylsp', '--ws', '-v', '--port', '3119', '--check-parent-process']
[D 250508 16:22:21 lsp:79] ... process return code (`None` means still running): None
[D 250508 16:22:21 lsp:105] Started LSP server at port 3119
[D 250508 16:22:21 manager:375] Using config at C:\Users\dwales\.config\marimo\marimo.toml
[D 250508 16:22:21 lifespans:50] Setup: etc
[D 250508 16:22:21 lifespans:50] Setup: signal_handler
[D 250508 16:22:21 lifespans:50] Setup: logging

        Edit example.py in your browser 📝

        ➜  URL: http://127.0.0.1:2718?access_token=8R5QjxPzqSoG7yOJ0dcgyA

[D 250508 16:22:21 manager:375] Using config at C:\Users\dwales\.config\marimo\marimo.toml
[D 250508 16:22:21 lifespans:50] Setup: open_browser
[D 250508 16:22:21 manager:375] Using config at C:\Users\dwales\.config\marimo\marimo.toml
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:2718 (Press CTRL+C to quit)
[D 250508 16:22:22 auth:51] Validated access_token from query param
[D 250508 16:22:22 assets:101] File key provided: C:\Users\dwales\example.py
[D 250508 16:22:22 manager:375] Using config at C:\Users\dwales\.config\marimo\marimo.toml
[D 250508 16:22:22 manager:375] Using config at C:\Users\dwales\.config\marimo\marimo.toml
INFO:     127.0.0.1:56564 - "GET /?access_token=8R5QjxPzqSoG7yOJ0dcgyA HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /public-files-sw.js?v=2 HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /public-files-sw.js?v=2 HTTP/1.1" 200 OK
[D 250508 16:22:24 manager:375] Using config at C:\Users\dwales\.config\marimo\marimo.toml
INFO:     ('127.0.0.1', 56569) - "WebSocket /ws?session_id=s_qzy75n" [accepted]
[D 250508 16:22:24 ws:537] Websocket open request for session with id s_qzy75n
[D 250508 16:22:24 ws:540] Existing sessions: {}
[D 250508 16:22:24 sessions:822] Creating new session for id s_qzy75n
[D 250508 16:22:24 manager:375] Using config at C:\Users\dwales\.config\marimo\marimo.toml
[D 250508 16:22:25 runtime:2536] Launching kernel
INFO:     connection open
[D 250508 16:22:25 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: ['marimo'].
INFO:     127.0.0.1:56564 - "GET /public-files-sw.js?v=2 HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK
[D 250508 16:22:25 middleware:368] Creating websocket proxy for ws://localhost:3119/lsp/pylsp
INFO:     ('127.0.0.1', 56573) - "WebSocket /lsp/pylsp" [accepted]
INFO:     connection open
INFO:     127.0.0.1:56572 - "POST /api/kernel/instantiate HTTP/1.1" 200 OK
[D 250508 16:22:25 manager:375] Using config at C:\Users\dwales\.config\marimo\marimo.toml
[D 250508 16:22:26 runtime:2676] Received control request: CreationRequest(execution_requests=(ExecutionRequest(cell=Hbol, code_preview=1/0), ExecutionRequest(cell=MJUe, code_preview=print('hi'), ExecutionRequest(cell=vblA, code_preview=1/0), ExecutionRequest(cell=bkHC, code_preview=print('tes), ExecutionRequest(cell=lEQa, code_preview=print('hel), ExecutionRequest(cell=PKri, code_preview=1/0), ExecutionRequest(cell=Xref, code_preview=)), set_ui_element_value_request=SetUIElementValueRequest(n_elements=0, token=6d1793e8-7d81-4e29-8e2c-fe2c670956f5), auto_run=True, request=HTTPRequest(path=/api/kernel/instantiate, params=0))
[D 250508 16:22:26 runtime:2088] Acquiring globals lock to handle request CreationRequest(execution_requests=(ExecutionRequest(cell=Hbol, code_preview=1/0), ExecutionRequest(cell=MJUe, code_preview=print('hi'), ExecutionRequest(cell=vblA, code_preview=1/0), ExecutionRequest(cell=bkHC, code_preview=print('tes), ExecutionRequest(cell=lEQa, code_preview=print('hel), ExecutionRequest(cell=PKri, code_preview=1/0), ExecutionRequest(cell=Xref, code_preview=)), set_ui_element_value_request=SetUIElementValueRequest(n_elements=0, token=6d1793e8-7d81-4e29-8e2c-fe2c670956f5), auto_run=True, request=HTTPRequest(path=/api/kernel/instantiate, params=0))
[D 250508 16:22:26 runtime:2091] Handling control request: CreationRequest(execution_requests=(ExecutionRequest(cell=Hbol, code_preview=1/0), ExecutionRequest(cell=MJUe, code_preview=print('hi'), ExecutionRequest(cell=vblA, code_preview=1/0), ExecutionRequest(cell=bkHC, code_preview=print('tes), ExecutionRequest(cell=lEQa, code_preview=print('hel), ExecutionRequest(cell=PKri, code_preview=1/0), ExecutionRequest(cell=Xref, code_preview=)), set_ui_element_value_request=SetUIElementValueRequest(n_elements=0, token=6d1793e8-7d81-4e29-8e2c-fe2c670956f5), auto_run=True, request=HTTPRequest(path=/api/kernel/instantiate, params=0))
[D 250508 16:22:26 runtime:1096] Mutating graph.
[D 250508 16:22:26 runtime:1097] Current set of errors: {}
[D 250508 16:22:26 dataflow:137] Acquiring graph lock to register cell Hbol
[D 250508 16:22:26 dataflow:139] Acquired graph lock.
[D 250508 16:22:26 dataflow:205] Registered cell Hbol and released graph lock
[D 250508 16:22:26 runtime:805] registered cell Hbol
[D 250508 16:22:26 runtime:806] parents: set()
[D 250508 16:22:26 runtime:807] children: set()
[D 250508 16:22:26 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:22:26 runtime:930] graph:
        cell id Hbol
        parents {'Hbol': set()}
        children {'Hbol': set()}
        siblings {'Hbol': set()}
[D 250508 16:22:26 dataflow:137] Acquiring graph lock to register cell MJUe
[D 250508 16:22:26 dataflow:139] Acquired graph lock.
[D 250508 16:22:26 dataflow:205] Registered cell MJUe and released graph lock
[D 250508 16:22:26 runtime:805] registered cell MJUe
[D 250508 16:22:26 runtime:806] parents: set()
[D 250508 16:22:26 runtime:807] children: set()
[D 250508 16:22:26 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:22:26 runtime:930] graph:
        cell id MJUe
        parents {'Hbol': set(), 'MJUe': set()}
        children {'Hbol': set(), 'MJUe': set()}
        siblings {'Hbol': set(), 'MJUe': set()}
[D 250508 16:22:26 dataflow:137] Acquiring graph lock to register cell vblA
[D 250508 16:22:26 dataflow:139] Acquired graph lock.
[D 250508 16:22:26 dataflow:205] Registered cell vblA and released graph lock
[D 250508 16:22:26 runtime:805] registered cell vblA
[D 250508 16:22:26 runtime:806] parents: set()
[D 250508 16:22:26 runtime:807] children: set()
[D 250508 16:22:26 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:22:26 runtime:930] graph:
        cell id vblA
        parents {'Hbol': set(), 'MJUe': set(), 'vblA': set()}
        children {'Hbol': set(), 'MJUe': set(), 'vblA': set()}
        siblings {'Hbol': set(), 'MJUe': set(), 'vblA': set()}
[D 250508 16:22:26 dataflow:137] Acquiring graph lock to register cell bkHC
[D 250508 16:22:26 dataflow:139] Acquired graph lock.
[D 250508 16:22:26 dataflow:205] Registered cell bkHC and released graph lock
[D 250508 16:22:26 runtime:805] registered cell bkHC
[D 250508 16:22:26 runtime:806] parents: set()
[D 250508 16:22:26 runtime:807] children: set()
[D 250508 16:22:26 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:22:26 runtime:930] graph:
        cell id bkHC
        parents {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set()}
        children {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set()}
        siblings {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set()}
[D 250508 16:22:26 dataflow:137] Acquiring graph lock to register cell lEQa
[D 250508 16:22:26 dataflow:139] Acquired graph lock.
[D 250508 16:22:26 dataflow:205] Registered cell lEQa and released graph lock
[D 250508 16:22:26 runtime:805] registered cell lEQa
[D 250508 16:22:26 runtime:806] parents: set()
[D 250508 16:22:26 runtime:807] children: set()
[D 250508 16:22:26 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:22:26 runtime:930] graph:
        cell id lEQa
        parents {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set()}
        children {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set()}
        siblings {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set()}
[D 250508 16:22:26 dataflow:137] Acquiring graph lock to register cell PKri
[D 250508 16:22:26 dataflow:139] Acquired graph lock.
[D 250508 16:22:26 dataflow:205] Registered cell PKri and released graph lock
[D 250508 16:22:26 runtime:805] registered cell PKri
[D 250508 16:22:26 runtime:806] parents: set()
[D 250508 16:22:26 runtime:807] children: set()
[D 250508 16:22:26 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:22:26 runtime:930] graph:
        cell id PKri
        parents {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set()}
        children {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set()}
        siblings {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set()}
[D 250508 16:22:26 dataflow:137] Acquiring graph lock to register cell Xref
[D 250508 16:22:26 dataflow:139] Acquired graph lock.
[D 250508 16:22:26 dataflow:205] Registered cell Xref and released graph lock
[D 250508 16:22:26 runtime:805] registered cell Xref
[D 250508 16:22:26 runtime:806] parents: set()
[D 250508 16:22:26 runtime:807] children: set()
[D 250508 16:22:26 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:22:26 runtime:930] graph:
        cell id Xref
        parents {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set()}
        children {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set()}
        siblings {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set()}
[D 250508 16:22:26 runtime:1138] After mutation, syntax errors {}
[D 250508 16:22:26 runtime:1139] Semantic errors {}
[D 250508 16:22:26 runtime:1183] Final set of errors, after pruning valid cells: {}
[D 250508 16:22:26 cell_runner:552] Running preparation hooks
[D 250508 16:22:26 cell_runner:558] Cell runner processing Hbol
[D 250508 16:22:26 cell_runner:581] Running pre_execution hooks
[D 250508 16:22:26 cell_runner:584] Running cell Hbol
[D 250508 16:22:26 cell_runner:589] Running post_execution hooks in context
[D 250508 16:22:26 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:22:26 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:22:26 hooks_post_execution:308] Cell Hbol raised ZeroDivisionError
[D 250508 16:22:26 cell_runner:558] Cell runner processing MJUe
[D 250508 16:22:26 cell_runner:581] Running pre_execution hooks
[D 250508 16:22:26 cell_runner:584] Running cell MJUe
[D 250508 16:22:26 cell_runner:589] Running post_execution hooks in context
[D 250508 16:22:26 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:22:26 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:22:26 cell_runner:558] Cell runner processing vblA
[D 250508 16:22:26 cell_runner:581] Running pre_execution hooks
[D 250508 16:22:26 cell_runner:584] Running cell vblA
[D 250508 16:22:26 cell_runner:589] Running post_execution hooks in context
[D 250508 16:22:26 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:22:26 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:22:26 hooks_post_execution:308] Cell vblA raised ZeroDivisionError
[D 250508 16:22:26 cell_runner:558] Cell runner processing bkHC
[D 250508 16:22:26 cell_runner:581] Running pre_execution hooks
[D 250508 16:22:26 cell_runner:584] Running cell bkHC
[D 250508 16:22:26 cell_runner:589] Running post_execution hooks in context
[D 250508 16:22:26 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:22:26 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:22:26 cell_runner:558] Cell runner processing lEQa
[D 250508 16:22:26 cell_runner:581] Running pre_execution hooks
[D 250508 16:22:26 cell_runner:584] Running cell lEQa
[D 250508 16:22:26 cell_runner:589] Running post_execution hooks in context
[D 250508 16:22:26 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:22:26 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:22:26 cell_runner:558] Cell runner processing PKri
[D 250508 16:22:26 cell_runner:581] Running pre_execution hooks
[D 250508 16:22:26 cell_runner:584] Running cell PKri
[D 250508 16:22:26 cell_runner:589] Running post_execution hooks in context
[D 250508 16:22:26 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:22:26 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:22:26 hooks_post_execution:308] Cell PKri raised ZeroDivisionError
[D 250508 16:22:26 cell_runner:558] Cell runner processing Xref
[D 250508 16:22:26 cell_runner:581] Running pre_execution hooks
[D 250508 16:22:26 cell_runner:584] Running cell Xref
[D 250508 16:22:26 cell_runner:589] Running post_execution hooks in context
[D 250508 16:22:26 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:22:26 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:22:26 cell_runner:598] Running on_finish hooks
[D 250508 16:22:26 runtime:1325] Finished run.
[D 250508 16:22:26 runtime:2093] Handled control request: CreationRequest(execution_requests=(ExecutionRequest(cell=Hbol, code_preview=1/0), ExecutionRequest(cell=MJUe, code_preview=print('hi'), ExecutionRequest(cell=vblA, code_preview=1/0), ExecutionRequest(cell=bkHC, code_preview=print('tes), ExecutionRequest(cell=lEQa, code_preview=print('hel), ExecutionRequest(cell=PKri, code_preview=1/0), ExecutionRequest(cell=Xref, code_preview=)), set_ui_element_value_request=SetUIElementValueRequest(n_elements=0, token=6d1793e8-7d81-4e29-8e2c-fe2c670956f5), auto_run=True, request=HTTPRequest(path=/api/kernel/instantiate, params=0))
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "POST /api/kernel/run HTTP/1.1" 200 OK
[D 250508 16:22:38 runtime:2676] Received control request: ExecuteMultipleRequest(cells=1)
[D 250508 16:22:38 runtime:2088] Acquiring globals lock to handle request ExecuteMultipleRequest(cells=1)
[D 250508 16:22:38 runtime:2091] Handling control request: ExecuteMultipleRequest(cells=1)
[D 250508 16:22:38 runtime:1096] Mutating graph.
[D 250508 16:22:38 runtime:1097] Current set of errors: {}
[D 250508 16:22:38 runtime:899] Deleting cell Xref
[D 250508 16:22:38 dataflow:267] Acquiring graph lock to delete cell Xref
[D 250508 16:22:38 dataflow:269] Acquired graph lock to delete cell Xref
[D 250508 16:22:38 dataflow:309] Deleted cell Xref and Released graph lock.
[D 250508 16:22:38 dataflow:137] Acquiring graph lock to register cell Xref
[D 250508 16:22:38 dataflow:139] Acquired graph lock.
[D 250508 16:22:38 dataflow:205] Registered cell Xref and released graph lock
[D 250508 16:22:38 runtime:805] registered cell Xref
[D 250508 16:22:38 runtime:806] parents: set()
[D 250508 16:22:38 runtime:807] children: set()
[D 250508 16:22:38 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:22:38 runtime:930] graph:
        cell id Xref
        parents {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set()}
        children {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set()}
        siblings {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set()}
[D 250508 16:22:38 runtime:1138] After mutation, syntax errors {}
[D 250508 16:22:38 runtime:1139] Semantic errors {}
[D 250508 16:22:38 runtime:1183] Final set of errors, after pruning valid cells: {}
[D 250508 16:22:38 cell_runner:552] Running preparation hooks
[D 250508 16:22:38 cell_runner:558] Cell runner processing Xref
[D 250508 16:22:38 cell_runner:581] Running pre_execution hooks
[D 250508 16:22:38 cell_runner:584] Running cell Xref
[D 250508 16:22:38 cell_runner:589] Running post_execution hooks in context
[D 250508 16:22:38 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:22:38 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:22:38 cell_runner:598] Running on_finish hooks
[D 250508 16:22:38 runtime:1325] Finished run.
[D 250508 16:22:38 runtime:2093] Handled control request: ExecuteMultipleRequest(cells=1)
INFO:     127.0.0.1:56564 - "POST /api/kernel/sync/cell_ids HTTP/1.1" 200 OK
[D 250508 16:22:39 file_manager:135] Saving app to C:\Users\dwales\example.py
INFO:     127.0.0.1:56564 - "POST /api/kernel/save HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "POST /api/kernel/run HTTP/1.1" 200 OK
[D 250508 16:22:47 runtime:2676] Received control request: ExecuteMultipleRequest(cells=1)
[D 250508 16:22:47 runtime:2088] Acquiring globals lock to handle request ExecuteMultipleRequest(cells=1)
[D 250508 16:22:47 runtime:2091] Handling control request: ExecuteMultipleRequest(cells=1)
[D 250508 16:22:47 runtime:1096] Mutating graph.
[D 250508 16:22:47 runtime:1097] Current set of errors: {}
[D 250508 16:22:47 dataflow:137] Acquiring graph lock to register cell ifdn
[D 250508 16:22:47 dataflow:139] Acquired graph lock.
[D 250508 16:22:47 dataflow:205] Registered cell ifdn and released graph lock
[D 250508 16:22:47 runtime:805] registered cell ifdn
[D 250508 16:22:47 runtime:806] parents: set()
[D 250508 16:22:47 runtime:807] children: set()
[D 250508 16:22:47 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:22:47 runtime:930] graph:
        cell id ifdn
        parents {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set(), 'ifdn': set()}
        children {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set(), 'ifdn': set()}
        siblings {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set(), 'ifdn': set()}
[D 250508 16:22:47 runtime:1138] After mutation, syntax errors {}
[D 250508 16:22:47 runtime:1139] Semantic errors {}
[D 250508 16:22:47 runtime:1183] Final set of errors, after pruning valid cells: {}
[D 250508 16:22:47 cell_runner:552] Running preparation hooks
[D 250508 16:22:47 cell_runner:558] Cell runner processing ifdn
[D 250508 16:22:47 cell_runner:581] Running pre_execution hooks
[D 250508 16:22:47 cell_runner:584] Running cell ifdn
[D 250508 16:22:47 cell_runner:589] Running post_execution hooks in context
[D 250508 16:22:47 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:22:47 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:22:47 hooks_post_execution:308] Cell ifdn raised ZeroDivisionError
[D 250508 16:22:47 cell_runner:598] Running on_finish hooks
[D 250508 16:22:47 runtime:1325] Finished run.
[D 250508 16:22:47 runtime:2093] Handled control request: ExecuteMultipleRequest(cells=1)
INFO:     127.0.0.1:56564 - "POST /api/kernel/sync/cell_ids HTTP/1.1" 200 OK
[D 250508 16:22:48 file_manager:135] Saving app to C:\Users\dwales\example.py
INFO:     127.0.0.1:56564 - "POST /api/kernel/save HTTP/1.1" 200 OK
[D 250508 16:22:53 runtime:2676] Received control request: ExecuteMultipleRequest(cells=1)
INFO:     127.0.0.1:56564 - "POST /api/kernel/run HTTP/1.1" 200 OK
[D 250508 16:22:53 runtime:2088] Acquiring globals lock to handle request ExecuteMultipleRequest(cells=1)
[D 250508 16:22:53 runtime:2091] Handling control request: ExecuteMultipleRequest(cells=1)
[D 250508 16:22:53 runtime:1096] Mutating graph.
[D 250508 16:22:53 runtime:1097] Current set of errors: {}
[D 250508 16:22:53 dataflow:137] Acquiring graph lock to register cell NpvF
[D 250508 16:22:53 dataflow:139] Acquired graph lock.
[D 250508 16:22:53 dataflow:205] Registered cell NpvF and released graph lock
[D 250508 16:22:53 runtime:805] registered cell NpvF
[D 250508 16:22:53 runtime:806] parents: set()
[D 250508 16:22:53 runtime:807] children: set()
[D 250508 16:22:53 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:22:53 runtime:930] graph:
        cell id NpvF
        parents {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set(), 'ifdn': set(), 'NpvF': set()}
        children {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set(), 'ifdn': set(), 'NpvF': set()}
        siblings {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set(), 'ifdn': set(), 'NpvF': set()}
[D 250508 16:22:53 runtime:1138] After mutation, syntax errors {}
[D 250508 16:22:53 runtime:1139] Semantic errors {}
[D 250508 16:22:53 runtime:1183] Final set of errors, after pruning valid cells: {}
[D 250508 16:22:53 cell_runner:552] Running preparation hooks
[D 250508 16:22:53 cell_runner:558] Cell runner processing NpvF
[D 250508 16:22:53 cell_runner:581] Running pre_execution hooks
[D 250508 16:22:53 cell_runner:584] Running cell NpvF
[D 250508 16:22:53 cell_runner:589] Running post_execution hooks in context
[D 250508 16:22:53 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:22:53 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:22:53 hooks_post_execution:308] Cell NpvF raised ZeroDivisionError
[D 250508 16:22:53 cell_runner:598] Running on_finish hooks
[D 250508 16:22:53 runtime:1325] Finished run.
[D 250508 16:22:53 runtime:2093] Handled control request: ExecuteMultipleRequest(cells=1)
INFO:     127.0.0.1:56564 - "POST /api/kernel/sync/cell_ids HTTP/1.1" 200 OK
[D 250508 16:22:54 file_manager:135] Saving app to C:\Users\dwales\example.py
INFO:     127.0.0.1:56564 - "POST /api/kernel/save HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK
[D 250508 16:23:02 file_manager:135] Saving app to C:\Users\dwales\example.py
INFO:     127.0.0.1:56564 - "POST /api/kernel/save HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "POST /api/kernel/run HTTP/1.1" 200 OK
[D 250508 16:23:03 runtime:2676] Received control request: ExecuteMultipleRequest(cells=1)
[D 250508 16:23:03 runtime:2088] Acquiring globals lock to handle request ExecuteMultipleRequest(cells=1)
[D 250508 16:23:03 runtime:2091] Handling control request: ExecuteMultipleRequest(cells=1)
[D 250508 16:23:03 runtime:1096] Mutating graph.
[D 250508 16:23:03 runtime:1097] Current set of errors: {}
[D 250508 16:23:03 dataflow:137] Acquiring graph lock to register cell GlNY
[D 250508 16:23:03 dataflow:139] Acquired graph lock.
[D 250508 16:23:03 dataflow:205] Registered cell GlNY and released graph lock
[D 250508 16:23:03 runtime:805] registered cell GlNY
[D 250508 16:23:03 runtime:806] parents: set()
[D 250508 16:23:03 runtime:807] children: set()
[D 250508 16:23:03 runtime:2483] Updating script metadata: C:\Users\dwales\example.py. Adding namespaces: [].
[D 250508 16:23:03 runtime:930] graph:
        cell id GlNY
        parents {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set(), 'ifdn': set(), 'NpvF': set(), 'GlNY': set()}
        children {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set(), 'ifdn': set(), 'NpvF': set(), 'GlNY': set()}
        siblings {'Hbol': set(), 'MJUe': set(), 'vblA': set(), 'bkHC': set(), 'lEQa': set(), 'PKri': set(), 'Xref': set(), 'ifdn': set(), 'NpvF': set(), 'GlNY': set()}
[D 250508 16:23:03 runtime:1138] After mutation, syntax errors {}
[D 250508 16:23:03 runtime:1139] Semantic errors {}
[D 250508 16:23:03 runtime:1183] Final set of errors, after pruning valid cells: {}
[D 250508 16:23:03 cell_runner:552] Running preparation hooks
[D 250508 16:23:03 cell_runner:558] Cell runner processing GlNY
[D 250508 16:23:03 cell_runner:581] Running pre_execution hooks
[D 250508 16:23:03 cell_runner:584] Running cell GlNY
[D 250508 16:23:03 cell_runner:589] Running post_execution hooks in context
[D 250508 16:23:03 hooks_post_execution:63] Acquiring graph lock to update cell import workspace
[D 250508 16:23:03 hooks_post_execution:65] Acquired graph lock to update import workspace.
[D 250508 16:23:03 hooks_post_execution:308] Cell GlNY raised TypeError
[D 250508 16:23:03 cell_runner:598] Running on_finish hooks
[D 250508 16:23:03 runtime:1325] Finished run.
[D 250508 16:23:03 runtime:2093] Handled control request: ExecuteMultipleRequest(cells=1)
INFO:     127.0.0.1:56564 - "POST /api/kernel/sync/cell_ids HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK
[D 250508 16:23:04 file_manager:135] Saving app to C:\Users\dwales\example.py
INFO:     127.0.0.1:56564 - "POST /api/kernel/save HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK
INFO:     127.0.0.1:56564 - "GET /api/usage HTTP/1.1" 200 OK

So far as I can tell, these issues only occur on Windows. If it's relevant, here's a screenshot of Task Manager at the time:

Image

The only Python process running on the system is marimo -d edit --sandbox example.py.

Will you submit a PR?

  • Yes

Environment

{
  "marimo": "0.13.6",
  "OS": "Windows",
  "OS Version": "11",
  "Processor": "Intel64 Family 6 Model 140 Stepping 1, GenuineIntel",
  "Python Version": "3.12.7",
  "Binaries": {
    "Browser": "133.0.6943.99",
    "Node": "--"
  },
  "Dependencies": {
    "click": "8.1.8",
    "docutils": "0.21.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.8",
    "narwhals": "1.37.1",
    "packaging": "25.0",
    "psutil": "7.0.0",
    "pygments": "2.19.1",
    "pymdown-extensions": "10.15",
    "pyyaml": "6.0.2",
    "starlette": "0.46.2",
    "tomlkit": "0.13.2",
    "typing-extensions": "4.13.2",
    "uvicorn": "0.34.2",
    "websockets": "15.0.1"
  },
  "Optional Dependencies": {
    "duckdb": "1.2.2",
    "pandas": "2.2.3",
    "polars": "1.29.0",
    "pyarrow": "20.0.0",
    "pycrdt": "0.11.1",
    "sqlglot": "26.16.3"
  },
  "Experimental Flags": {}
}

Code to reproduce

marimo edit --sandbox example.py

Workaround

When it gets into this state, it's still possible to terminate Marimo from the web interface by clicking the red 'X' in the top right.

@daviewales daviewales added the bug Something isn't working label May 8, 2025
@mscolnick
Copy link
Contributor

hey @daviewales - we don't have any windows developers or contributors on the team so we these sort of bugs have been hard for us to fix.

we will do our best from the logs you've included (thank you), but if you'd like to take a stab at a fix, it would be super helpful

@daviewales
Copy link
Author

Thanks @mscolnick, that's understandable. I don't think I can commit to fixing this myself unfortunately. Thanks for an excellent tool! I'll work around this issue with WSL for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform:windows
Projects
None yet
Development

No branches or pull requests

2 participants