Rustdesk Connection Error 10054 just in a strage condition #785

Closed
opened 2026-02-20 23:10:33 -05:00 by deekerman · 6 comments
Owner

Originally created by @Emanuele971 on GitHub (Sep 14, 2022).

188713773-f0b4fe80-5a23-44f9-b1b3-9c39b50018bd

Hello, I have already open a issue for that but it has been closed without a solution, I try to explain better:

I set up my self-server Rustdesk in a Debian 11 evironment, following the official docs:
https://rustdesk.com/docs/en/self-host/install/
On my inaternal DNS I registered the URL linked to the LAN IP of my Rustdesk server .
For the outside (internet) I registered a record type "A" with the same URL which is resolved instead with my public IP.
After that I created the redirections for the ports indicated by the documentation, towards the LAN ip of my server:
21114:21119/tcp
8000/tcp
21116/udp
and I see traffic passing on these ports from my firewall.
For both clients I enter my url in the "server ID" setting and they both mark "ready"

Now, between two client connected outside my LAN (internet) It works!
Between two client connected inside my LAN, It works!
But between two client, one connected outside my LAN (internet) and one connected inside my LAN, it does not work!....😭
I get the error: Connection Error 10054 - An existing connection have go be close from the client.

In the previous ticket (1460), the support link me as solution the case #1343 that is linked as well to the cases #59 and some other.
Those cases shows these 3 solutions:

-ALWAYS_USE_RELAY=Y ./hbbs
-or put below into .env file: ALWAYS_USE_RELAY=Y
-You can try enable ALWAYS_USE_RELAY or try this build: https://github.com/21pages/tmp

Now, I dont understand how...
In my folder /opt/rustdesk/ I have just these files:

db_v2.sqlite3 db_v2.sqlite3-shm db_v2.sqlite3-wal hbbr hbbs id_ed25519 id_ed25519.pub

Which is the configuration file? Where i can enable ALWAYS_USE_RELAY?
The files hbbr and hbbs are not editable... when I open them with nano are like crypted.
I tried even to edit the file install.sh (downloaded from https://raw.githubusercontent.com/dinger1986/rustdeskinstall/master/install.sh following the ufficial docs), but i can't find the option "ALWAYS_USE_RELAY"
I have read someone saying: "ALWAYS_USE_RELAY=Y" or put below into .env file..."
but where is the .env files?

Thanks a lot in advance for your support.

Originally created by @Emanuele971 on GitHub (Sep 14, 2022). ![188713773-f0b4fe80-5a23-44f9-b1b3-9c39b50018bd](https://user-images.githubusercontent.com/112970750/190204895-51bc6ac1-102b-454d-bd07-b8739b0ae9b1.png) Hello, I have already open a issue for that but it has been closed without a solution, I try to explain better: I set up my self-server Rustdesk in a Debian 11 evironment, following the official docs: https://rustdesk.com/docs/en/self-host/install/ On my inaternal DNS I registered the URL linked to the LAN IP of my Rustdesk server . For the outside (internet) I registered a record type "A" **with the same URL which is resolved instead with my public IP**. After that I created the redirections for the ports indicated by the documentation, towards the LAN ip of my server: 21114:21119/tcp 8000/tcp 21116/udp **and I see traffic passing on these ports from my firewall.** For both clients I enter my url in the "server ID" setting and they both mark "ready"✅ Now, between two client connected outside my LAN (internet) It works! Between two client connected inside my LAN, It works! **But between two client, one connected outside my LAN (internet) and one connected inside my LAN, it does not work!....😭** I get the error: Connection Error 10054 - An existing connection have go be close from the client. In the previous ticket (1460), the support link me as solution the case #1343 that is linked as well to the cases #59 and some other. Those cases shows these 3 solutions: -ALWAYS_USE_RELAY=Y ./hbbs -or put below into .env file: ALWAYS_USE_RELAY=Y -You can try enable ALWAYS_USE_RELAY or try this build: https://github.com/21pages/tmp Now, I dont understand how... In my folder /opt/rustdesk/ I have just these files: db_v2.sqlite3 db_v2.sqlite3-shm db_v2.sqlite3-wal hbbr hbbs id_ed25519 id_ed25519.pub Which is the configuration file? Where i can enable ALWAYS_USE_RELAY? The files hbbr and hbbs are not editable... when I open them with nano are like crypted. I tried even to edit the file install.sh (downloaded from https://raw.githubusercontent.com/dinger1986/rustdeskinstall/master/install.sh following the ufficial docs), but i can't find the option "ALWAYS_USE_RELAY" I have read someone saying: "ALWAYS_USE_RELAY=Y" or put below into .env file..." but where is the .env files? Thanks a lot in advance for your support.
deekerman 2026-02-20 23:10:33 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Emanuele971 commented on GitHub (Sep 14, 2022):

Hi,
I have some additional information maybe usefull.
I used the command "netstat" on my Rustdesk server during the connection between 2 clients to check the connections incoming.
(during the test only 2 client are using this service.):

-CLIENT1 connected to LAN -> CLIENT2 connected to INTERNET1 - NOT WORKING
root@Rustdesk:~# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 Rustdesk:21116 lpointe-a-pitre-X:50175 TIME_WAIT
tcp 1 0 Rustdesk:21117 192.168.XXX.200:65230 ESTABLISHED
tcp 0 432 Rustdesk:ssh 192.168.XXX.200:58964 ESTABLISHED

-CLIENT1 connected to LAN -> CLIENT2 connected to INTERNET2 4G - NOT WORKING
root@Rustdesk:~# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 Rustdesk:21116 82.181.X.94.in-:26569 TIME_WAIT
tcp 0 0 Rustdesk:21117 192.168.XXX.200:65247 ESTABLISHED
tcp 0 0 Rustdesk:21116 82.181.X.94.in-:31055 TIME_WAIT
tcp 0 432 Rustdesk:ssh 192.168.XXX.200:58964 ESTABLISHED

-CLIENT1 connected to LAN -> CLIENT2 connected to INTERNET3 - NOT WORKING
root@Rustdesk:~# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 Rustdesk:21116 5.187.xxx.205:55338 TIME_WAIT
tcp 0 0 Rustdesk:21116 5.187.xxx.86:5968 TIME_WAIT
tcp 0 0 Rustdesk:21116 5.187.xxx.205:55340 FIN_WAIT2
tcp 0 0 Rustdesk:21116 5.187.xxx.86:38162 TIME_WAIT
tcp 0 0 Rustdesk:21116 5.187.xxx.205:55342 FIN_WAIT2
tcp 0 0 Rustdesk:21116 5.187.xxx.86:43077 TIME_WAIT
tcp 0 0 Rustdesk:21117 192.168.xxx.112:55341 ESTABLISHED
tcp 0 0 Rustdesk:21117 192.168.xxx.112:55333 ESTABLISHED
tcp 0 0 Rustdesk:21116 5.187.xxx.205:55336 FIN_WAIT2
tcp 0 432 Rustdesk:ssh 192.168.xxx.200:58964 ESTABLISHED
tcp 115 0 Rustdesk:21117 192.168.xxx.112:55337 ESTABLISHED
tcp 0 0 Rustdesk:21116 5.187.xxx.205:55332 FIN_WAIT2
tcp 0 0 Rustdesk:21116 5.187.xxx.205:55334 TIME_WAIT

-CLIENT1 connected to LAN -> CLIENT2 connected to INTERNET4 - NOT WORKING
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51698 TIME_WAIT
tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51703 TIME_WAIT
tcp 0 0 Rustdesk:21116 5.187.xxx.86:4760 TIME_WAIT
tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51706 TIME_WAIT
tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51708 FIN_WAIT2
tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51701 TIME_WAIT
tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51699 TIME_WAIT
tcp 0 0 Rustdesk:21115 5.187.xxx.86:5036 TIME_WAIT
tcp 0 0 Rustdesk:21116 5.187.xxx.86:43426 TIME_WAIT
tcp 0 432 Rustdesk:ssh 192.168.xxx.200:58964 ESTABLISHED
tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51700 TIME_WAIT
tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51704 TIME_WAIT
tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51702 TIME_WAIT

-CLIENT1 connected to LAN -> CLIENT2 connected to LAN - ** WORKING WELL**
root@Rustdesk:~# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 432 Rustdesk:ssh 192.168.xxx.200:58964 ESTABLISHED

"NO CONNECTION ARE SHOWED"

As I can see, in some cases for just 2 client there are few more connections incoming... maybe this is the cause of the error "Connection Error 10054 - An existing connection have go be close from the client".
But why this happen?

@Emanuele971 commented on GitHub (Sep 14, 2022): Hi, I have some additional information maybe usefull. I used the command "netstat" on my Rustdesk server during the connection between 2 clients to check the connections incoming. (during the test only 2 client are using this service.): -CLIENT1 connected to LAN -> CLIENT2 connected to INTERNET1 - **NOT WORKING** root@Rustdesk:~# netstat Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 Rustdesk:21116 lpointe-a-pitre-X:50175 TIME_WAIT tcp 1 0 Rustdesk:21117 192.168.XXX.200:65230 ESTABLISHED tcp 0 432 Rustdesk:ssh 192.168.XXX.200:58964 ESTABLISHED -CLIENT1 connected to LAN -> CLIENT2 connected to INTERNET2 4G - **NOT WORKING** root@Rustdesk:~# netstat Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 Rustdesk:21116 82.181.X.94.in-:26569 TIME_WAIT tcp 0 0 Rustdesk:21117 192.168.XXX.200:65247 ESTABLISHED tcp 0 0 Rustdesk:21116 82.181.X.94.in-:31055 TIME_WAIT tcp 0 432 Rustdesk:ssh 192.168.XXX.200:58964 ESTABLISHED -CLIENT1 connected to LAN -> CLIENT2 connected to INTERNET3 - **NOT WORKING** root@Rustdesk:~# netstat Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 Rustdesk:21116 5.187.xxx.205:55338 TIME_WAIT tcp 0 0 Rustdesk:21116 5.187.xxx.86:5968 TIME_WAIT tcp 0 0 Rustdesk:21116 5.187.xxx.205:55340 FIN_WAIT2 tcp 0 0 Rustdesk:21116 5.187.xxx.86:38162 TIME_WAIT tcp 0 0 Rustdesk:21116 5.187.xxx.205:55342 FIN_WAIT2 tcp 0 0 Rustdesk:21116 5.187.xxx.86:43077 TIME_WAIT tcp 0 0 Rustdesk:21117 192.168.xxx.112:55341 ESTABLISHED tcp 0 0 Rustdesk:21117 192.168.xxx.112:55333 ESTABLISHED tcp 0 0 Rustdesk:21116 5.187.xxx.205:55336 FIN_WAIT2 tcp 0 432 Rustdesk:ssh 192.168.xxx.200:58964 ESTABLISHED tcp 115 0 Rustdesk:21117 192.168.xxx.112:55337 ESTABLISHED tcp 0 0 Rustdesk:21116 5.187.xxx.205:55332 FIN_WAIT2 tcp 0 0 Rustdesk:21116 5.187.xxx.205:55334 TIME_WAIT -CLIENT1 connected to LAN -> CLIENT2 connected to INTERNET4 - **NOT WORKING** Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51698 TIME_WAIT tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51703 TIME_WAIT tcp 0 0 Rustdesk:21116 5.187.xxx.86:4760 TIME_WAIT tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51706 TIME_WAIT tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51708 FIN_WAIT2 tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51701 TIME_WAIT tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51699 TIME_WAIT tcp 0 0 Rustdesk:21115 5.187.xxx.86:5036 TIME_WAIT tcp 0 0 Rustdesk:21116 5.187.xxx.86:43426 TIME_WAIT tcp 0 432 Rustdesk:ssh 192.168.xxx.200:58964 ESTABLISHED tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51700 TIME_WAIT tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51704 TIME_WAIT tcp 0 0 Rustdesk:21116 lpointe-a-pitre-x:51702 TIME_WAIT -CLIENT1 connected to LAN -> CLIENT2 connected to LAN - ** WORKING WELL** root@Rustdesk:~# netstat Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 432 Rustdesk:ssh 192.168.xxx.200:58964 ESTABLISHED "NO CONNECTION ARE SHOWED" As I can see, in some cases for just 2 client there are few more connections incoming... maybe this is the cause of the error "Connection Error 10054 - An existing connection have go be close from the client". But why this happen?
Author
Owner

@Emanuele971 commented on GitHub (Sep 21, 2022):

Is there anyone?

@Emanuele971 commented on GitHub (Sep 21, 2022): Is there anyone?
Author
Owner

@rustdesk commented on GitHub (Sep 21, 2022):

https://github.com/rustdesk/rustdesk/issues/1343

@rustdesk commented on GitHub (Sep 21, 2022): https://github.com/rustdesk/rustdesk/issues/1343
Author
Owner

@Emanuele971 commented on GitHub (Sep 21, 2022):

Really guys? Have you at least read the description?

@Emanuele971 commented on GitHub (Sep 21, 2022): Really guys? Have you at least read the description?
Author
Owner

@coobic commented on GitHub (Oct 18, 2022):

Debian 11, no docker, latest build.

If environmental variable changed via:
/etc/systemd/system/rustdesksignal.service
Environment=ALWAYS_USE_RELAY=Y

Before:
[src/rendezvous_server.rs:154] ALWAYS_USE_RELAY=N

After:
[src/rendezvous_server.rs:154] ALWAYS_USE_RELAY=Y

But nothing helps, +1 to issue - connection cannot be established if one user is inside (LAN) and another is outside (WAN) (hbbr and hbbs in LAN).

Can anyone help with debug or only "RUST_LOG=debug cargo run"? (I don't see embedded debug keys or advanced logging settings).

@coobic commented on GitHub (Oct 18, 2022): Debian 11, no docker, latest build. If environmental variable changed via: /etc/systemd/system/rustdesksignal.service `Environment=ALWAYS_USE_RELAY=Y` Before: [src/rendezvous_server.rs:154] ALWAYS_USE_RELAY=N After: [src/rendezvous_server.rs:154] ALWAYS_USE_RELAY=Y But nothing helps, +1 to issue - connection cannot be established if one user is inside (LAN) and another is outside (WAN) (hbbr and hbbs in LAN). Can anyone help with debug or only "RUST_LOG=debug cargo run"? (I don't see embedded debug keys or advanced logging settings).
Author
Owner
@rustdesk commented on GitHub (Mar 8, 2023): https://github.com/rustdesk/rustdesk/issues/1597#issuecomment-1432517984
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rustdesk-rustdesk#785
No description provided.