Syncthing on Android seems to only work for me via relay (no LAN) on devices with newer Android

So I have quite a few devices using Syncthing:

  • Central hub NAS server where Syncthing runs via Docker, OS is Unraid (all devices connect to this machine)
  • 3x desktop PCs, all running OpenSUSE Linux and running on ethernet
  • 1x Android work phone, running Android 9
  • 2x Android phones running Android version 11 & 12 - These phones both fail to connect via LAN

All Android phones are using the latest version of Syncthing, 1.19.0. The Android phone running the older OS version 9 works and connects using the local IP. The other phones running newer Android do not. At one time they all worked fine on the local network, but I noticed a few weeks ago that the one device was connected via a relay and am not certain when that started. The device which runs Android 12 I only received today (it is a replacement for the Android 9 phone), and was disappointed that it can’t connect via the local IP, although I was kind of expecting it given that I was already aware of this issue.

Anybody have any ideas? I have local and global discovery enabled on all devices.

I can ping my server from my phone, and I can ping my phone from my server. They are all on the same subnet. I even put in the connection details on my phone changing “dynamic” to “tcp://myserverip:22000, dynamic” and it fails to connect locally, it goes through the relay instead.

Since my PCs and one of the phones have no problem connecting to my server, it doesn’t seem like there is any general firewall or network issue with my server.

It really does seem like the problem is the newest version of Syncthing combined with newer Android versions.

Anybody have any ideas? It’s a bit of a bummer.

Address discovery on newer Android versions is a bit problematic at the moment:

But this should only affect the Android-to-Android usecase. Your NAS should be able to retrieve and advertize its addresses, making it possible for your other clients to establish local connections.

Could you share some logs as well as your Docker configuration?

One thing, I did just realize that I was mistaken about the OpenSUSE machines… they are using a slightly older version of Syncthing, the repo is apparently not fully up to date yet:

syncthing v1.18.6 "Fermium Flea" (go1.17.6 linux-amd64) abuild@openSUSE 2022-01-14 00:00:00 UTC [noupgrade]

So I wonder if those are likely to break as well as soon as version 1.19.0 becomes available in OpenSUSE.

Anyway, here are my Syncthing logs from the server. I don’t see any obvious errors or issues, but maybe somebody notices something interesting:

-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid: 99
User gid: 100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[start] 11:37:44 INFO: syncthing v1.19.0 "Fermium Flea" (go1.16.10 linux-amd64) root@8c134aea3b1e 2022-02-01 13:06:42 UTC [noupgrade]
[start] 11:37:44 INFO: Using large-database tuning
[NFANO] 11:37:44 INFO: My ID: NFANOFZ-ZRZ3PJF-ZCWEHKJ-3COHD2F-ADC3M7T-GX7BKMA-ZDGJQ5O-E2TZGAC
[NFANO] 11:37:45 INFO: Single thread SHA256 performance is 2093 MB/s using minio/sha256-simd (560 MB/s using crypto/sha256).
[NFANO] 11:37:46 INFO: Hashing performance is 1332.41 MB/s
[NFANO] 11:37:46 INFO: Overall send rate is unlimited, receive rate is unlimited
[NFANO] 11:37:46 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[NFANO] 11:37:46 INFO: TCP listener ([::]:22000) starting
[NFANO] 11:37:46 INFO: Using discovery mechanism: global discovery server https://discovery.syncthing.net/v2/?noannounce&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[NFANO] 11:37:46 INFO: Using discovery mechanism: global discovery server https://discovery-v4.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[NFANO] 11:37:46 INFO: Using discovery mechanism: global discovery server https://discovery-v6.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[NFANO] 11:37:46 INFO: Using discovery mechanism: IPv4 local broadcast discovery on port 21027
[NFANO] 11:37:46 INFO: Using discovery mechanism: IPv6 local multicast discovery on address [ff12::8384]:21027
[NFANO] 11:37:46 INFO: Ready to synchronize "Photos" (boeez-zx23r) (sendreceive)
[NFANO] 11:37:46 INFO: QUIC listener ([::]:22000) starting
[NFANO] 11:37:46 INFO: Ready to synchronize "DCIM" (jiyqf-ttmwy) (sendreceive)
[NFANO] 11:37:46 INFO: Ready to synchronize "Sync" (ko7m6-r3rtf) (sendreceive)
[NFANO] 11:37:46 INFO: Ready to synchronize "ROMs" (mwyny-vyn6s) (sendreceive)
[NFANO] 11:37:46 INFO: Ready to synchronize "Recording" (quxvv-dxdc4) (sendreceive)
[NFANO] 11:37:46 INFO: Ready to synchronize "Applications" (tt3dd-d3dyo) (sendreceive)
[NFANO] 11:37:46 INFO: Ready to synchronize "MP3s" (xtzmv-26u67) (sendreceive)
[NFANO] 11:37:46 INFO: GUI and API listening on [::]:8384
[NFANO] 11:37:46 INFO: Access the GUI via the following URL: http://127.0.0.1:8384/
[NFANO] 11:37:46 INFO: My name is "Oenomaus-NAS"
[NFANO] 11:37:46 INFO: Device 6Q5UTGQ-QGSNF4N-PFI66YZ-CXLSQES-VFO3OWZ-U2QI2N2-PZFQEIC-DGH55AQ is "Samsung Galaxy S21 FE (Cox)" at [dynamic]
[NFANO] 11:37:46 INFO: Device 74LCHH7-NUT3J5G-YIHROXA-W2WUSBD-BITYD6B-7ECU4UC-5L23V23-FHHSEA6 is "Oenomaus-Arcade" at [dynamic]
[NFANO] 11:37:46 INFO: Device 75JJTLK-Y6OC42Y-ZZXCJDE-IAMRTGA-KFPOBEE-WCKHFQQ-FZCDNXB-XH6JIQH is "Oenomaus-HTPC" at [dynamic]
[NFANO] 11:37:46 INFO: Device MSEOG25-DICAT5B-KLCZKX2-HQ2WJNQ-OC72FUS-MWZRGSK-CQRSSDP-3BHRZQG is "Oenomaus-PC" at [dynamic]
[NFANO] 11:37:46 INFO: Device Z4LHGJS-UFMP4IV-UZBK22C-JKN72IB-45OSKCO-YFPTRND-5SK5OFQ-LJ6MLAT is "OnePlus 7T" at [dynamic]
[NFANO] 11:37:46 INFO: Completed initial scan of sendreceive folder "DCIM" (jiyqf-ttmwy)
[NFANO] 11:37:46 INFO: Completed initial scan of sendreceive folder "Recording" (quxvv-dxdc4)
[NFANO] 11:37:46 INFO: Hashing performance is 1332.41 MB/s
[NFANO] 11:37:46 INFO: Overall send rate is unlimited, receive rate is unlimited
[NFANO] 11:37:46 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
[NFANO] 11:37:46 INFO: TCP listener ([::]:22000) starting
[NFANO] 11:37:46 INFO: Using discovery mechanism: global discovery server https://discovery.syncthing.net/v2/?noannounce&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[NFANO] 11:37:46 INFO: Using discovery mechanism: global discovery server https://discovery-v4.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[NFANO] 11:37:46 INFO: Using discovery mechanism: global discovery server https://discovery-v6.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[NFANO] 11:37:46 INFO: Using discovery mechanism: IPv4 local broadcast discovery on port 21027
[NFANO] 11:37:46 INFO: Using discovery mechanism: IPv6 local multicast discovery on address [ff12::8384]:21027
[NFANO] 11:37:46 INFO: Ready to synchronize "Photos" (boeez-zx23r) (sendreceive)
[NFANO] 11:37:46 INFO: QUIC listener ([::]:22000) starting
[NFANO] 11:37:46 INFO: Ready to synchronize "DCIM" (jiyqf-ttmwy) (sendreceive)
[NFANO] 11:37:46 INFO: Ready to synchronize "Sync" (ko7m6-r3rtf) (sendreceive)
[NFANO] 11:37:46 INFO: Ready to synchronize "ROMs" (mwyny-vyn6s) (sendreceive)
[NFANO] 11:37:46 INFO: Ready to synchronize "Recording" (quxvv-dxdc4) (sendreceive)
[NFANO] 11:37:46 INFO: Ready to synchronize "Applications" (tt3dd-d3dyo) (sendreceive)
[NFANO] 11:37:46 INFO: Ready to synchronize "MP3s" (xtzmv-26u67) (sendreceive)
[NFANO] 11:37:46 INFO: GUI and API listening on [::]:8384
[NFANO] 11:37:46 INFO: Access the GUI via the following URL: http://127.0.0.1:8384/
[NFANO] 11:37:46 INFO: My name is "Oenomaus-NAS"
[NFANO] 11:37:46 INFO: Device 6Q5UTGQ-QGSNF4N-PFI66YZ-CXLSQES-VFO3OWZ-U2QI2N2-PZFQEIC-DGH55AQ is "Samsung Galaxy S21 FE (Cox)" at [dynamic]
[NFANO] 11:37:46 INFO: Device 74LCHH7-NUT3J5G-YIHROXA-W2WUSBD-BITYD6B-7ECU4UC-5L23V23-FHHSEA6 is "Oenomaus-Arcade" at [dynamic]
[NFANO] 11:37:46 INFO: Device 75JJTLK-Y6OC42Y-ZZXCJDE-IAMRTGA-KFPOBEE-WCKHFQQ-FZCDNXB-XH6JIQH is "Oenomaus-HTPC" at [dynamic]
[NFANO] 11:37:46 INFO: Device MSEOG25-DICAT5B-KLCZKX2-HQ2WJNQ-OC72FUS-MWZRGSK-CQRSSDP-3BHRZQG is "Oenomaus-PC" at [dynamic]
[NFANO] 11:37:46 INFO: Device Z4LHGJS-UFMP4IV-UZBK22C-JKN72IB-45OSKCO-YFPTRND-5SK5OFQ-LJ6MLAT is "OnePlus 7T" at [dynamic]
[NFANO] 11:37:46 INFO: Completed initial scan of sendreceive folder "DCIM" (jiyqf-ttmwy)
[NFANO] 11:37:46 INFO: Completed initial scan of sendreceive folder "Recording" (quxvv-dxdc4)
[NFANO] 11:37:47 INFO: Completed initial scan of sendreceive folder "Applications" (tt3dd-d3dyo)
[NFANO] 11:37:48 INFO: Completed initial scan of sendreceive folder "MP3s" (xtzmv-26u67)
[NFANO] 11:37:49 INFO: Completed initial scan of sendreceive folder "Photos" (boeez-zx23r)
[NFANO] 11:37:49 INFO: Established secure connection to MSEOG25-DICAT5B-KLCZKX2-HQ2WJNQ-OC72FUS-MWZRGSK-CQRSSDP-3BHRZQG at 172.23.0.9:22000-192.168.1.11:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
[NFANO] 11:37:49 INFO: Device MSEOG25-DICAT5B-KLCZKX2-HQ2WJNQ-OC72FUS-MWZRGSK-CQRSSDP-3BHRZQG client is "syncthing v1.18.6" named "Oenomaus-PC" at 172.23.0.9:22000-192.168.1.11:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
[NFANO] 11:37:49 INFO: Completed initial scan of sendreceive folder "Photos" (boeez-zx23r)
[NFANO] 11:37:49 INFO: Established secure connection to MSEOG25-DICAT5B-KLCZKX2-HQ2WJNQ-OC72FUS-MWZRGSK-CQRSSDP-3BHRZQG at 172.23.0.9:22000-192.168.1.11:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
[NFANO] 11:37:49 INFO: Device MSEOG25-DICAT5B-KLCZKX2-HQ2WJNQ-OC72FUS-MWZRGSK-CQRSSDP-3BHRZQG client is "syncthing v1.18.6" named "Oenomaus-PC" at 172.23.0.9:22000-192.168.1.11:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
[NFANO] 11:37:52 INFO: Completed initial scan of sendreceive folder "Sync" (ko7m6-r3rtf)
[NFANO] 11:37:52 INFO: Completed initial scan of sendreceive folder "Sync" (ko7m6-r3rtf)
[NFANO] 11:37:55 INFO: Established secure connection to Z4LHGJS-UFMP4IV-UZBK22C-JKN72IB-45OSKCO-YFPTRND-5SK5OFQ-LJ6MLAT at 172.23.0.9:59266-66.198.70.78:443/relay-client/TLS1.3-TLS_AES_128_GCM_SHA256
[NFANO] 11:37:55 INFO: Device Z4LHGJS-UFMP4IV-UZBK22C-JKN72IB-45OSKCO-YFPTRND-5SK5OFQ-LJ6MLAT client is "syncthing v1.19.0" named "OnePlus 7T" at 172.23.0.9:59266-66.198.70.78:443/relay-client/TLS1.3-TLS_AES_128_GCM_SHA256
[NFANO] 11:37:57 INFO: Completed initial scan of sendreceive folder "ROMs" (mwyny-vyn6s)
[NFANO] 11:38:00 INFO: Detected 1 NAT service
[NFANO] 11:38:00 INFO: Detected 1 NAT service
[NFANO] 11:38:05 INFO: quic://0.0.0.0:22000 detected NAT type: Port restricted NAT
[NFANO] 11:38:05 INFO: quic://0.0.0.0:22000 resolved external address quic://24.125.136.113:22000 (via stun.syncthing.net:3478)
[NFANO] 11:38:37 INFO: Joined relay relay://107.173.46.111:443

Could you post your compose file or the arguments you start the container with?

172.23.0.9:22000-192.168.1.11:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256

Maybe Syncthing isn’t able to retrieve the interface IPs from within the container. You could try to switch the container to host network mode.

I am actually a little bit unsure where to get that from. I’m using Unraid where they have a web template and you fill out the mapping there. The docker container is simply started up through the web interface with a click. I just have basic port mappings with nothing crazy:

8384 <==> 8384

21027 <==> 21027

22000 <==> 22000

I did just attempt running the docker with host network mode, but it still connected via a relay. :frowning:

I’m at a loss for what to even check at this point.

I did post about this on Reddit and some people also reported seeing the same behavior on their setup and are thinking that it’s some kind of bug.

Could you also gather the logs from one of the apps?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.