[GH-ISSUE #1221] failed to connect to server: connection refused #982

Closed
opened 2026-05-05 07:21:11 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @ghost on GitHub (Jul 3, 2021).
Original GitHub issue: https://github.com/debauchee/barrier/issues/1221

Operating Systems

Server: macOS Big Sur 11.4
Client: Ubuntu Desktop 21.04

Barrier Version

2.3.3 (client and server)

Steps to reproduce bug

Start server on mac
Start client on ubuntu auto config
...nothing happens
manually configure client with server ip
... nothing happens

Log from Server (This repeats)

[2021-07-02T23:21:43] ERROR: cannot listen for clients: cannot bind address: Address already in use

Log from client (This repeats)

info: starting client
info: config file: /tmp/Barrier.L50056
info: log level: info
note: started client
note: connecting to '': :::24800
info: OpenSSL 1.1.1 11 Sep 2018
Warning: failed to connect to server: connection refused
info: stopping barrier desktop process
note: connecting to '': :::24800
info: openSSL 1.1.1 11 Sep 2018
note: stopped client
info: process exited normally

Other details

  • I have tried to reverse it with ubuntu server and mac client, doesn't work.

  • I do not have a firewall turned on

  • I have configured my server to have the other screen with a reasonable name to it

  • On the server side, two ip addresses show but neither one is bold

  • To see if port 24800 was open on both sides I ran
    $ sudo lsof -i 24800

      - The client side results
    

COMMAND PID USR FD TYPE DEVICE SIZE/OFF NODE NAME
barriers 31668 Tal 3u IPv6 0x5dd4494fce1f20c1 0t0 TCP *:24800 (LISTEN)
barriers 31668 Tal 8u IPv6 0x5dd4494fc35f5741 0t0 TCP localhost:24800->localhost:59835 (CLOSE_WAIT)
barriers 31668 Tal 9u IPv6 0x5dd4494fc853aa61 0t0 TCP 10.40.59.96:24800->10.40.59.96:59861 (CLOSE_WAIT)
barriers 31668 Tal 10u IPv6 0x5dd4494fc8539da1 0t0 TCP 10.40.59.96:24800->10.40.59.96:59882 (CLOSE_WAIT)
barriers 31668 Tal 12u IPv6 0x5dd4494fc35f6a61 0t0 TCP 10.40.59.96:24800->10.40.59.96:60299 (CLOSE_WAIT)

    - The server side results

commandrc pid user FD Type Device size/off Node Name
barrierc 48100 tal 6u IPv4 144298 0t0 TCP tal-desktop:40116->10.40.59.96:24800 (SYN_SENT)

Originally created by @ghost on GitHub (Jul 3, 2021). Original GitHub issue: https://github.com/debauchee/barrier/issues/1221 ## Operating Systems Server: macOS Big Sur 11.4 Client: Ubuntu Desktop 21.04 ## Barrier Version 2.3.3 (client and server) ### Steps to reproduce bug Start server on mac Start client on ubuntu auto config ...nothing happens manually configure client with server ip ... nothing happens #### Log from Server (This repeats) [2021-07-02T23:21:43] ERROR: cannot listen for clients: cannot bind address: Address already in use #### Log from client (This repeats) info: starting client info: config file: /tmp/Barrier.L50056 info: log level: info note: started client note: connecting to '': :::24800 info: OpenSSL 1.1.1 11 Sep 2018 Warning: failed to connect to server: connection refused info: stopping barrier desktop process note: connecting to '': :::24800 info: openSSL 1.1.1 11 Sep 2018 note: stopped client info: process exited normally ### Other details - I have tried to reverse it with ubuntu server and mac client, doesn't work. - I do not have a firewall turned on - I have configured my server to have the other screen with a reasonable name to it - On the server side, two ip addresses show but neither one is bold - To see if port 24800 was open on both sides I ran $ sudo lsof -i 24800 - The client side results COMMAND PID USR FD TYPE DEVICE SIZE/OFF NODE NAME barriers 31668 Tal 3u IPv6 0x5dd4494fce1f20c1 0t0 TCP *:24800 (LISTEN) barriers 31668 Tal 8u IPv6 0x5dd4494fc35f5741 0t0 TCP localhost:24800->localhost:59835 (CLOSE_WAIT) barriers 31668 Tal 9u IPv6 0x5dd4494fc853aa61 0t0 TCP 10.40.59.96:24800->10.40.59.96:59861 (CLOSE_WAIT) barriers 31668 Tal 10u IPv6 0x5dd4494fc8539da1 0t0 TCP 10.40.59.96:24800->10.40.59.96:59882 (CLOSE_WAIT) barriers 31668 Tal 12u IPv6 0x5dd4494fc35f6a61 0t0 TCP 10.40.59.96:24800->10.40.59.96:60299 (CLOSE_WAIT) - The server side results commandrc pid user FD Type Device size/off Node Name barrierc 48100 tal 6u IPv4 144298 0t0 TCP tal-desktop:40116->10.40.59.96:24800 (SYN_SENT)
Author
Owner

@sepkov commented on GitHub (Jul 3, 2021):

Server says port is in use. Change barrier server's port or check which app is using that port.

<!-- gh-comment-id:873419124 --> @sepkov commented on GitHub (Jul 3, 2021): Server says port is in use. Change barrier server's port or check which app is using that port.
Author
Owner

@ghost commented on GitHub (Jul 3, 2021):

I wrote this as if I was a non-techi so no more after me would labor so long for such a simple fix.

I fixed it, turns out I had to change the name of my client on my server configuration to match the client name on the client side, then I had to use ifconfig on my mac(server side) to get the actual ip, turns out the ip's being displayed in barrier were all wrong. When both my mac and pi were connected to the same wifi (apartment's wifi), I pinged my mac's(server side) ip from my raspberry pi(client side) running ubuntu to learn that they could not talk even. They are on the same wifi so it's just strange wtf idk.... So I put both them both on my iphone's hotspot ran ifconfig again on my mac to get my mac's(server side) ip address (the eth0 ipv4 address) then on my rasperberry pi(client side) I unclicked the autoconfig entered my mac's ip and boom it worked.

<!-- gh-comment-id:873444711 --> @ghost commented on GitHub (Jul 3, 2021): #### I wrote this as if I was a non-techi so no more after me would labor so long for such a simple fix. I fixed it, turns out I had to change the name of my client on my server configuration to match the client name on the client side, then I had to use `ifconfig` on my mac(server side) to get the actual ip, turns out the ip's being displayed in barrier were all wrong. When both my mac and pi were connected to the same wifi (apartment's wifi), I pinged my mac's(server side) ip from my raspberry pi(client side) running ubuntu to learn that they could not talk even. They are on the same wifi so it's just strange wtf idk.... So I put both them both on my iphone's hotspot ran `ifconfig` again on my mac to get my mac's(server side) ip address (the eth0 ipv4 address) then on my rasperberry pi(client side) I unclicked the autoconfig entered my mac's ip and boom it worked.
Author
Owner

@dondell commented on GitHub (Apr 10, 2022):

Make sure both port number in server and client are the same.
image

<!-- gh-comment-id:1094278377 --> @dondell commented on GitHub (Apr 10, 2022): Make sure both port number in server and client are the same. ![image](https://user-images.githubusercontent.com/4174860/162621203-84ebb7de-a4b0-4efb-abf6-d5476c089c59.png)
Author
Owner

@kimihuang commented on GitHub (Nov 20, 2023):

I faced the same problem of 'Connection refused' as well.
I have a Mac server and an Ubuntu client. Previously, I could connect without any problems. However, the Mac's IP address changed, resulting in a failed connection. Therefore, the solution to this issue is to simply update the client's IP address to connect to the server.

<!-- gh-comment-id:1818091493 --> @kimihuang commented on GitHub (Nov 20, 2023): I faced the same problem of 'Connection refused' as well. I have a Mac server and an Ubuntu client. Previously, I could connect without any problems. However, the Mac's IP address changed, resulting in a failed connection. Therefore, the solution to this issue is to simply update the client's IP address to connect to the server.
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: github-starred/barrier#982
No description provided.