Skip to content

[bug] Error: Failed to start debug session in Ubuntu 18.04 #869

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

Closed
2 of 4 tasks
ravijo opened this issue Feb 3, 2023 · 6 comments
Closed
2 of 4 tasks

[bug] Error: Failed to start debug session in Ubuntu 18.04 #869

ravijo opened this issue Feb 3, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@ravijo
Copy link

ravijo commented Feb 3, 2023

Version Info

  • Windows: (Version)
  • Linux: Ubuntu OS 18.04.6 LTS
  • ROS 1: Melodic
  • ROS 2: Dist

<Version of the plugin>
Visual Studio Code v1.74.3
VSCode-ROS Extension v0.8.4

<Copy the Version information from the Help | About menu>

Version: 1.74.3
Commit: 97dec172d3256f8ca4bfb2143f3f76b503ca0534
Date: 2023-01-09T16:57:40.428Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.4.0-137-generic
Sandboxed: No

Bug Info

Can not attach or launch the debugger at all.

Repro steps

  1. Clone rospy_tutorials
  2. Use the following launch.json file:
    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "ROS: Launch",
                "type": "ros",
                "request": "launch",
                "target": "/home/ravi/test_ws/src/hello_tutorials/talker_listener.launch"
            },
    
            {
                "name": "ROS: Attach",
                "type": "ros",
                "request": "attach"
            }
        ]
    }
    

Expected Behavior

Debugger should run.

Additional Info

Please see two screen recordings below:

  1. Recording: Attaching a running node
1.mp4
  1. Recording: Launching nodes
2.mp4

I noticed that attaching a node is requesting authentication. But after providing the correct password, nothing happens. Similarly, the launching nodes show processes for a second but die/disappear immediately.

The developer tools are showing following following error:

[Extension Host] rejected promise not handled within 1 second: Error: Failed to start debug session!
[Extension Host] stack trace: Error: Failed to start debug session!
    at LaunchResolver.<anonymous> (/home/ravi/.vscode/extensions/ms-iot.vscode-ros-0.8.4/out/src/debugger/configuration/resolvers/ros1/launch.js:310:32)
    at Generator.next (<anonymous>)
    at fulfilled (/home/ravi/.vscode/extensions/ms-iot.vscode-ros-0.8.4/out/src/debugger/configuration/resolvers/ros1/launch.js:7:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

Please see a screenshot below:
uzWFE

The issues is also reported in SO

@ravijo ravijo added the bug Something isn't working label Feb 3, 2023
@ravijo
Copy link
Author

ravijo commented Feb 3, 2023

It seems that error is caused due to Python 2.7 as indicated by the following screenshot:

1

Below is the launch.json file:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "ROS: Launch",
            "request": "launch",
            "target": "/home/ravi/test_ws/src/hello_tutorials/talker_listener.launch",
            "launch": [
                "rviz",
                "gz",
                "gzclient",
                "gzserver"
            ],
            "type": "ros"
        }
    ]
}

How to launch debugger in ROS Melodic?

@DerProfessor
Copy link

Hi,
I encountered the problem already with Python 3.6 under Ubuntu 18.04 (see #813).
In short the problem is that the VSCode Python Extension uses debugpy which dropped support for Python 2.7 and < Python 3.7. I work around the problem by reinstalling version 2022.2.1924087327
of the Python Extension which is the last to support Python 2.7 and 3.6. There are plans to support older Python versions again.

@ravijo
Copy link
Author

ravijo commented Feb 6, 2023

@DerProfessor

It works like a charm! Thank you very much.

I hope the plans to support older versions get a green signal. Until then, I will keep using 2022.2.1924087327, as you suggested.

Thanks again.

@ravijo
Copy link
Author

ravijo commented Feb 10, 2023

@DerProfessor

On another computer, having same OS and configuration, the "Launch" works but "Attach" doesn't while debugging python node.

May I request you to please have a look at #872

BTW, is there any log file in vscode? It would help to dig deeper in these issues. Thanks

@ooeygui
Copy link
Member

ooeygui commented Mar 27, 2023

There is a new log file support in 0.9.0. Using the "output" tab, select "ROS", which now shows logging. (Before it was only showing when debugged).

That said, these issues are related to the Python extension, not the ROS extension. Because of this dependency, Melodic is not supported by current versions of the ROS extension.

@ravijo
Copy link
Author

ravijo commented Mar 28, 2023

@ooeygui

There is a new log file support in 0.9.0. Using the "output" tab, select "ROS", which now shows logging. (Before it was only showing when debugged).

Thank you very much for this helpful information.

That said, these issues are related to the Python extension, not the ROS extension. Because of this dependency, Melodic is not supported by current versions of the ROS extension

I understand. If you don't mind, may I ask you for a workaround please?

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

No branches or pull requests

3 participants