# JetBrains Gateway: Connection is not reestablished after IDE is restarted

**URL:** <https://platform.jetbrains.com/t/jetbrains-gateway-connection-is-not-reestablished-after-ide-is-restarted/2975>\
**Category:** IntelliJ Platform\
**Tags:** remote-development\
**Created:** [October 23, 2025, 4:01pm UTC](https://platform.jetbrains.com/t/jetbrains-gateway-connection-is-not-reestablished-after-ide-is-restarted/2975 "2025-10-23T16:01:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adietish](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/adietish/32/592_2.png) [@adietish](https://platform.jetbrains.com/u/adietish)\
**Post date:** [October 23, 2025, 4:01pm UTC](https://platform.jetbrains.com/t/jetbrains-gateway-connection-is-not-reestablished-after-ide-is-restarted/2975/1 "2025-10-23T16:01:40Z")

</div>

Hi,

I am experiencing an issue that looks to me like a problem in the JetBrains `ThinClientHandle`.  
I am developing a plugin for the JetBrains Gateway, Eclipse-Che/OpenShift Dev Spaces to be specific. We are running the `remote-dev-server` on a pod/container, port-forwarding to it.  
If I restart the IDE the main window is closed and replaced by a Dialog “Connecting to the remote host…” and never succeeds to (re-) connect.

 ![image](https://us1.discourse-cdn.com/flex001/uploads/jetbrains_platform/original/2X/3/339d74c43d9f66e76f01c684b151cfe323533437.png)  
My `ThinClientHandle` never gets notified via any of the following callbacks:

- `client.lifetime.onTerminated {...}`
- `client.onClientPresenceChanged.advise(client.lifetime) {...}`
- `client.clientClosed.advise(client.lifetime) {...}`

Behind the scenes I see the port-forwarding being shut down. Reestablishing it doesn’t heal the client, it keeps trying to connect.  
I also failed to close the dialog so that I can create a new ThinClientHandle.

I’d appreciate any hints/help, thanks a lot!

For reference, our issue is here:

> <https://github.com/eclipse-che/che/issues/23587>
>
> \### Describe the bug
> 
> When you restart the IDE, the gateway automatically tries …to reconnect to the remote IDE. This doesn't work. You need to cancel the dialog that tries to reconnect and do it manually.
> 
> \### Che version
> 
> 7.109@latest
> 
> \### Steps to reproduce
> 
> 1. ASSERT: have a running remote IDE
> 2. EXEC: go File \> Invalidate caches \> Just Restart
> 
> \*\*Result:\*\*
> The Window of the remote IDE is closed and a dialog "Connecting to remote host" appears. It stays there trying to connect even once the remote IDE was successfully restarted.
> 
> \<img width="343" height="169" alt="Image" src="https://github.com/user-attachments/assets/0db52575-c3cd-4a25-b532-fb7ed71cea8a" /\>
> 
> You need to cancel the dialog and manually connect again.
> 
> 
> \### Expected behavior
> 
> Reconnecting should succeed and not force me to cancel the automatic reconnect and manually connecting.
> 
> \### Runtime
> 
> OpenShift
> 
> \### Screenshots
> 
> \_No response\_
> 
> \### Installation method
> 
> other (please specify in additional context)
> 
> \### Environment
> 
> Dev Sandbox (workspaces.openshift.com)
> 
> \### Eclipse Che Logs
> 
> \`\`\`shell
> 
> \`\`\`
> 
> \### Additional context
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![deprecated](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/deprecated/32/326_2.png) [@deprecated](https://platform.jetbrains.com/u/deprecated)\
**Post date:** [October 30, 2025, 3:34pm UTC](https://platform.jetbrains.com/t/jetbrains-gateway-connection-is-not-reestablished-after-ide-is-restarted/2975/3 "2025-10-30T15:34:00Z")

</div>

Hi @adietish , can you please provide the logs for the client, host, and gateway?
