guide

restarting Syncthing failed to connect

syncthing

[JOGEZ] 2025/02/27 02:27:38 WARNING: Failed starting API: listen tcp 192.168.1.22:8384: bind: cannot assign requested address [JOGEZ] 2025/02/27 02:27:38 WARNING: Starting API/GUI failed: listen tcp 192.168.1.22:8384: bind: cannot assign requested address

Syncthing fails to start properly due to an API binding error on port 8384, preventing the GUI from launching. the errors appear in the logs. it shuts down its relay listener, QUIC listener, and TCP listener, leading to the process exiting with status 1

possible causes:

  1. ip address is not assigned to machine
  2. port is already in use by another process
  3. network misconfiguration or firewall blocking the API
  4. Syncthing is not configured correctly in config.xml

lets fix this :3

step 1: check private ip address

  1. run the following to get the current private ip:

    hostname -I
  2. note the ip address


step 2: modify syncthing config

  1. run to display the configuration file location
syncthing -paths
  1. open the configuration file:

    nano /home/{user}/.local/state/syncthing/config.xml

    ps: {user} is the username you go by on your pc

  2. find the line containing:

    <address>{ old ip address }</address>
  3. replace { old ip address } with the private ip you noted earlier


step 3: restart syncthing

  1. save and exit nano (ctrl + x, then y, then enter)

  2. restart syncthing:

    systemctl restart syncthing

result:

syncthing now connects successfully! the issue was caused by a changed private ip address, preventing syncthing from binding properly. updating the config fixed it


extras:

if you still face issues:

  • check syncthing logs:

    journalctl -u syncthing --no-pager
  • verify firewall settings:

    sudo ufw allow syncthing
  • try restarting the network:

    systemctl restart NetworkManager

my situation:

Syncthing was failing to connect because my private ip changed. after modifying config.xml with the correct ip, everything worked again

if your issue is similar, check this out

if none of the above work, consider:

  • checking syncthing forums
  • asking for help on reddit
  • reconfiguring the device connections
  • uninstalling and installing syncthing again
  • crying cus idk either im sorry :,(