"FATAL: get free port (GUI): listen tcp 127.0.0.1:0: errno -9" on startup

Hi,

I am trying to install Syncthing on a Asus RT-AC66U with Merlin Firmware and Entware installed. I have installed Synthing on the router with the command opkg install syncthing.

First I have tried to run Syncthing with te command syncthing, but it throws an error: [monitor] 07:53:21 FATAL: stderr: pipe: function not implemented.

So i tried to start Syncthing with command: syncthing -no-restart This results in the following error:

router@Router:/# syncthing -no-restart [SOD2K] 07:55:34 INFO: syncthing v0.14.21 “Dysprosium Dragonfly” (go1.8rc3 linux-mipsle) ryzhovau@ryzhov4 201 7-02-11 16:25:28 UTC [SOD2K] 07:55:34 INFO: My ID: SOD2K5I-6PV6N6A-I6A4L5S-IE5HMJT-AL5R4IZ-S44ND35-HUOM3RR-LOMENAB [SOD2K] 07:55:36 INFO: Single thread SHA256 performance is 4.9 MB/s using crypto/sha256 (4.9 MB/s using minio /sha256-simd). [SOD2K] 07:55:46 INFO: Actual hashing performance is 4.37 MB/s [SOD2K] 07:55:46 INFO: Default folder created and/or linked to new config [SOD2K] 07:55:46 FATAL: get free port (GUI): listen tcp 127.0.0.1:0: errno -9 router@Router:/#

I have already tried the commands ifconfig lo down and ifconfig lo up.

Here is an output of ifconfig -a: br0 Link encap:Ethernet HWaddr D8:50:E6:A9:E2:F0 inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1 RX packets:10066780 errors:0 dropped:0 overruns:0 frame:0 TX packets:7552400 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1446348183 (1.3 GiB) TX bytes:2039536464 (1.8 GiB)

eth0 Link encap:Ethernet HWaddr D8:50:E6:A9:E2:F0 inet addr:***.***.***.*** Bcast:***.***.***.*** Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:32837032 errors:0 dropped:0 overruns:0 frame:0 TX packets:17612415 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3696199712 (3.4 GiB) TX bytes:3961275255 (3.6 GiB) Interrupt:4 Base address:0x2000

eth1 Link encap:Ethernet HWaddr D8:50:E6:A9:E2:F0 UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1 RX packets:7545599 errors:0 dropped:0 overruns:0 frame:10728715 TX packets:20247288 errors:40 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:938130895 (894.6 MiB) TX bytes:321239231 (306.3 MiB) Interrupt:3 Base address:0x8000

eth2 Link encap:Ethernet HWaddr D8:50:E6:A9:E2:F4 UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1 RX packets:10053105 errors:0 dropped:0 overruns:0 frame:920708 TX packets:13360824 errors:80 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:887658296 (846.5 MiB) TX bytes:2103380777 (1.9 GiB) Interrupt:5 Base address:0x8000

lo Link encap:Local Loopback ** inet addr:127.0.0.1 Mask:255.0.0.0** ** UP LOOPBACK RUNNING MULTICAST MTU:16436 Metric:1** ** RX packets:951086 errors:0 dropped:0 overruns:0 frame:0** ** TX packets:951086 errors:0 dropped:0 overruns:0 carrier:0** ** collisions:0 txqueuelen:0** ** RX bytes:175341911 (167.2 MiB) TX bytes:175341911 (167.2 MiB)**

vlan1 Link encap:Ethernet HWaddr D8:50:E6:A9:E2:F0 UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST MTU:1500 Metric:1 RX packets:3662838 errors:0 dropped:0 overruns:0 frame:0 TX packets:5812442 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:2052535402 (1.9 GiB) TX bytes:1590253713 (1.4 GiB)

vlan2 Link encap:Ethernet HWaddr D8:50:E6:A9:E2:F0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Please help, because I am stuck now for about 1 week. I have searched a lot on the internet / this forum but I have no clues left.

Thanks in advance.

That’s an old Syncthing compiled using an older Go compiler, trying a newer release might be worth it - we have mipsle binaries on Github now. But that said, it seems it fails to do the automatic port allocation. You can work around it by creating a minimal configuration file manually:

~/.config/syncthing/config.xml:

<configuration version="18">
    <gui enabled="true" tls="false" debugging="false">
        <address>0.0.0.0:8384</address>
    </gui>
</configuration>

That should be enough for it to start with an open GUI on port 8384, and everything else default, no folders, no devices, but you can add those in the GUI. Don’t forget to set a password etc.

As suggested I have downloaded the latest mipsle binary and started with a clean setup. The binary and config files are located at /tmp/mnt/sda1/syncthing/

First I created the config file (as suggested) and tried to start Synthing with the command: /tmp/mnt/sda1/syncthing/syncthing -no-restart -home="/tmp/mnt/sda1/syncthing"

But still I get the Fatal errno -9 error:

[ILH7Y] 07:38:03 INFO: syncthing v0.14.28-rc.1 "Dysprosium Dragonfly" (go1.8.1 linux-mipsle) 
jenkins@build.syncthing.net 2017-04-26 00:15:23 UTC
[ILH7Y] 07:38:03 INFO: My ID: ILH7YU7-DT2SMLZ-JTLSXTI-G4KWO5P-OJB3BWB-PLYT36X-JR5OWA3-3HP3GQX
[ILH7Y] 07:38:05 INFO: Single thread SHA256 performance is 4.9 MB/s using crypto/sha256 (4.9 
MB/s using minio/sha256-simd).
[ILH7Y] 07:38:10 INFO: Hashing performance with weak hash is 3.73 MB/s
[ILH7Y] 07:38:15 INFO: Hashing performance without weak hash is 3.98 MB/s
[ILH7Y] 07:38:15 INFO: Archiving a copy of old config file format at: 
/tmp/mnt/sda1/syncthing/config.xml.v18
[ILH7Y] 07:38:15 INFO: Weak hash enabled, as it has an acceptable performance impact.
[ILH7Y] 07:38:15 INFO: Updated symlink type for 0 index entries
[ILH7Y] 07:38:15 INFO: Starting deadlock detector with 20m0s timeout
[ILH7Y] 07:38:15 INFO: Send rate is unlimited, receive rate is unlimited
[ILH7Y] 07:38:15 INFO: Rate limits do not apply to LAN connections
[ILH7Y] 07:38:15 INFO: Using discovery server https://discovery-v4-2.syncthing.net/v2/?
id=DVU36WY-H3LVZHW-E6LLFRE-YAFN5EL-HILWRYP-OC2M47J-Z4PE62Y-ADIBDQC
[ILH7Y] 07:38:15 INFO: Using discovery server https://discovery-v4-3.syncthing.net/v2/?
id=VK6HNJ3-VVMM66S-HRVWSCR-IXEHL2H-U4AQ4MW-UCPQBWX-J2L2UBK-NVZRDQZ
[ILH7Y] 07:38:15 INFO: Using discovery server https://discovery-v4-4.syncthing.net/v2/?
id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[ILH7Y] 07:38:15 INFO: Using discovery server https://discovery-v6-2.syncthing.net/v2/?
id=DVU36WY-H3LVZHW-E6LLFRE-YAFN5EL-HILWRYP-OC2M47J-Z4PE62Y-ADIBDQC
[ILH7Y] 07:38:15 INFO: Using discovery server https://discovery-v6-3.syncthing.net/v2/?
id=VK6HNJ3-VVMM66S-HRVWSCR-IXEHL2H-U4AQ4MW-UCPQBWX-J2L2UBK-NVZRDQZ
[ILH7Y] 07:38:15 INFO: Using discovery server https://discovery-v6-4.syncthing.net/v2/?
id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW
[ILH7Y] 07:38:15 INFO: listen (BEP/tcp): listen tcp 0.0.0.0:22000: errno -9
[ILH7Y] 07:38:15 INFO: c.S.listenerSupervisor: Failed service 'tcp://0.0.0.0:22000' (1.000000 
failures of 2.000000), restarting: true, error: "{tcp://0.0.0.0:22000 tcp://0.0.0.0:22000} 
returned unexpectedly", stacktrace: [unknown stack trace]
[ILH7Y] 07:38:15 INFO: listen (BEP/tcp): listen tcp 0.0.0.0:22000: errno -9
[ILH7Y] 07:38:15 INFO: c.S.listenerSupervisor: Failed service 'tcp://0.0.0.0:22000' (1.999961 
failures of 2.000000), restarting: true, error: "{tcp://0.0.0.0:22000 tcp://0.0.0.0:22000} 
returned unexpectedly", stacktrace: [unknown stack trace]
[ILH7Y] 07:38:15 INFO: listen (BEP/tcp): listen tcp 0.0.0.0:22000: errno -9
[ILH7Y] 07:38:15 INFO: Entering the backoff state.
[ILH7Y] 07:38:15 INFO: c.S.listenerSupervisor: Failed service 'tcp://0.0.0.0:22000' (2.999872 
failures of 2.000000), restarting: false, error: "{tcp://0.0.0.0:22000 tcp://0.0.0.0:22000} 
returned unexpectedly", stacktrace: [unknown stack trace]
[ILH7Y] 07:38:15 INFO: Entering the backoff state.
[ILH7Y] 07:38:15 INFO: c.S.listenerSupervisor: Failed service 
'dynamic+https://relays.syncthing.net/endpoint' (3.999145 failures of 2.000000), restarting: 
false, error: "{dynamic+https://relays.syncthing.net/endpoint 
dynamic+https://relays.syncthing.net/endpo
int} returned unexpectedly", stacktrace: [unknown stack trace]
[ILH7Y] 07:38:15 FATAL: Starting API/GUI: listen tcp 0.0.0.0:8384: errno -9

After trying to start Syncthing, the config.xml has changed, the content of config.xml:

<configuration version="20">
<device id="ILH7YU7-DT2SMLZ-JTLSXTI-G4KWO5P-OJB3BWB-PLYT36X-JR5OWA3-3HP3GQX" name="Router" compression="metadata" introducer="false" skipIntroductionRemovals="false" introducedBy="">
    <address>dynamic</address>
    <paused>false</paused>
</device>
<gui enabled="true" tls="false" debugging="false">
    <address>0.0.0.0:8384</address>
    <apikey>U773kTvpMztajmxj53FhAXq5FtvCSPdj</apikey>
    <theme>default</theme>
</gui>
<options>
    <listenAddress>default</listenAddress>
    <globalAnnounceServer>default</globalAnnounceServer>
    <globalAnnounceEnabled>true</globalAnnounceEnabled>
    <localAnnounceEnabled>true</localAnnounceEnabled>
    <localAnnouncePort>21027</localAnnouncePort>
    <localAnnounceMCAddr>[ff12::8384]:21027</localAnnounceMCAddr>
    <maxSendKbps>0</maxSendKbps>
    <maxRecvKbps>0</maxRecvKbps>
    <reconnectionIntervalS>60</reconnectionIntervalS>
    <relaysEnabled>true</relaysEnabled>
    <relayReconnectIntervalM>10</relayReconnectIntervalM>
    <startBrowser>true</startBrowser>
    <natEnabled>true</natEnabled>
    <natLeaseMinutes>60</natLeaseMinutes>
    <natRenewalMinutes>30</natRenewalMinutes>
    <natTimeoutSeconds>10</natTimeoutSeconds>
    <urAccepted>0</urAccepted>
    <urUniqueID></urUniqueID>
    <urURL>https://data.syncthing.net/newdata</urURL>;
    <urPostInsecurely>false</urPostInsecurely>
    <urInitialDelayS>1800</urInitialDelayS>
    <restartOnWakeup>true</restartOnWakeup>
    <autoUpgradeIntervalH>12</autoUpgradeIntervalH>
    <upgradeToPreReleases>false</upgradeToPreReleases>
    <keepTemporariesH>24</keepTemporariesH>
    <cacheIgnoredFiles>false</cacheIgnoredFiles>
    <progressUpdateIntervalS>5</progressUpdateIntervalS>
    <limitBandwidthInLan>false</limitBandwidthInLan>
    <minHomeDiskFree unit="%">0</minHomeDiskFree>
    <releasesURL>https://upgrades.syncthing.net/meta.json</releasesURL>;
    <overwriteRemoteDeviceNamesOnConnect>false</overwriteRemoteDeviceNamesOnConnect>
    <tempIndexMinBlocks>10</tempIndexMinBlocks>
    <trafficClass>0</trafficClass>
    <weakHashSelectionMethod>auto</weakHashSelectionMethod>
    <stunServer>default</stunServer>
    <stunKeepaliveSeconds>24</stunKeepaliveSeconds>
    <defaultKCPEnabled>false</defaultKCPEnabled>
    <kcpNoDelay>false</kcpNoDelay>
    <kcpUpdateIntervalMs>25</kcpUpdateIntervalMs>
    <kcpFastResend>false</kcpFastResend>
    <kcpCongestionControl>true</kcpCongestionControl>
    <kcpSendWindowSize>128</kcpSendWindowSize>
    <kcpReceiveWindowSize>128</kcpReceiveWindowSize>
    <minHomeDiskFreePct>0</minHomeDiskFreePct>
</options>

The ip address of the router is 192.168.1.254 and I have also tried to start Syncthing with the following commands:

Command: /tmp/mnt/sda1/syncthing/syncthing -no-restart -home="/tmp/mnt/sda1/syncthing" -gui-address="192.168.1.254:8384" Result: [ILH7Y] 07:49:13 FATAL: Starting API/GUI: listen tcp 192.168.1.254:8384: errno -9

Command: /tmp/mnt/sda1/syncthing/syncthing -no-restart -home="/tmp/mnt/sda1/syncthing" -gui-address="127.0.0.1:8384" Result: [ILH7Y] 07:50:30 FATAL: Starting API/GUI: listen tcp 127.0.0.1:8384: errno -9

Command: /tmp/mnt/sda1/syncthing/syncthing -no-restart -home="/tmp/mnt/sda1/syncthing" -gui-address="0.0.0.0:80" Result: [ILH7Y] 07:51:50 FATAL: Starting API/GUI: listen tcp 0.0.0.0:80: bind: address already in use (as expected)

Something is preventing Syncthing from listening on any port. I don’t know why. Maybe something is wrong with the mips build, maybe something is wrong with your machine.

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