[GH-ISSUE #546] Barrier can resolve via numeric IP but not Avahi mDNS #426

Open
opened 2026-05-05 06:21:48 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @detly on GitHub (Jan 24, 2020).
Original GitHub issue: https://github.com/debauchee/barrier/issues/546

The client connects to the server just fine when using the numeric IP address. It does not connect when given the Avahi mDNS server address.

I can live with using numeric IP addresses, but it's nice not to have to. Plus it seems odd that only one piece of software on the client machine can't resolve using Avahi.

Operating Systems

Server: Ubuntu 19.10 (eoan)

Client: Ubuntu 18.04.3 LTS (bionic)

Server is a Lenovo laptop, connected via wifi. Hostname and screen name is "aang".

Client is a Mac Mini 2016, connected via ethernet. Hostname and screen name is "fox".

Barrier Version

Server: installed via apt 2.3.1+dfsg-1ubuntu1

Client: installed via Snap:

~ ⌘ sudo snap list barrier
Name     Version             Rev  Tracking  Publisher      Notes
barrier  2.3.2-13-g9080ce45  83   stable    adrianceleste  -

Steps to reproduce bug

Server:

  1. Log in to desktop environment.
  2. Launch Barrier.
  3. Check "server", configure layout interactively (server on left, client on right). IP address is 192.168.1.231, confirmed via ip addr show.
  4. Click start. The server starts.

Client:

  1. Log in to desktop environment.
  2. Launch Barrier.
  3. Check "client", set server IP to 192.168.1.231.
  4. Click start.

It works!

Now try:

Client:

  1. Set server IP to aang.local.

It does not connect. See log below.

Other info

  • When did the problem start to occur? First install.
  • Is there a way to work around it? Yes, use numeric IP address.
  • Does this bug prevent you from using Barrier entirely? No.

Avahi works fine for everything else. From client:

~ ⌘ avahi-resolve --name -4 aang.local
aang.local	192.168.1.231
~ ⌘ ping aang.local
PING aang.local (192.168.1.231) 56(84) bytes of data.
64 bytes from aang (192.168.1.231): icmp_seq=1 ttl=64 time=0.999 ms
64 bytes from aang (192.168.1.231): icmp_seq=2 ttl=64 time=1.05 ms

Log on server

Log for successful connection (via IP address):

[2020-01-24T22:01:41] INFO: starting server
[2020-01-24T22:01:41] INFO: config file: /tmp/Barrier.twQiRP
[2020-01-24T22:01:41] INFO: log level: INFO
[2020-01-24T22:01:41] NOTE: started server (IPv4/IPv6), waiting for clients
[2020-01-24T22:04:55] INFO: OpenSSL 1.1.1c  28 May 2019
[2020-01-24T22:05:04] INFO: accepted secure socket
[2020-01-24T22:05:04] INFO: TLS_AES_256_GCM_SHA384  TLSv1.3 Kx=any      Au=any  Enc=AESGCM(256) Mac=AEAD
[2020-01-24T22:05:04] NOTE: accepted client connection
[2020-01-24T22:05:04] NOTE: client "fox" has connected
[2020-01-24T22:05:06] INFO: switch from "aang" to "fox" at 0,546
[2020-01-24T22:05:06] INFO: leaving screen
[2020-01-24T22:05:06] INFO: screen "aang" updated clipboard 0
[2020-01-24T22:05:06] INFO: screen "aang" updated clipboard 1
[2020-01-24T22:05:08] INFO: switch from "fox" to "aang" at 1913,707
[2020-01-24T22:05:08] INFO: entering screen
[2020-01-24T22:05:16] NOTE: client "fox" has disconnected
[2020-01-24T22:05:20] INFO: stopping barrier desktop process
[2020-01-24T22:05:21] NOTE: stopped server
[2020-01-24T22:05:21] INFO: process exited normally

Log for unsuccessful connection (via Avahi):

[2020-01-24T22:12:53] INFO: starting server
[2020-01-24T22:12:53] INFO: config file: /tmp/Barrier.noHjRF
[2020-01-24T22:12:53] INFO: log level: INFO
[2020-01-24T22:12:53] NOTE: started server (IPv4/IPv6), waiting for clients

(Nothing after this.)

Log on client

Successful/IP address:

[2020-01-24T22:04:54] INFO: starting client
[2020-01-24T22:04:54] INFO: config file: /tmp/Barrier.TJ3910
[2020-01-24T22:04:54] INFO: log level: INFO
[2020-01-24T22:04:55] NOTE: started client
[2020-01-24T22:04:55] NOTE: connecting to '192.168.1.231': 192.168.1.231:24800
[2020-01-24T22:04:55] INFO: OpenSSL 1.1.1  11 Sep 2018
[2020-01-24T22:05:04] NOTE: server fingerprint: 45:8A:C6:3A:9D:6D:E3:40:52:DB:0C:F3:72:B2:25:32:0A:9F:43:60
[2020-01-24T22:05:04] NOTE: trustedServersFilename: /home/jason/snap/barrier/83/.local/share/barrier/SSL/Fingerprints/TrustedServers.txt
[2020-01-24T22:05:04] NOTE: Opened trustedServersFilename: /home/jason/snap/barrier/83/.local/share/barrier/SSL/Fingerprints/TrustedServers.txt
[2020-01-24T22:05:04] NOTE: Fingerprint matches trusted fingerprint
[2020-01-24T22:05:04] INFO: connected to secure socket
[2020-01-24T22:05:04] INFO: server ssl certificate info: /CN=Barrier
[2020-01-24T22:05:04] INFO: TLS_AES_256_GCM_SHA384  TLSv1.3 Kx=any      Au=any  Enc=AESGCM(256) Mac=AEAD
[2020-01-24T22:05:04] NOTE: connected to server
[2020-01-24T22:05:06] INFO: entering screen
[2020-01-24T22:05:06] INFO: clipboard was updated
[2020-01-24T22:05:06] INFO: clipboard was updated
[2020-01-24T22:05:08] INFO: leaving screen
[2020-01-24T22:05:15] INFO: stopping barrier desktop process
[2020-01-24T22:05:16] NOTE: stopped client
[2020-01-24T22:05:16] INFO: process exited normally

Unsuccessful/Avahi:

[2020-01-24T22:13:12] INFO: starting client
[2020-01-24T22:13:12] INFO: config file: /tmp/Barrier.XM3910
[2020-01-24T22:13:12] INFO: log level: INFO
[2020-01-24T22:13:12] NOTE: started client
[2020-01-24T22:13:12] WARNING: failed to connect to server: unknown error for: aang.local:24800
[2020-01-24T22:13:13] WARNING: failed to connect to server: unknown error for: aang.local:24800
<repeats lots>
[2020-01-24T22:14:15] WARNING: failed to connect to server: unknown error for: aang.local:24800
[2020-01-24T22:14:15] INFO: stopping barrier desktop process
[2020-01-24T22:14:16] NOTE: stopped client
[2020-01-24T22:14:16] INFO: process exited normally
Originally created by @detly on GitHub (Jan 24, 2020). Original GitHub issue: https://github.com/debauchee/barrier/issues/546 The client connects to the server just fine when using the numeric IP address. It does not connect when given the Avahi mDNS server address. I can live with using numeric IP addresses, but it's nice not to have to. Plus it seems odd that only one piece of software on the client machine can't resolve using Avahi. ### Operating Systems ### Server: Ubuntu 19.10 (eoan) Client: Ubuntu 18.04.3 LTS (bionic) Server is a Lenovo laptop, connected via wifi. Hostname and screen name is "aang". Client is a Mac Mini 2016, connected via ethernet. Hostname and screen name is "fox". ### Barrier Version ### Server: installed via apt `2.3.1+dfsg-1ubuntu1` Client: installed via Snap: ```text ~ ⌘ sudo snap list barrier Name Version Rev Tracking Publisher Notes barrier 2.3.2-13-g9080ce45 83 stable adrianceleste - ``` ### Steps to reproduce bug ### Server: 1. Log in to desktop environment. 2. Launch Barrier. 3. Check "server", configure layout interactively (server on left, client on right). IP address is `192.168.1.231`, confirmed via `ip addr show`. 4. Click start. The server starts. Client: 1. Log in to desktop environment. 2. Launch Barrier. 3. Check "client", set server IP to `192.168.1.231`. 4. Click start. It works! Now try: Client: 1. Set server IP to `aang.local`. It does not connect. See log below. ### Other info ### * When did the problem start to occur? First install. * Is there a way to work around it? Yes, use numeric IP address. * Does this bug prevent you from using Barrier entirely? No. Avahi works fine for everything else. From client: ```text ~ ⌘ avahi-resolve --name -4 aang.local aang.local 192.168.1.231 ~ ⌘ ping aang.local PING aang.local (192.168.1.231) 56(84) bytes of data. 64 bytes from aang (192.168.1.231): icmp_seq=1 ttl=64 time=0.999 ms 64 bytes from aang (192.168.1.231): icmp_seq=2 ttl=64 time=1.05 ms ``` ### Log on server ### Log for successful connection (via IP address): ```text [2020-01-24T22:01:41] INFO: starting server [2020-01-24T22:01:41] INFO: config file: /tmp/Barrier.twQiRP [2020-01-24T22:01:41] INFO: log level: INFO [2020-01-24T22:01:41] NOTE: started server (IPv4/IPv6), waiting for clients [2020-01-24T22:04:55] INFO: OpenSSL 1.1.1c 28 May 2019 [2020-01-24T22:05:04] INFO: accepted secure socket [2020-01-24T22:05:04] INFO: TLS_AES_256_GCM_SHA384 TLSv1.3 Kx=any Au=any Enc=AESGCM(256) Mac=AEAD [2020-01-24T22:05:04] NOTE: accepted client connection [2020-01-24T22:05:04] NOTE: client "fox" has connected [2020-01-24T22:05:06] INFO: switch from "aang" to "fox" at 0,546 [2020-01-24T22:05:06] INFO: leaving screen [2020-01-24T22:05:06] INFO: screen "aang" updated clipboard 0 [2020-01-24T22:05:06] INFO: screen "aang" updated clipboard 1 [2020-01-24T22:05:08] INFO: switch from "fox" to "aang" at 1913,707 [2020-01-24T22:05:08] INFO: entering screen [2020-01-24T22:05:16] NOTE: client "fox" has disconnected [2020-01-24T22:05:20] INFO: stopping barrier desktop process [2020-01-24T22:05:21] NOTE: stopped server [2020-01-24T22:05:21] INFO: process exited normally ``` Log for unsuccessful connection (via Avahi): ```text [2020-01-24T22:12:53] INFO: starting server [2020-01-24T22:12:53] INFO: config file: /tmp/Barrier.noHjRF [2020-01-24T22:12:53] INFO: log level: INFO [2020-01-24T22:12:53] NOTE: started server (IPv4/IPv6), waiting for clients ``` (Nothing after this.) ### Log on client ### Successful/IP address: ```text [2020-01-24T22:04:54] INFO: starting client [2020-01-24T22:04:54] INFO: config file: /tmp/Barrier.TJ3910 [2020-01-24T22:04:54] INFO: log level: INFO [2020-01-24T22:04:55] NOTE: started client [2020-01-24T22:04:55] NOTE: connecting to '192.168.1.231': 192.168.1.231:24800 [2020-01-24T22:04:55] INFO: OpenSSL 1.1.1 11 Sep 2018 [2020-01-24T22:05:04] NOTE: server fingerprint: 45:8A:C6:3A:9D:6D:E3:40:52:DB:0C:F3:72:B2:25:32:0A:9F:43:60 [2020-01-24T22:05:04] NOTE: trustedServersFilename: /home/jason/snap/barrier/83/.local/share/barrier/SSL/Fingerprints/TrustedServers.txt [2020-01-24T22:05:04] NOTE: Opened trustedServersFilename: /home/jason/snap/barrier/83/.local/share/barrier/SSL/Fingerprints/TrustedServers.txt [2020-01-24T22:05:04] NOTE: Fingerprint matches trusted fingerprint [2020-01-24T22:05:04] INFO: connected to secure socket [2020-01-24T22:05:04] INFO: server ssl certificate info: /CN=Barrier [2020-01-24T22:05:04] INFO: TLS_AES_256_GCM_SHA384 TLSv1.3 Kx=any Au=any Enc=AESGCM(256) Mac=AEAD [2020-01-24T22:05:04] NOTE: connected to server [2020-01-24T22:05:06] INFO: entering screen [2020-01-24T22:05:06] INFO: clipboard was updated [2020-01-24T22:05:06] INFO: clipboard was updated [2020-01-24T22:05:08] INFO: leaving screen [2020-01-24T22:05:15] INFO: stopping barrier desktop process [2020-01-24T22:05:16] NOTE: stopped client [2020-01-24T22:05:16] INFO: process exited normally ``` Unsuccessful/Avahi: ```text [2020-01-24T22:13:12] INFO: starting client [2020-01-24T22:13:12] INFO: config file: /tmp/Barrier.XM3910 [2020-01-24T22:13:12] INFO: log level: INFO [2020-01-24T22:13:12] NOTE: started client [2020-01-24T22:13:12] WARNING: failed to connect to server: unknown error for: aang.local:24800 [2020-01-24T22:13:13] WARNING: failed to connect to server: unknown error for: aang.local:24800 <repeats lots> [2020-01-24T22:14:15] WARNING: failed to connect to server: unknown error for: aang.local:24800 [2020-01-24T22:14:15] INFO: stopping barrier desktop process [2020-01-24T22:14:16] NOTE: stopped client [2020-01-24T22:14:16] INFO: process exited normally ```
Author
Owner

@detly commented on GitHub (Jan 25, 2020):

Could be because Snap doesn't use the system resolve order(!!).

<!-- gh-comment-id:578376994 --> @detly commented on GitHub (Jan 25, 2020): Could be because [Snap doesn't use the system resolve order](https://forum.snapcraft.io/t/no-mdns-support-in-snaps-should-core-have-a-modified-nsswitch-conf/7603/3)(!!).
Author
Owner

@detly commented on GitHub (Feb 3, 2020):

Workaround as per #12 on bug #1838038: on the client, install (via apt) the nscd package and restart snapd:

sudo apt install nscd
sudo systemctl restart snapd
<!-- gh-comment-id:581327115 --> @detly commented on GitHub (Feb 3, 2020): Workaround as per [#12 on bug #1838038](https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1838038/comments/12): on the client, install (via `apt`) the `nscd` package and restart `snapd`: sudo apt install nscd sudo systemctl restart snapd
Author
Owner

@the-wes commented on GitHub (Mar 3, 2020):

@detly can you confirm that installing nscd worked?

I am not sure Barrier can do anything about this as the root cause is something to do with Snap's name resolution policy.

<!-- gh-comment-id:593882572 --> @the-wes commented on GitHub (Mar 3, 2020): @detly can you confirm that installing nscd worked? I am not sure Barrier can do anything about this as the root cause is something to do with Snap's name resolution policy.
Author
Owner

@detly commented on GitHub (Mar 4, 2020):

@the-wes It did! And I agree re. it being a Snap issue. I'll leave it up to you whether you want to document it as a necessary workaround in the installation instructions or not (I'd consider it since Avahi is such a common tool for resolution on local networks).

<!-- gh-comment-id:594441235 --> @detly commented on GitHub (Mar 4, 2020): @the-wes It did! And I agree re. it being a Snap issue. I'll leave it up to you whether you want to document it as a necessary workaround in the installation instructions or not (I'd consider it since Avahi is such a common tool for resolution on local networks).
Author
Owner

@github-actions[bot] commented on GitHub (Sep 30, 2020):

This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.

<!-- gh-comment-id:701108215 --> @github-actions[bot] commented on GitHub (Sep 30, 2020): This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.
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#426
No description provided.