Skip to content

[BUG] OSError: [Errno 22] Invalid argument and No incoming connection from debugger client #389

Open
@febb0e

Description

@febb0e

Describe the bug
When using the Robotcode extension for Robot Framework in VS Code, I encounter the following errors when debugging:

  • OSError: [Errno 22] Invalid argument
  • TimeoutError: Unable to connect to RobotCode debugger.
  • Error: No incoming connection from a debugger client

These errors occur especially when I try to relaunch the debugger from an open session or when stopping the instance and quickly debugging again.

Steps To Reproduce

  • Open a Robot Framework project in VS Code.
  • Start a debugging session using the Robotcode extension.
  • Stop the debugging session.
  • Quickly start the debugging session again OR use restart from debugger toolbar.
  • Observe the errors.

If possible add some example source code like:

***Settings***
Library  Collections

***Test Cases***
a simple test
    do something    # this should shown something

Expected behavior
I expect the debugger to start without errors, even when quickly restarting the debugging session.

Screenshots/ Videos
Image

Logs
VSCode "Output" view for RobotCode:

Starting debug launcher in stdio mode: example/.venv/bin/python -u /user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/tool/robotcode debug-launch --stdio`

Stack trace for core.py:

Exception has occurred: SystemExit
255
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/robotcode/debugger/run.py", line 197, in run_debugger
    server.protocol.wait_for_client(wait_for_client_timeout)
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/robotcode/debugger/server.py", line 123, in wait_for_client
    raise TimeoutError("Timeout waiting for client")
TimeoutError: Timeout waiting for client

The above exception was the direct cause of the following exception:

  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/robotcode/debugger/cli.py", line 178, in debug
    ctx=ctx,

                app=app,

                args=list(robot_options_and_args),

                mode=mode,

                addresses=bind,

                port=port if port is not None else DEBUGGER_DEFAULT_PORT,

                pipe_name=pipe_name,

                debug=debug,

                stop_on_entry=stop_on_entry,

                wait_for_client=wait_for_client,

                wait_for_client_timeout=wait_for_client_timeout,

                configuration_done_timeout=configuration_done_timeout,

                debugpy=debugpy,

                debugpy_wait_for_client=debugpy_wait_for_client,

                debugpy_port=debugpy_port,

                output_messages=output_messages,

                output_log=output_log,

                output_timestamps=output_timestamps,

                group_output=group_output,

            )

        )
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/robotcode/debugger/run.py", line 199, in run_debugger
    raise ConnectionError("No incomming connection from a debugger client") from e
ConnectionError: No incomming connection from a debugger client

The above exception was the direct cause of the following exception:

  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/robotcode/debugger/cli.py", line 206, in debug
    raise UnknownError(str(e)) from e
robotcode.plugin.UnknownError: No incomming connection from a debugger client

During handling of the above exception, another exception occurred:

  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/click/core.py", line 1100, in main
    sys.exit(e.exit_code)
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/libs/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/user/.vscode/extensions/d-biehl.robotcode-0.108.1/bundled/tool/robotcode/__main__.py", line 27, in <module>
    windows_expand_args=False,

        default_map={"launcher_script": str(pathlib.Path(__file__).parent)},

    )
SystemExit: 255

Additional context
No additional context

Desktop (please complete the following information):

  • VS Code Version: 1.97.0
  • RobotCode Version: 0.108.1
  • OS: Darwin arm64 24.3.0
  • Python Version: 3.12.9
  • RobotFramework Version: 7.2
  • Robocop Version: 5.8.1
  • Robotidy Version: 4.16.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions