API debugger doesn't work after Oct 2019 update

API debugger doesn't work after Oct 2019 update

lorraine5RWGT
Enthusiast Enthusiast
9,848 Views
15 Replies
Message 1 of 16

API debugger doesn't work after Oct 2019 update

lorraine5RWGT
Enthusiast
Enthusiast

Debugger doesn't work the way it did since the update at the end of September.  Clicked 'Debug' from the 'Add-in's  and Scripts' window, which opens VSCode, click on the Configuration thing that says 'Python: Attach', and I only get the error 'Failed to Attach'.

Accepted solutions (2)
9,849 Views
15 Replies
Replies (15)
Message 2 of 16

kdrector
Contributor
Contributor

Selecting "Debug" while starting an addin causes a second fusion 360 window to open.  

 

The original window meanwhile continued to run in non-debug mode.

 

A VSCode window was opened and displayed the source file as one would expect.  However, clicking "start debugging"  first showed the debug dropdown menu but then showed a dialog proclaiming "Failed to attach (connect ECONNREFUSED 127.0.0.1:9000)  - cancel   and  Open launch.json  buttons

About VSCode shows:

 

Version: 1.39.0
Commit: 9df03c6d6ce97c6645c5846f6dfa2a6a7d276515
Date: 2019-10-09T06:57:43.593Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 17.7.0

0 Likes
Message 3 of 16

goyals
Autodesk
Autodesk
Accepted solution

It is possible to install old version of PTVSD extension through UI. Please take a look at the attached image. Go back to version 2019.9.34911 and restart VSCode. Then try to follow the usual workflow of debugging. Let us know If you still see issue. Thanks.



Shyam Goyal
Sr. Software Dev. Manager
Message 4 of 16

goyals
Autodesk
Autodesk
Accepted solution

Please take a look at the attached video to overcome extension update issue. Do not forget to restart Fusion. Thanks.



Shyam Goyal
Sr. Software Dev. Manager
Message 5 of 16

lorraine5RWGT
Enthusiast
Enthusiast

Thanks, will try that out.


Another temporary workaround I found to at least get output from Python is to redirect stdout to a file: 

import sys
sys.stdout = open('D:\\Documents\\python_output.txt', 'w')

 

It doesn't print errors, though.  For errors, you can add in a try... except... and print the traceback, so that it's outputted to stdout.

0 Likes
Message 6 of 16

JuergenGe
Enthusiast
Enthusiast

The solutions do not work.

 

It has worked before the update (at some point).

 

I go to Add-Ins->Scripts and Add-Ins->myscript. Select Debug.

Then VSCode opens. Open the debug session. Press the play button left to the "Python: Attach".

 

And then i get this:

 

image.png

 

Seems to me, that Fusion 360 is blocking the request.

 

Tested on two independent Windows PCs.

 

Changing version of the Python plugin does not work.

 

Any ideas?

0 Likes
Message 7 of 16

JeromeBriot
Mentor
Mentor

@JuergenGe wrote:

Changing version of the Python plugin does not work.


Hello,

 

Did you restart Fusion 360?

 

0 Likes
Message 8 of 16

JuergenGe
Enthusiast
Enthusiast

Ok you got me there. 🙂

I should have read both solution completely.

Tried it again and restarted Fusion 360

Now it works again.

 

Can anybody explain why the older version of the Python extension is working?

0 Likes
Message 9 of 16

Anonymous
Not applicable

Hi! I downgraded the plugin to the recommended version and restarted Fusion 360, but it still doesn't work.

 

Any idea why? Anything I can try?

 

Thanks!

Etienne

 

fusion360-vscode-debug-error.png

 

fusion360-vscode-debug-error-version.png

 

fusion360-vscode-debug-config.png

 

0 Likes
Message 10 of 16

goyals
Autodesk
Autodesk

New version of python extension is not stable and lot of issues are already reported there. Once the bugs are fixed, we will consume it. Thanks.



Shyam Goyal
Sr. Software Dev. Manager
0 Likes
Message 11 of 16

Rushikesh.kadam
Autodesk
Autodesk

@Anonymous  while downgrading the plugin make sure that Fusion is closed. Close VS code once downgrade is done. Relaunch Fusion and check. This should work.

 

Thanks,

Rushikesh Kadam




Rushikesh Kadam
Senior QA Engineer
Quality Assurance
Autodesk, Inc.


0 Likes
Message 12 of 16

cyberreefguru
Advocate
Advocate

Sudden Fusion won't open VS for me (yes, I have the correct extremely dated version of python selected) - this is relatively recent as it worked about a month ago.

 

Is there a fix for this issue yet? It's been a year - I have to be believe whatever bugs existed then have been fixed by now? 

 

-Tom

--
Professional PowerPoint Jockey...
0 Likes
Message 13 of 16

pludikar
Collaborator
Collaborator

@cyberreefguru wrote:

...

 

- I have to be believe whatever bugs existed then have been fixed by now? 


Nah.  There have been too many bugs that I've reported that are still open, or at least, not obviously addressed.  It's clearly more important for F360 to create new features than to spend time fixing basic foundational stuff.

I'm not an expert, but I know enough to be very, very dangerous.

Life long R&D Engineer (retired after 30+ years in Military Communications, Aerospace Robotics and Transport Automation).
0 Likes
Message 14 of 16

JeromeBriot
Mentor
Mentor

Hello,

 

Close VS Code and Fusion 360.

 

Then remove the ms-python.python-XXXX.X.XXXXXX folders located in C:\Users\<USERNAME>\.vscode\extensions on Windows or /Users/<USERNAME>/.vscode/extensions on Mac

 

Open Fusion 360 and try to edit a script.

Message 15 of 16

Anonymous
Not applicable

Hello,

 

I have an unorthodox beginners question. The aforementioned procedure worked perfectly for me. Yesterday. As of today Fusion 360 again fails to show me the source code in VSC. I followed the procedure several times. Without success.

ms-python.python-2019.9.34911 is the only installed version.

Can anybody help me with some advice ?

 

BR

 

M

0 Likes
Message 16 of 16

michael_koehle
Autodesk
Autodesk

Thanks for the solution. Can I suggest an actual video rather than a gif? There's no pausing a gif. 

0 Likes