The debugger seems to not work with the remote gateway tool
Using the versions shown below:


I am unable to successfully use the remote debugging feature of the perl plugin to code running on a different remote system than the remote system where I am running the remote IDE. I have to do this as my code can't run on the VM where my remote IDE runs and the remote IDE can't be run on the system where I can run the code.
On the system where I can run my perl I do:
PERL5OPT=-d:Camelcadedb path/to/my/test.t
which then prints:
Listening for the IDE connection at my.host.name:16510...
On the remote IDE on the other system that I'm accessing via the JetBrains Gateway I then click debug which is setup for a remote debugging on the other system.
On the system where I can run my perl I then see: path/to/my/test.t .. Listening for the IDE connection at my.host.name:16510...
I've never understood why that happens, but it has always happened and when debugging a test from a locally running IDE that's my cue to rerun the debugger from the IDE and then debugging will actually start to occur. So, given that, on this remote IDE I then rerun the debugger and it starts over and reconnects, but then it just hangs. If I wait long enough, I'll see this in the logs:
2022-01-27 13:08:49,846 [ 116015] WARN - .perl.debugger.PerlDebugThread - Socket closed java.net.SocketException: Socket closed at java.base/java.net.SocketInputStream.socketRead0(Native Method) at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115) at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168) at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140) at java.base/java.net.SocketInputStream.read(SocketInputStream.java:200) at com.perl5.lang.perl.debugger.PerlDebugThread.doRun(PerlDebugThread.java:201) at com.perl5.lang.perl.debugger.PerlDebugThread.run(PerlDebugThread.java:225)
And if I wait even longer, a lot of these:
2022-01-27 13:12:58,959 [ 365128] ERROR - - Illegal scheduler for current action, must be: com.jetbrains.rd.platform.protocol.EdtScheduler@670c6ac1, current thread: 117:PerlDebugThread
and then
2022-01-27 13:12:59,027 [ 365196] WARN - .perl.debugger.PerlDebugThread - !isLocalChange java.lang.IllegalArgumentException: !isLocalChange at com.jetbrains.rd.framework.base.RdReactiveBase.localChange$rd_framework(RdReactiveBase.kt:48) at com.jetbrains.rd.framework.impl.RdList.removeAt(RdList.kt:151) at com.jetbrains.rd.framework.impl.RdList.remove(RdList.kt:16) at com.jetbrains.rdserver.ui.converters.toTreeGrid.MyListModelListener.intervalRemoved(JListConverter.kt:149) at java.desktop/javax.swing.AbstractListModel.fireIntervalRemoved(AbstractListModel.java:184) at com.intellij.ui.SortedListModel.clear(SortedListModel.java:106) at com.perl5.lang.perl.debugger.ui.PerlScriptsPanel.clear(PerlScriptsPanel.java:114) at com.perl5.lang.perl.debugger.PerlDebugThread.prepareAndConnect(PerlDebugThread.java:137) at com.perl5.lang.perl.debugger.PerlDebugThread.doRun(PerlDebugThread.java:183) at com.perl5.lang.perl.debugger.PerlDebugThread.run(PerlDebugThread.java:225) 2022-01-27 13:12:59,545 [ 365714] ERROR - penapi.rd.util.RdCoroutineHost - Unhandled coroutine throwable java.lang.NullPointerException: xSuspendContext must not be null at com.jetbrains.rdserver.debugger.BackendDebuggerHost$syncDebugProcessToProtocol$3$sessionPaused$1.invokeSuspend(BackendDebuggerHost.kt:239) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at com.intellij.openapi.rd.util.RdCoroutineHost$uiDispatcher$1$dispatch$$inlined$invokeLater$1.run(actions.kt:60) at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214) at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21) at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805) at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:348) at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82) at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:131) at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47) at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:187) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) 2022-01-27 13:12:59,546 [ 365715] ERROR - penapi.rd.util.RdCoroutineHost - IntelliJ IDEA 2021.3.2 RC Build #IU-213.6777.38 2022-01-27 13:12:59,546 [ 365715] ERROR - penapi.rd.util.RdCoroutineHost - JDK: 11.0.13; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 2022-01-27 13:12:59,546 [ 365715] ERROR - penapi.rd.util.RdCoroutineHost - OS: Linux