Debugging not working on version 2.0.13615

Debugging not working on version 2.0.13615

Jorge_Jaramillo
Collaborator Collaborator
1,106 Views
9 Replies
Message 1 of 10

Debugging not working on version 2.0.13615

Jorge_Jaramillo
Collaborator
Collaborator

Hi,

After the update last Saturday to version 2.0.13615 the debugger is not working.

Here I describe 3 situations:

 

1. If I try to debug a script from Fusion360 (Utilities > Add-Ins > select script > Debug) it opens a new Fusion 360 application, instead of loading VSCode.

Same happen if I try to edit the script from Fusion360.

 

2. If I try to start the debugging from VsCode I receive the following error message:

Captura de pantalla 2022-07-18 192732.png

As you can see it trying to attach to port #9000 as it is defined both in launch.json and in the preference > General > API > Debugging Port

 

3. From windows command prompt I looked if the 9000 TCP was listening, but I found the following:

netstat -a -b (running cmd with admin privileges):

...

TCP 127.0.0.1:10790 Mcortelaser:0 LISTENING [node.exe]

TCP 127.0.0.1:10790 Mcortelaser:61895 ESTABLISHED[node.exe]

TCP 127.0.0.1:61895 Mcortelaser:10790 ESTABLISHED [Fusion360.exe]

...

which mean the port being used is 10790 instead of 9000.  Last 2 lines show Fusion360 is connected to Node with 10790 TCP port.

If I change to that value in launch.json, the error message in previous section is not shown, but still it couldn't attach to Fusion 360 App and non error messages appear on the debug console.

 

Anyone is experiencing the same problems?

 

Regards,

Jorge

0 Likes
1,107 Views
9 Replies
Replies (9)
Message 2 of 10

BrianEkins
Mentor
Mentor

It seems to be something specific with your machine. As you can see in the Screencast, I can debug a script using the latest version of Fusion.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 10

Jorge_Jaramillo
Collaborator
Collaborator

Thank you.

I'll try reinstalling it.

0 Likes
Message 4 of 10

Jorge_Jaramillo
Collaborator
Collaborator
I already uninstall and install Fusion 360 back on my PC, and everything seems to be as before.
The reinstallation did not solve the problem, so, same behavior as before.

I wonder if someone from Autodesk team could help me on this.

Regards,
Jorge
0 Likes
Message 5 of 10

BrianEkins
Mentor
Mentor

You probably have, but just in case, have you rebooted. I was having some weird behavior recently and tried a few things that didn't work and then rebooted, and everything was back to normal.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 6 of 10

Jorge_Jaramillo
Collaborator
Collaborator
Yes. I did reboot it many times.
0 Likes
Message 7 of 10

kandennti
Mentor
Mentor

@Jorge_Jaramillo .

 

I am also able to debug as normal.
It used to be affected by the ms-python version, but I haven't had any problems recently.
Here is my environment, just in case.

OS: win10 Pro(Home)
Fusion360:2.0.13618
VSCode:1.69.2
ms-python:python-2022.4.1

0 Likes
Message 8 of 10

Jorge_Jaramillo
Collaborator
Collaborator
Thank you @kandennti for your feedback.
All version match my environment, except for ms-python which is 2022.10.1 for me.

I believe the error comes from some configuration in Fusion360 which start NODE using TCP Port 10790 instead of 9000, as it is set in Preferences > General > API > Debugging Port.
Any value I set to it is ignored, and 10790 is used instead.
0 Likes
Message 9 of 10

KrisKaplan
Autodesk
Autodesk

Fusion runs a node server to serve the data panel, not API script debugging. API script debugging is done by running 

debugpy.listen(address=('127.0.0.1', %port%))

in Fusion's Python interpreter. Where %port% is the port defined in the API debugger port application option, which defaults to 9000.

Fusion starts debugpy when you edit or debug a script from the scripts and addins dialog. So the problem appears to be the fact that you cannot edit/debug (it just starts another instance of Fusion). So the question is why does editing a script end up launching Fusion for you?

 

There has been no recent changes to this area of the code in Fusion. All it does is:

  1. Attempt to determine if VSCode is installed (and prompt to install if it is not).
  2. Run a script in Fusion's python interpreter to setup some environment variables, make sure the script's python interpreter settings are correct, and start debugpy.
  3. Launch the VSCode application with the scripts path.

So the only process launch that should happen here (outside of the VSCode installation step) should be to start VSCode. This is done by finding the VSCode install path, and launching the bin/Code.cmd (on Windows, which it appears you are on). This is normally found in %localappdata%\Programs\Microsoft VS Code\bin\code.cmd. I'm not sure how during this process another instance of Fusion would be getting started. You could possibly try to uninstall VSCode and let Fusion reinstall and set it up again.

 

Grasping at straws... One thing that this sounds similar to this is a user reported an issue with using multiprocessing.dummy.Pool after the Python 3.9 update. In that case, the dummy.Pool was forking the current process (creating a second instance of Fusion when invoked). But I believe this was a Mac specific behavior. Is it possible that there is some code in your configuration (either triggered from debugpy or running in Fusion) that might be doing anything with Python multiprocessing?

 

Kris



Kris Kaplan
Message 10 of 10

Jorge_Jaramillo
Collaborator
Collaborator

Thank you @KrisKaplan for your answer.

 

My environment is working well now.

I checked it again and I was able to start debugging. 

All I did was a reboot yesterday.  Not software upgrades of any kind.

 

Sorry by my misunderstanding of about node module; I was able to confirm what you said, so it's python who start the debugger on TCP port 9000.

Regarding you last suggestion about dummy.Pool, I'd never used it.

 

Very estrange this error without a real solution.

 

Regards,

Jorge

 

 

0 Likes