JesusFreke / fusionIdea

Fusion 360 Plugin for Intellij IDEA
Other
22 stars 11 forks source link

Connection to Python debugger failed, Accept timed out #25

Open woutermoons opened 10 months ago

woutermoons commented 10 months ago

Hi, I'm having trouble with the connection Fusion 360, latest version Fusion 360 Scripting v0.6.6 PyCharm 2023.2.5 (prof) (not supported I know) PyCharm 2022.2.5(com.) (supported)

interpreter: fusion360, fusion 360 support enabled. I can start a script, and fusion excepts the public key, but once entered I'm not able to attach to the process and get the following error: Connection to Python debugger failed, Accept timed out. And nothing is happening. This is in both versions of Pycharm. Any Idea's how to fix this?

woutermoons commented 10 months ago

Found some sort of error log: java.lang.UnsupportedOperationException at java.base/java.util.Collections$UnmodifiableList.sort(Collections.java:1369) at java.base/java.util.Collections.sort(Collections.java:179) at org.jf.fusionIdea.run.FusionRunConfigurationEditor.setSdkHome(FusionRunConfigurationEditor.java:174) at org.jf.fusionIdea.run.FusionRunConfigurationEditor.(FusionRunConfigurationEditor.java:110) at org.jf.fusionIdea.run.FusionRunConfiguration.getConfigurationEditor(FusionRunConfiguration.java:81) at com.intellij.execution.impl.ConfigurationSettingsEditorWrapper.createWrapper(ConfigurationSettingsEditorWrapper.java:193) at com.intellij.execution.impl.SingleConfigurationConfigurable.(SingleConfigurationConfigurable.java:77) at com.intellij.execution.impl.SingleConfigurationConfigurable.editSettings(SingleConfigurationConfigurable.java:116) at com.intellij.execution.impl.RunDialog.editConfiguration(RunDialog.java:107) at com.intellij.execution.impl.RunDialog.editConfiguration(RunDialog.java:95) at com.intellij.execution.actions.CreateAction$EditPolicy.perform(CreateAction.java:91) at com.intellij.execution.actions.CreateAction.perform(CreateAction.java:34) at com.intellij.execution.actions.BaseRunConfigurationAction.actionPerformed(BaseRunConfigurationAction.java:130) at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:339) at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:313) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:362) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:313) at com.intellij.openapi.actionSystem.ex.ActionUtil.invokeAction(ActionUtil.java:538) at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:266) at com.intellij.ui.popup.ActionPopupStep.lambda$onChosen$3(ActionPopupStep.java:243) at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1625) at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:173) at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:33) at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.kt:210) at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.kt:176) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:169) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:163) at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1623) at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:165) at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:394) at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.dispose(PopupFactoryImpl.java:293) at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:129) at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:161) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:262) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:250) at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:273) at com.intellij.ui.popup.list.ListPopupImpl.disposePopup(ListPopupImpl.java:496) at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:523) at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:483) at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:429) at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.handleSelect(PopupFactoryImpl.java:305) at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:699) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385) at com.intellij.ui.popup.list.ListPopupImpl$MyList.processMouseEvent(ListPopupImpl.java:764) at java.desktop/java.awt.Component.processEvent(Component.java:6422) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4954) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4581) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4522) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2808) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:763) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:690) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:638) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:592) at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:997) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:997) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

JesusFreke commented 10 months ago

I suspect this issue is fixed in v0.6.7. I'm having some problems getting it accepted into the jetbrains plugin repository. You can try downloading the new version from https://github.com/JesusFreke/fusionIdea/releases/tag/v0.6.7 and install it manually.

On Thu, Nov 30, 2023 at 8:25 AM woutermoons @.***> wrote:

Found some sort of error log: java.lang.UnsupportedOperationException at java.base/java.util.Collections$UnmodifiableList.sort(Collections.java:1369) at java.base/java.util.Collections.sort(Collections.java:179) at org.jf.fusionIdea.run.FusionRunConfigurationEditor.setSdkHome(FusionRunConfigurationEditor.java:174) at org.jf.fusionIdea.run.FusionRunConfigurationEditor.(FusionRunConfigurationEditor.java:110) at org.jf.fusionIdea.run.FusionRunConfiguration.getConfigurationEditor(FusionRunConfiguration.java:81) at com.intellij.execution.impl.ConfigurationSettingsEditorWrapper.createWrapper(ConfigurationSettingsEditorWrapper.java:193) at com.intellij.execution.impl.SingleConfigurationConfigurable.(SingleConfigurationConfigurable.java:77) at com.intellij.execution.impl.SingleConfigurationConfigurable.editSettings(SingleConfigurationConfigurable.java:116) at com.intellij.execution.impl.RunDialog.editConfiguration(RunDialog.java:107) at com.intellij.execution.impl.RunDialog.editConfiguration(RunDialog.java:95) at com.intellij.execution.actions.CreateAction$EditPolicy.perform(CreateAction.java:91) at com.intellij.execution.actions.CreateAction.perform(CreateAction.java:34) at com.intellij.execution.actions.BaseRunConfigurationAction.actionPerformed(BaseRunConfigurationAction.java:130) at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:339) at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:313) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:362) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:313) at com.intellij.openapi.actionSystem.ex.ActionUtil.invokeAction(ActionUtil.java:538) at com.intellij.ui.popup.ActionPopupStep.performAction(ActionPopupStep.java:266) at com.intellij.ui.popup.ActionPopupStep.lambda$onChosen$3(ActionPopupStep.java:243) at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1625) at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$3(FocusManagerImpl.java:173) at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:33) at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.kt:210) at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.kt:176) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:169) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:163) at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1623) at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:165) at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:394) at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.dispose(PopupFactoryImpl.java:293) at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:129) at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:161) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:262) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:250) at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:273) at com.intellij.ui.popup.list.ListPopupImpl.disposePopup(ListPopupImpl.java:496) at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:523) at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:483) at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:429) at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.handleSelect(PopupFactoryImpl.java:305) at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:699) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385) at com.intellij.ui.popup.list.ListPopupImpl$MyList.processMouseEvent(ListPopupImpl.java:764) at java.desktop/java.awt.Component.processEvent(Component.java:6422) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4954) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4581) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4522) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2808) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:763) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:690) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:638) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:592) at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:997) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:997) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

— Reply to this email directly, view it on GitHub https://github.com/JesusFreke/fusionIdea/issues/25#issuecomment-1833879187, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAZ7D7WFIVA5ETF6OKPLULYHCJO3AVCNFSM6AAAAABABELI6GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZTHA3TSMJYG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

woutermoons commented 10 months ago

That seems to solve it! Got it working in both Pycharm versions. Need to mention that starting a new project from scratch in the proffessional edition does not work out of the box. opening the one from the community edition then works, for some reason the professional does not create a new project with sytstem interpreter fusion 360 selected... but debugging seems to works so thanks!

JesusFreke commented 10 months ago

I just published v0.6.8, which may fix your problems with pycharm professional. I was able to go through the new project creation flow, etc. (in the EAP professional build, which apparently doesn't require a license)

Hopefully it will make it into the intellij plugin repository, but if not, it's available for download on the associated github release.

woutermoons commented 10 months ago

@JesusFreke Thanks for releasing the 0.6.9. Tried this on the comm. version, and it is not ready out of the box. Need to mention fusion has updated in between. So I install the 0.6.9, and follow the "Getting started with PyCharm", I see some differences in the pro and comm. version. In the comm version, the logo is that of fusion. in the pro, it keeps the python logo.

comm pro

An other thing I noticed is the folder source folder structure is not as it was with the previous release. However, this could be due the update in fusion. Now I need to add the (releasehash)/API/Python folder as source in Pycharm else the only libraries are as follows (both pro and comm): comm_lib and no reference to adsk.

But to be honnest, have no idea if the plugin does any to fix this, but I would make a mention in the "Getting started with PyCharm" to include some source folders.

Main thing is, the debugger coupling to fusion works as a (Py)charm :-)

JesusFreke commented 10 months ago

Thanks for taking a look and trying it out. I'll take a look and see if I can reproduce these issues, although it seemed to be working pretty well for me when I tried it on the PyCharm professional beta EAP.

Although now that I think about it, I did just run a pretty basic "hello world" test, so maybe the fusion-specific libs weren't added in, and I just didn't notice it.

Oh, also, what version of community and professional are you using?

woutermoons commented 10 months ago

I'm using: PyCharm 2023.2.5 (pro) (not supported I know) PyCharm 2022.2.5(com.) (supported -> just for testing)

JesusFreke commented 10 months ago

Oh, I just realized/remembered you already mentioned that. Sorry! :)

JesusFreke commented 10 months ago

I know there are some changes with how python sdks are handled at some point in PyCharm, although I don't know exactly where in the PyCharm release schedule that falls. But I'm betting that the 2023.3.5 probably has those changes, and 2022.2.5 doesn't. There may not be much I can do until/unless jetbrains adds back in better support for managing custom python sdks. See, e.g. https://github.com/JetBrains/intellij-community/pull/2537

But I haven't looked at this closely yet, so I'm not sure what options may be available yet.

woutermoons commented 10 months ago

Since everything is working as expected, I would only adjust the getting started with pycharm script and add a note that the source files should be added in the settings/Project: ProjectName/Project Structure add the API fusion folder as source. that solved evertything...