Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

socket.timeout: timed out

16 REPLIES 16
SOLVED
Reply
Message 1 of 17
kandennti
2188 Views, 16 Replies

socket.timeout: timed out

If you know, please.

 

The following error appears during debugging with Fusion360 (2.0.7402) + VSCode python (ms-python-2019.9.34911) and operation becomes impossible.
(It is necessary to restart Fusion360.)

Exception in thread ptvsd.Server:
Traceback (most recent call last):
  File "C:\Users\<UserName>\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\lib\python\ptvsd\ipcjson.py", line 269, in process_one_message
    msg = self.__message.pop(0)
IndexError: pop from empty list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\<UserName>\AppData\Local\Autodesk\webdeploy\production\9eb6e3e95b2f4cf7bb2f804604f4040b86fc00dd\Python\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\Users\<UserName>\AppData\Local\Autodesk\webdeploy\production\9eb6e3e95b2f4cf7bb2f804604f4040b86fc00dd\Python\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\<UserName>\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\lib\python\ptvsd\wrapper.py", line 536, in process_messages
    raise exc
  File "C:\Users\<UserName>\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\lib\python\ptvsd\wrapper.py", line 521, in process_messages
    self.process_messages()
  File "C:\Users\<UserName>\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\lib\python\ptvsd\ipcjson.py", line 258, in process_messages
    self.process_one_message()
  File "C:\Users\<UserName>\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\lib\python\ptvsd\ipcjson.py", line 272, in process_one_message
    self._wait_for_message()
  File "C:\Users\<UserName>\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\lib\python\ptvsd\ipcjson.py", line 154, in _wait_for_message
    line = self._buffered_read_line_as_ascii()
  File "C:\Users\<UserName>\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\lib\python\ptvsd\ipcjson.py", line 113, in _buffered_read_line_as_ascii
    temp = self.__socket.recv(1024)
socket.timeout: timed out

1.png

This suspends execution at a breakpoint, regardless of code, and appears after a certain period of time and becomes inoperable.

 

Do you have the same experience?
Is this relevant?

https://forums.autodesk.com/t5/fusion-360-api-and-scripts/my-custom-toolbarcontrols-are-disabled-in-... 

 

Thanks in advance.

16 REPLIES 16
Message 2 of 17
kandennti
in reply to: kandennti

I could debug at home without any problems, so I knew that Update was not the cause.

 

I did not know how to deal with it, so I reinstalled Fusion360 after clean uninstall.

https://knowledge.autodesk.com/support/fusion-360/learn-explore/caas/sfdcarticles/sfdcarticles/How-t... 

 

I'm working fine now.

Message 3 of 17
kandennti
in reply to: kandennti

After the update the other day, the same situation has come up again.

 

・Win10 Pro
・Fusion360 Ver2.0.8560
・VSCode Ver1.46.1
・ms-Pythpn Ver2020.6.90262

 

I reinstalled Fusion 360 again after a clean uninstall, but the situation remains the same.
Do you have the same situation?
Does anyone know how to deal with it?

Message 4 of 17
BrianEkins
in reply to: kandennti

I'm having the same problem.  Something has changed in VS Code or the Python extension.  I know Autodesk is investigating it.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 5 of 17
kandennti
in reply to: BrianEkins

Thanks @BrianEkins .

 

I was relieved to know that I was not the only one.

Unfortunately, older versions of ms-python cannot be installed.

Message 6 of 17
Duracellman425
in reply to: kandennti

Any updates/solutions to this issues? I am also dealing with it as well.

Message 7 of 17
kandennti
in reply to: Duracellman425

Message 8 of 17
OceanHydroAU
in reply to: kandennti

Yes - I see the same on Macbook Pro too.

 

It looks like a timeout has been added (or catering for that exception has been removed) on the socket connection that gets made between Fusion360 and Visual-Studio-Code.

 

It might be the fault of...

a) Fusion360

b) VSCode

c) The debugging subsystem inside VSCode

 

Is anyone who is suffering this problem absolutely sure they have not updated either VSCode, or allowed it to update any of its own components?

 

Unfortunately, I went and installed a bunch of VSCode extensions for other reasons, so now I can't be sure where the problem came from.

Message 9 of 17
akonovalenko
in reply to: OceanHydroAU

Any updates on this? 
I got in the same issue and can not debug my Fusion Extension anymore 😞

Please help... 

Message 10 of 17
akonovalenko
in reply to: akonovalenko

I think I have found the solution. 

I have installed an old version of ms-python.python-2020.5.78807 extension for VSCode because it works for me in another issue https://forums.autodesk.com/t5/fusion-360-api-and-scripts/not-able-to-debug-scripts-add-ins-in-visua...

It can be downloaded from Microsoft GitHub: 
https://github.com/microsoft/vscode-python/releases/tag/2020.5.78807

Screenshot_13.png

 

 

Screenshot_12.png

 

PS: Do not forget to disable Extension Autoupdate otherwise it will stop working ideally after VSCOde update it to the latest version
Screenshot_11.png

Message 11 of 17
OceanHydroAU
in reply to: akonovalenko

One thing I tried was "doing things" a lot when in breakpoints - i.e. - forcing the socket to do at least some communications frequently (e.g. using the command-line to show the contents of a variable) - this at least seemed to keep it open and working for slightly longer.

 

Hmm.  Is there a way to run "loops" on the commandline?  That could possibly work to automatically force it not to time-out?

 

One thing I attempted with no luck: I've been testing on a heap of different platforms, so I had some machines that had not been updated (but without VSCode on them unfortunately) - I attempted to copy all the old fusion code off those - Fusion (old version) ran fine - but the timeout problem was still there.

 

I next copied a pile of old VSCode stuff off a different PC to see if the problem was in there - also didn't fix it.

 

I also found old versions of all the modules that show up in the errors, and put all those back - didn't fix it either.

 

Ideas I've not investigated... try to find out what socket it's using (e.g. maybe it's TCP, or a native OS one), and run some other process on my box to send junk at the socket in a loop, with a small sleep inbetween: in theory, it might keep something open (long shot - it's probably an established connection timing-out, and if it's TCP, that would make new connections...)

 

Are there any VSCode add-ins or tools or other utilities that might cause socket traffic? (timing things, or memory watchers, or IO monitors, or anything...)  using things stops them timing out...

 

I've got other things to keep me occupied while I wait for them to fix this, so I've got no need to dive in and fix the bug myself - but if anyone really needs me to do that, shout out and I'll have a go.

Message 12 of 17
OceanHydroAU
in reply to: akonovalenko

Tantalizing hints!!

What version number should we see after following your instructions?

I did all the above, but I still see the problem [on mac] 😞

 

the ms-python-release.vsix you linked gave me this one:-

 

Screen Shot 2020-07-11 at 12.25.45 am.png

 

 

Message 13 of 17
kandennti
in reply to: akonovalenko

@akonovalenko  Thank you very much for the valuable information.


I tried it immediately, but ms-python2020.5.78807 didn't solve it.
Just in case, I also tried ms-python 2019.9.34911, but the situation did not change.

Message 14 of 17
OceanHydroAU
in reply to: kandennti

I fussed around with PTVSD SOCKET TIMEOUT and the bug symptoms, but that seems to be the wrong idea.

 

It looks like one end is telling the other end to expect N packets, but it only sending N-1 and that's the root cause of the empty-pop which causes the "wait for another message" which eventually triggers the timeout 😞

 

I can't tell if the problem is Fusion360 or vscode or the PTVSD subsystem - and while I usually keep great backups, I don't have anything that's not suffered its own update unfortunately (curse that auto-update option in vscode!!!)

Message 15 of 17
BrianEkins
in reply to: OceanHydroAU

This has been fixed in the latest fixes update this week.

 

Earlier, I also had problems with Intellisense in VS Code but that also seems to be working now as of the last couple of weeks.  It had always worked on one of my computers and never worked on the other but now it's working on both of them.  Is anyone else having issues with Intellisense in VS Code?

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 16 of 17
kandennti
in reply to: BrianEkins

Thanks @BrianEkins .
The problem seems to be solved.

・Win10 Pro
・Fusion360 Ver2.0.8624

・VSCode Ver1.47.1
・ms-Pythpn Ver2020.6.91350

 

Intellisense is also working for me.

Message 17 of 17

The problem was solved in my environment, too.

 

  • Win10 Pro
  • Fusion360 Ver2.0.8624
  • VSCode Ver1.44.0
  • ms-python Ver2020.5.86806

Thank you so much!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report