discovery server with --http response 404 page not found.

Hello, I’m tying to use my own discovery server with docker and lets encrypt.

So, I followed this article

I setting up https and reverse proxy.
So, I enter my server name to syncthing’s Global discovery servers

But I cannot connect to discovery server. I got log global.go:229: DEBUG: announce POST: 404 Not Found

First I thought that reverse proxy is not working. But when I send some http requests to dicovery server directly, I get same response.

And discovery server’s log is below

stdiscosrv v0.14.40-rc.4+21-g0ee1146 (go1.9.2 linux-amd64) teamcity@build.syncthing.net 2017-11-07 07:25:05 UTC
Stats: 0.00 announces/s, 0.00 queries/s, 0.00 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.00 queries/s, 0.00 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.00 queries/s, 0.00 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.00 queries/s, 0.00 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.00 queries/s, 0.00 answers/s, 0.00 errors/s
Database: 0 devices, 0 addresses
Stats: 0.00 announces/s, 0.00 queries/s, 0.00 answers/s, 0.00 errors/s  

There’s any announces even error (like handshake)

Below is my nginx setting

# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
# scheme used to connect to this server
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
  default $http_x_forwarded_proto;
  ''      $scheme;
}
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
# server port the client connected to
map $http_x_forwarded_port $proxy_x_forwarded_port {
  default $http_x_forwarded_port;
  ''      $server_port;
}
# If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any
# Connection header that may have been passed to this server
map $http_upgrade $proxy_connection {
  default upgrade;
  '' close;
}
# Apply fix for very long server names
server_names_hash_bucket_size 128;
# Default dhparam
# Set appropriate X-Forwarded-Ssl header
map $scheme $proxy_x_forwarded_ssl {
  default off;
  https on;
}
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
log_format vhost '$host $remote_addr - $remote_user [$time_local] '
                 '"$request" $status $body_bytes_sent '
                 '"$http_referer" "$http_user_agent"';
access_log off;
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
proxy_set_header X-SSL-Cert $ssl_client_cert;
# Mitigate httpoxy attack (see README for details)
proxy_set_header Proxy "";
server {
        server_name _; # This is just an invalid value which will never trigger on a real hostname.
        listen 80;
        access_log /var/log/nginx/access.log vhost;
        return 503;
}
# discovery.studygram.kr
upstream discovery.studygram.kr {
                                ## Can be connect with "sdd_default" network
                        # syncthing_discovery_run
                        server 172.19.0.2:8443;
}
server {
        server_name discovery.studygram.kr;
        listen 80 ;
        access_log /var/log/nginx/access.log vhost;
        return 301 https://$host$request_uri;
}
server {
        server_name discovery.studygram.kr;
        listen 443 ssl http2 ;
        access_log /var/log/nginx/access.log vhost;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:!DSS';
        ssl_prefer_server_ciphers on;
        ssl_session_timeout 5m;
        ssl_session_cache shared:SSL:50m;
        ssl_session_tickets off;
        ssl_certificate /etc/nginx/certs/discovery.studygram.kr.crt;
        ssl_certificate_key /etc/nginx/certs/discovery.studygram.kr.key;
        ssl_trusted_certificate /etc/nginx/certs/discovery.studygram.kr.chain.pem;
        ssl_dhparam /etc/nginx/certs/discovery.studygram.kr.dhparam.pem;
        add_header Strict-Transport-Security "max-age=31536000";
        ssl_verify_client optional_no_ca;
        add_header Strict-Transport-Security "max-age=31536000";
        include /etc/nginx/vhost.d/default;
        location / {
                proxy_pass http://discovery.studygram.kr/;
        }
}

Thank you in abvance

Don’t forget the /v2/ on the end of your discovery server URL you enter in to the clients. And the trailing slash!

https://discovery.domain.com/v2/

Hopefully that will help.

1 Like

Thanks you for your kind and quick reply. I change discovery server URL follow your advice.
So, I get global.go:229: DEBUG: announce POST: 204 No Content

But, My two syncthing devices still cannot find each other.

Below is my discovery sever logs
Stats: 0.01 announces/s, 0.01 queries/s, 0.00 answers/s, 0.00 errors/s

And my syncthing GUI show me like this

What do I need to check?

How do you know they can’t find each other? From the logs it seems they are contacting the discovery server ok, they might not be able to connect.

Thank you for your reply!!

Yes, ‘not be able to connect’ is exact expression.
I don’y know why cannot connect.

My devices are in the same network.
And I turned off local discovery and relaying. to test Upnp connect.
Is it possible to connect upnp in the same network?

Below is discovery server’s log

Database: 2 devices, 6 addresses
Stats: 0.00 announces/s, 0.01 queries/s, 0.01 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.01 queries/s, 0.01 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.01 queries/s, 0.01 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.01 queries/s, 0.01 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.01 queries/s, 0.01 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.01 queries/s, 0.01 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.01 queries/s, 0.01 answers/s, 0.00 errors/s
Stats: 0.00 announces/s, 0.00 queries/s, 0.00 answers/s, 0.00 errors/s



[SJF6S] 2017/11/19 21:34:29 model.go:183: INFO: Ready to synchronize "Music1" (Music1) (readwrite)
[SJF6S] 2017/11/19 21:34:29 limiter.go:84: INFO: Send rate is unlimited, receive rate is unlimited
[SJF6S] 2017/11/19 21:34:29 limiter.go:89: INFO: Rate limits do not apply to LAN connections
[SJF6S] 2017/11/19 21:34:29 main.go:836: INFO: Using discovery server https://discovery.studygram.kr/v2/
[SJF6S] 2017/11/19 21:34:29 global.go:220: DEBUG: Announcement: {"addresses":["tcp://0.0.0.0:22000"]}
[SJF6S] 2017/11/19 21:34:29 tcp_listen.go:69: INFO: TCP listener ([::]:22000) starting
[SJF6S] 2017/11/19 21:34:29 gui.go:357: INFO: GUI and API listening on [::]:8384
[SJF6S] 2017/11/19 21:34:29 gui.go:358: INFO: Access the GUI via the following URL: http://127.0.0.1:8384/
[SJF6S] 2017/11/19 21:34:29 main.go:881: INFO: Device AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO is "mac" at [dynamic]
[SJF6S] 2017/11/19 21:34:29 main.go:881: INFO: Device G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2 is "40" at [dynamic]
[SJF6S] 2017/11/19 21:34:29 main.go:881: INFO: Device KP5QLFB-V373MVX-WLCVZKL-K6HFTCB-KBLR63I-CFAETOH-QQLT3BH-OITHKAT is "Jason's Docker" at [dynamic]
[SJF6S] 2017/11/19 21:34:29 main.go:881: INFO: Device SJF6SKR-IDYRDJ7-AMJSPJ7-KC77ERN-JHMZY2C-LSBXZSV-Q4OSPWI-Z3HNXAI is "ACS-N1" at [dynamic]
[SJF6S] 2017/11/19 21:34:30 upnp.go:151: DEBUG: Starting discovery of device type urn:schemas-upnp-org:device:InternetGatewayDevice:1 on eth0
[SJF6S] 2017/11/19 21:34:30 upnp.go:166: DEBUG: Sending search request for device type urn:schemas-upnp-org:device:InternetGatewayDevice:1 on eth0
[SJF6S] 2017/11/19 21:34:30 upnp.go:176: DEBUG: Listening for UPnP response for device type urn:schemas-upnp-org:device:InternetGatewayDevice:1 on eth0
[SJF6S] 2017/11/19 21:34:30 upnp.go:151: DEBUG: Starting discovery of device type urn:schemas-upnp-org:device:InternetGatewayDevice:2 on eth0
[SJF6S] 2017/11/19 21:34:30 upnp.go:166: DEBUG: Sending search request for device type urn:schemas-upnp-org:device:InternetGatewayDevice:2 on eth0
[SJF6S] 2017/11/19 21:34:30 upnp.go:176: DEBUG: Listening for UPnP response for device type urn:schemas-upnp-org:device:InternetGatewayDevice:2 on eth0
[SJF6S] 2017/11/19 21:34:30 upnp.go:199: DEBUG: Handling UPnP response:

And

Below is syncthing’s log

HTTP/1.1 200 OK
CACHE-CONTROL: max-age=120
ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1
USN: uuid:f608520a-3802-438e-984b-3c4b6b3af415::urn:schemas-upnp-org:device:InternetGatewayDevice:1
EXT:
SERVER: Linux/3.13.0-117-generic UPnP/1.1 MiniUPnPd/1.9
LOCATION: http://192.168.86.1:5000/rootDesc.xml
OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS: 1
BOOTID.UPNP.ORG: 1
CONFIGID.UPNP.ORG: 1337


[SJF6S] 2017/11/19 21:34:30 upnp.go:199: DEBUG: Handling UPnP response:

HTTP/1.1 200 OK
CACHE-CONTROL: max-age=120
ST: urn:schemas-upnp-org:device:InternetGatewayDevice:2
USN: uuid:f608520a-3802-438e-984b-3c4b6b3af415::urn:schemas-upnp-org:device:InternetGatewayDevice:2
EXT:
SERVER: Linux/3.13.0-117-generic UPnP/1.1 MiniUPnPd/1.9
LOCATION: http://192.168.86.1:5000/rootDesc.xml
OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS: 1
BOOTID.UPNP.ORG: 1
CONFIGID.UPNP.ORG: 1337


[SJF6S] 2017/11/19 21:34:30 upnp.go:352: DEBUG: http://192.168.86.1:5000/rootDesc.xml - no services of type urn:schemas-upnp-org:service:WANIPConnection:1  found on connection.
[SJF6S] 2017/11/19 21:34:30 upnp.go:361: DEBUG: http://192.168.86.1:5000/rootDesc.xml - found urn:schemas-upnp-org:service:WANIPConnection:1 with URL http://192.168.86.1:5000/ctl/IPConn
[SJF6S] 2017/11/19 21:34:30 upnp.go:352: DEBUG: http://192.168.86.1:5000/rootDesc.xml - no services of type urn:schemas-upnp-org:service:WANPPPConnection:1  found on connection.
[SJF6S] 2017/11/19 21:34:30 upnp.go:352: DEBUG: http://192.168.86.1:5000/rootDesc.xml - no services of type urn:schemas-upnp-org:service:WANIPConnection:1  found on connection.
[SJF6S] 2017/11/19 21:34:30 upnp.go:361: DEBUG: http://192.168.86.1:5000/rootDesc.xml - found urn:schemas-upnp-org:service:WANIPConnection:1 with URL http://192.168.86.1:5000/ctl/IPConn
[SJF6S] 2017/11/19 21:34:30 upnp.go:352: DEBUG: http://192.168.86.1:5000/rootDesc.xml - no services of type urn:schemas-upnp-org:service:WANPPPConnection:1  found on connection.
[SJF6S] 2017/11/19 21:34:30 upnp.go:125: DEBUG: UPnP discovery result f608520a-3802-438e-984b-3c4b6b3af415 with services:
[SJF6S] 2017/11/19 21:34:30 upnp.go:127: DEBUG: * [urn:upnp-org:serviceId:WANIPConn1] http://192.168.86.1:5000/ctl/IPConn
[SJF6S] 2017/11/19 21:34:30 upnp.go:114: DEBUG: Skipping duplicate result f608520a-3802-438e-984b-3c4b6b3af415 with services:
[SJF6S] 2017/11/19 21:34:30 upnp.go:116: DEBUG: * [urn:upnp-org:serviceId:WANIPConn1] http://192.168.86.1:5000/ctl/IPConn
[SJF6S] 2017/11/19 21:34:30 global.go:229: DEBUG: announce POST: 204 No Content
[SJF6S] 2017/11/19 21:34:30 global.go:256: DEBUG: announce Reannounce-After: 1800 <nil>
[SJF6S] 2017/11/19 21:34:31 global.go:147: DEBUG: globalClient.Lookup https://discovery.studygram.kr/v2/?device=AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO 404 Not Found
[SJF6S] 2017/11/19 21:34:31 cache.go:138: DEBUG: lookup results for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO
[SJF6S] 2017/11/19 21:34:31 cache.go:139: DEBUG:   addresses:  []
[SJF6S] 2017/11/19 21:34:32 cache.go:113: DEBUG: lookup for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2 at global@https://discovery.studygram.kr/v2/
[SJF6S] 2017/11/19 21:34:32 cache.go:114: DEBUG:   addresses: [tcp://61.101.55.129:33093 tcp://61.101.55.129:15845 tcp://61.101.55.129:22000]
[SJF6S] 2017/11/19 21:34:32 cache.go:138: DEBUG: lookup results for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2
[SJF6S] 2017/11/19 21:34:32 cache.go:139: DEBUG:   addresses:  [tcp://61.101.55.129:15845 tcp://61.101.55.129:22000 tcp://61.101.55.129:33093]
[SJF6S] 2017/11/19 21:34:33 cache.go:104: DEBUG: negative cache entry for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO at global@https://discovery.studygram.kr/v2/ valid until 2017-11-19 21:35:31.129185773 +0900 KST m=+117.000030246 or 2017-11-19 22:34:31.129191426 +0900 KST m=+3657.000035898
[SJF6S] 2017/11/19 21:34:33 cache.go:138: DEBUG: lookup results for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO
[SJF6S] 2017/11/19 21:34:33 cache.go:139: DEBUG:   addresses:  []
[SJF6S] 2017/11/19 21:34:33 cache.go:92: DEBUG: cached discovery entry for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2 at global@https://discovery.studygram.kr/v2/
[SJF6S] 2017/11/19 21:34:33 cache.go:93: DEBUG:   cache: {[tcp://61.101.55.129:33093 tcp://61.101.55.129:15845 tcp://61.101.55.129:22000] {13725982610834956448 58139386583 0x10fa220} true {0 0 <nil>} 0}
[SJF6S] 2017/11/19 21:34:33 cache.go:138: DEBUG: lookup results for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2
[SJF6S] 2017/11/19 21:34:33 cache.go:139: DEBUG:   addresses:  [tcp://61.101.55.129:15845 tcp://61.101.55.129:22000 tcp://61.101.55.129:33093]
[SJF6S] 2017/11/19 21:34:35 cache.go:104: DEBUG: negative cache entry for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO at global@https://discovery.studygram.kr/v2/ valid until 2017-11-19 21:35:31.129185773 +0900 KST m=+117.000030246 or 2017-11-19 22:34:31.129191426 +0900 KST m=+3657.000035898
[SJF6S] 2017/11/19 21:34:35 cache.go:138: DEBUG: lookup results for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO
[SJF6S] 2017/11/19 21:34:35 cache.go:139: DEBUG:   addresses:  []
[SJF6S] 2017/11/19 21:34:35 cache.go:92: DEBUG: cached discovery entry for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2 at global@https://discovery.studygram.kr/v2/
[SJF6S] 2017/11/19 21:34:35 cache.go:93: DEBUG:   cache: {[tcp://61.101.55.129:33093 tcp://61.101.55.129:15845 tcp://61.101.55.129:22000] {13725982610834956448 58139386583 0x10fa220} true {0 0 <nil>} 0}
[SJF6S] 2017/11/19 21:34:35 cache.go:138: DEBUG: lookup results for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2
[SJF6S] 2017/11/19 21:34:35 cache.go:139: DEBUG:   addresses:  [tcp://61.101.55.129:15845 tcp://61.101.55.129:22000 tcp://61.101.55.129:33093]
[SJF6S] 2017/11/19 21:34:39 cache.go:104: DEBUG: negative cache entry for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO at global@https://discovery.studygram.kr/v2/ valid until 2017-11-19 21:35:31.129185773 +0900 KST m=+117.000030246 or 2017-11-19 22:34:31.129191426 +0900 KST m=+3657.000035898
[SJF6S] 2017/11/19 21:34:39 cache.go:138: DEBUG: lookup results for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO
[SJF6S] 2017/11/19 21:34:39 cache.go:139: DEBUG:   addresses:  []
[SJF6S] 2017/11/19 21:34:39 cache.go:92: DEBUG: cached discovery entry for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2 at global@https://discovery.studygram.kr/v2/
[SJF6S] 2017/11/19 21:34:39 cache.go:93: DEBUG:   cache: {[tcp://61.101.55.129:33093 tcp://61.101.55.129:15845 tcp://61.101.55.129:22000] {13725982610834956448 58139386583 0x10fa220} true {0 0 <nil>} 0}
[SJF6S] 2017/11/19 21:34:39 cache.go:138: DEBUG: lookup results for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2
[SJF6S] 2017/11/19 21:34:39 cache.go:139: DEBUG:   addresses:  [tcp://61.101.55.129:15845 tcp://61.101.55.129:22000 tcp://61.101.55.129:33093]
[SJF6S] 2017/11/19 21:34:40 upnp.go:195: DEBUG: Discovery for device type urn:schemas-upnp-org:device:InternetGatewayDevice:1 on eth0 finished.
[SJF6S] 2017/11/19 21:34:40 upnp.go:195: DEBUG: Discovery for device type urn:schemas-upnp-org:device:InternetGatewayDevice:2 on eth0 finished.
[SJF6S] 2017/11/19 21:34:40 structs.go:32: INFO: New NAT port mapping: external TCP address 61.101.55.129:39925 to local address 0.0.0.0:22000.
[SJF6S] 2017/11/19 21:34:40 upnp.go:421: DEBUG: SOAP Request URL: http://192.168.86.1:5000/ctl/IPConn
[SJF6S] 2017/11/19 21:34:40 upnp.go:422: DEBUG: SOAP Action:
[SJF6S] 2017/11/19 21:34:40 upnp.go:423: DEBUG: SOAP Request:

<?xml version="1.0" ?>
        <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <s:Body><u:AddPortMapping xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
        <NewRemoteHost></NewRemoteHost>
        <NewExternalPort>34731</NewExternalPort>
        <NewProtocol>TCP</NewProtocol>
        <NewInternalPort>22000</NewInternalPort>
        <NewInternalClient>192.168.86.39</NewInternalClient>
        <NewEnabled>1</NewEnabled>
        <NewPortMappingDescription>syncthing-34731</NewPortMappingDescription>
        <NewLeaseDuration>3600</NewLeaseDuration>
        </u:AddPortMapping></s:Body>
        </s:Envelope>

[SJF6S] 2017/11/19 21:34:40 upnp.go:432: DEBUG: SOAP Response: 200 OK

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:AddPortMappingResponse xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1"/></s:Body></s:Envelope>


[SJF6S] 2017/11/19 21:34:40 upnp.go:421: DEBUG: SOAP Request URL: http://192.168.86.1:5000/ctl/IPConn
[SJF6S] 2017/11/19 21:34:40 upnp.go:422: DEBUG: SOAP Action:
[SJF6S] 2017/11/19 21:34:40 upnp.go:423: DEBUG: SOAP Request:

<?xml version="1.0" ?>
        <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <s:Body><u:GetExternalIPAddress xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1" /></s:Body>
        </s:Envelope>

[SJF6S] 2017/11/19 21:34:40 upnp.go:432: DEBUG: SOAP Response: 200 OK

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetExternalIPAddressResponse xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1"><NewExternalIPAddress>61.101.55.129</NewExternalIPAddress></u:GetExternalIPAddressResponse></s:Body></s:Envelope>


[SJF6S] 2017/11/19 21:34:40 structs.go:32: INFO: New NAT port mapping: external TCP address 61.101.55.129:34731 to local address 0.0.0.0:22000.
[SJF6S] 2017/11/19 21:34:40 service.go:61: INFO: Detected 2 NAT devices
[SJF6S] 2017/11/19 21:34:42 global.go:220: DEBUG: Announcement: {"addresses":["tcp://0.0.0.0:22000","tcp://0.0.0.0:34731","tcp://0.0.0.0:39925"]}
[SJF6S] 2017/11/19 21:34:42 global.go:229: DEBUG: announce POST: 204 No Content
[SJF6S] 2017/11/19 21:34:42 global.go:256: DEBUG: announce Reannounce-After: 1800 <nil>
[SJF6S] 2017/11/19 21:34:47 cache.go:104: DEBUG: negative cache entry for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO at global@https://discovery.studygram.kr/v2/ valid until 2017-11-19 21:35:31.129185773 +0900 KST m=+117.000030246 or 2017-11-19 22:34:31.129191426 +0900 KST m=+3657.000035898
[SJF6S] 2017/11/19 21:34:47 cache.go:138: DEBUG: lookup results for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO
[SJF6S] 2017/11/19 21:34:47 cache.go:139: DEBUG:   addresses:  []
[SJF6S] 2017/11/19 21:34:47 cache.go:92: DEBUG: cached discovery entry for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2 at global@https://discovery.studygram.kr/v2/
[SJF6S] 2017/11/19 21:34:47 cache.go:93: DEBUG:   cache: {[tcp://61.101.55.129:33093 tcp://61.101.55.129:15845 tcp://61.101.55.129:22000] {13725982610834956448 58139386583 0x10fa220} true {0 0 <nil>} 0}
[SJF6S] 2017/11/19 21:34:47 cache.go:138: DEBUG: lookup results for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2
[SJF6S] 2017/11/19 21:34:47 cache.go:139: DEBUG:   addresses:  [tcp://61.101.55.129:15845 tcp://61.101.55.129:22000 tcp://61.101.55.129:33093]
[SJF6S] 2017/11/19 21:35:03 cache.go:104: DEBUG: negative cache entry for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO at global@https://discovery.studygram.kr/v2/ valid until 2017-11-19 21:35:31.129185773 +0900 KST m=+117.000030246 or 2017-11-19 22:34:31.129191426 +0900 KST m=+3657.000035898
[SJF6S] 2017/11/19 21:35:03 cache.go:138: DEBUG: lookup results for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO
[SJF6S] 2017/11/19 21:35:03 cache.go:139: DEBUG:   addresses:  []
[SJF6S] 2017/11/19 21:35:03 cache.go:92: DEBUG: cached discovery entry for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2 at global@https://discovery.studygram.kr/v2/
[SJF6S] 2017/11/19 21:35:03 cache.go:93: DEBUG:   cache: {[tcp://61.101.55.129:33093 tcp://61.101.55.129:15845 tcp://61.101.55.129:22000] {13725982610834956448 58139386583 0x10fa220} true {0 0 <nil>} 0}
[SJF6S] 2017/11/19 21:35:03 cache.go:138: DEBUG: lookup results for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2
[SJF6S] 2017/11/19 21:35:03 cache.go:139: DEBUG:   addresses:  [tcp://61.101.55.129:15845 tcp://61.101.55.129:22000 tcp://61.101.55.129:33093]
[SJF6S] 2017/11/19 21:35:17 folder.go:89: INFO: Completed initial scan of readwrite folder "Music1" (Music1)
[SJF6S] 2017/11/19 21:35:35 cache.go:104: DEBUG: negative cache entry for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO at global@https://discovery.studygram.kr/v2/ valid until 2017-11-19 21:35:31.129185773 +0900 KST m=+117.000030246 or 2017-11-19 22:34:31.129191426 +0900 KST m=+3657.000035898
[SJF6S] 2017/11/19 21:35:35 cache.go:138: DEBUG: lookup results for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO
[SJF6S] 2017/11/19 21:35:35 cache.go:139: DEBUG:   addresses:  []
[SJF6S] 2017/11/19 21:35:35 cache.go:92: DEBUG: cached discovery entry for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2 at global@https://discovery.studygram.kr/v2/
[SJF6S] 2017/11/19 21:35:35 cache.go:93: DEBUG:   cache: {[tcp://61.101.55.129:33093 tcp://61.101.55.129:15845 tcp://61.101.55.129:22000] {13725982610834956448 58139386583 0x10fa220} true {0 0 <nil>} 0}
[SJF6S] 2017/11/19 21:35:35 cache.go:138: DEBUG: lookup results for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2
[SJF6S] 2017/11/19 21:35:35 cache.go:139: DEBUG:   addresses:  [tcp://61.101.55.129:15845 tcp://61.101.55.129:22000 tcp://61.101.55.129:33093]
[SJF6S] 2017/11/19 21:36:03 cache.go:104: DEBUG: negative cache entry for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO at global@https://discovery.studygram.kr/v2/ valid until 2017-11-19 21:35:31.129185773 +0900 KST m=+117.000030246 or 2017-11-19 22:34:31.129191426 +0900 KST m=+3657.000035898
[SJF6S] 2017/11/19 21:36:03 cache.go:138: DEBUG: lookup results for AD4QYYR-XMTRIHZ-GMQF7TM-7NZFGPX-B7V64DA-I2RY45R-COGOI2R-53YZCAO
[SJF6S] 2017/11/19 21:36:03 cache.go:139: DEBUG:   addresses:  []
[SJF6S] 2017/11/19 21:36:03 cache.go:92: DEBUG: cached discovery entry for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2 at global@https://discovery.studygram.kr/v2/
[SJF6S] 2017/11/19 21:36:03 cache.go:93: DEBUG:   cache: {[tcp://61.101.55.129:33093 tcp://61.101.55.129:15845 tcp://61.101.55.129:22000] {13725982610834956448 58139386583 0x10fa220} true {0 0 <nil>} 0}
[SJF6S] 2017/11/19 21:36:03 cache.go:138: DEBUG: lookup results for G3VH6IC-BWRKFJY-V47WP3O-FB3TANQ-GB33DRO-K4KYQ5Y-Y6XLOXM-GRVKUA2
[SJF6S] 2017/11/19 21:36:03 cache.go:139: DEBUG:   addresses:  [tcp://61.101.55.129:15845 tcp://61.101.55.129:22000 tcp://61.101.55.129:33093]

It seems the addresses are there, so nit being able to connect doesn’t seem related to discovery server. You don’t have relay addresses nor kcp addresses so it’s unlikely they will connect if they are behind a NAT.

Thanks for your quick reply !~!!

If I turn on relay option, they always use relay server.
But relaying is low performance.

So I wanna use direct connect.
I know that UPnP can make connections between devices behind Nat.
If so, is it possible to connect without relay?

(And Please let know what is kcp )

If it always connects using relay that means you can’t connect directly, most likely due to a NAT. Running your own discovery server can only make things worse, especially if the discovery server is on the same local network as one of the devices you are trying to connect to, as ot starts advertising LAN ips of devices instead of wan ips.

Thank you for your reply!

Yes, you are right.
If I run a discovery server in same network as syncthing, they connect directly using local address.
But, My discovery server is in the AWS.

I wanna connect device “39” and “40”.
Below is my syncthing gui picture. What’s wrong with this picture?


If you are running in AWS, have you actually setup firewall rules?

There is nothing wrong in this picture, but as I said, if both devices are behind a NAT, with no port forwarding, you can’t connect using TCP.

Thanks for your replay !!! so so much.

Yes, I added port rule to AWS.

And I know that UPnP make portfowarding rule Automatically.

Below is my syncthing log with STTRACE=upnp option.

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <s:Body><u:AddPortMapping xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
    <NewRemoteHost></NewRemoteHost>
    <NewExternalPort>64800</NewExternalPort>
    <NewProtocol>TCP</NewProtocol>
    <NewInternalPort>22000</NewInternalPort>
    <NewInternalClient>192.168.86.39</NewInternalClient>
    <NewEnabled>1</NewEnabled>
    <NewPortMappingDescription>syncthing-64800</NewPortMappingDescription>
    <NewLeaseDuration>3600</NewLeaseDuration>
    </u:AddPortMapping></s:Body>
    </s:Envelope>

It seems to port forwarding is success. Is it right?

Yes, but I suggest you verify you can connect using telnet or netcat using that port. It wouldn’t be the first time a router advertises it mapped something successfully, yet in reality nothing works.

Super thank you for your reply.

I check that ports using telnet, It says that connection refused.
Maybe there’s some problem in router.
I’ll spend more time about router problem.

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