# Connection to server "bridge.eu.thethings.network" failed

**URL:** <https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511>\
**Category:** v2 Backend\
**Created:** [September 4, 2018, 10:14am UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511 "2018-09-04T10:14:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomaswa](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/thomaswa/32/48087_2.png) [@thomaswa](https://www.thethingsnetwork.org/forum/u/thomaswa)\
**Post date:** [September 4, 2018, 10:14am UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/1 "2018-09-04T10:14:41Z")

</div>

I’m not able to connect since yesterday:

04.09.18 12:08:09 (+0200) main 10:08:09 ERROR: [TTN] , retry in 30 seconds  
04.09.18 12:08:09 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 0, total 30  
04.09.18 12:08:19 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 10, total 30  
04.09.18 12:08:29 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 20, total 30  
04.09.18 12:08:41 (+0200) main 10:08:41 ERROR: [TTN] Connection to server “bridge.eu.thethings.network” failed, retry in 60 seconds  
04.09.18 12:08:41 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 0, total 60  
04.09.18 12:08:51 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 10, total 60  
04.09.18 12:09:01 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 20, total 60  
04.09.18 12:09:11 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 30, total 60  
04.09.18 12:09:21 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 40, total 60  
04.09.18 12:09:31 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 50, total 60  
04.09.18 12:09:44 (+0200) main 10:09:44 ERROR: [TTN] Connection to server “bridge.eu.thethings.network” failed, retry in 120 seconds  
04.09.18 12:09:44 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 0, total 120  
04.09.18 12:09:54 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 10, total 120  
04.09.18 12:10:04 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 20, total 120  
04.09.18 12:10:14 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 30, total 120  
04.09.18 12:10:24 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 40, total 120  
04.09.18 12:10:34 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 50, total 120  
04.09.18 12:10:44 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 60, total 120  
04.09.18 12:10:54 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 70, total 120  
04.09.18 12:11:04 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 80, total 120  
04.09.18 12:11:14 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 90, total 120  
04.09.18 12:11:24 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 100, total 120  
04.09.18 12:11:34 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 110, total 120  
04.09.18 12:11:46 (+0200) main 10:11:46 ERROR: [TTN] Connection to server “bridge.eu.thethings.network” failed, retry in 240 seconds  
04.09.18 12:11:46 (+0200) main src/ttn\_transport.c:371:ttn\_connect(): ttn\_connect: sleeping() at 0, total 240

---

<div class="post-metadata">

**Author:** ![EricVdB](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/e/ce73a5/32.png) [@EricVdB](https://www.thethingsnetwork.org/forum/u/EricVdB)\
**Post date:** [September 4, 2018, 10:34am UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/2 "2018-09-04T10:34:17Z")

</div>

replace with router.eu.thethings.network

Greetz

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [September 4, 2018, 12:17pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/3 "2018-09-04T12:17:30Z")

</div>

> [@EricVdB](#):
>
> replace with router.eu.thethings.network

No, that is the wrong destination. For TTN transport protocol bridge.eu.thethings.network should be used. (According to the TTN back-end)

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [September 4, 2018, 12:21pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/4 "2018-09-04T12:21:36Z")

</div>

Check your network connection to the back-end. (For instance try to use nc -v bridge.eu.thethings.network 1883) If the connection succeeds, check you gateway ID and key (for instance with mosquitto\_sub with ‘-u ID’ and ‘-P key’.

---

<div class="post-metadata">

**Author:** ![thomaswa](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/thomaswa/32/48087_2.png) [@thomaswa](https://www.thethingsnetwork.org/forum/u/thomaswa)\
**Post date:** [September 4, 2018, 1:20pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/5 "2018-09-04T13:20:06Z")

</div>

I switched to “Router digitalcatapult-uk-router” in the Gateways settings.  
Besides the new connection problem, now also my stability issue for weeks seems to be solved.

---

<div class="post-metadata">

**Author:** ![daz37](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/d/ba9def/32.png) [@daz37](https://www.thethingsnetwork.org/forum/u/daz37)\
**Post date:** [September 4, 2018, 2:02pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/6 "2018-09-04T14:02:16Z")

</div>

Hi,

_ERROR: [TTN] Connection to server “bridge.eu.thethings.network” failed, after rebuilding gateway and setting up new gateway on ttn and new app and device on resin_

Raspberry pi 1 and ic880a gateway started throwing this error after rebuilding the gateway for a tutorial. This build was working perfect up to the time it was taking down for the tutorial. I was wondering if there is a conflict were setting up a new gateway with hardware from a previous built and working gateway would cause an issue. At the moment working gateway is deleted from ttn and the resin app and device were also deleted and reset up from scratch with no joy. i dont know what to try next hoping someone else has encountered this problem aswell and can help me out.

thx in advance

---

<div class="post-metadata">

**Author:** ![froland](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/froland/32/36482_2.png) [@froland](https://www.thethingsnetwork.org/forum/u/froland)\
**Post date:** [September 4, 2018, 2:54pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/7 "2018-09-04T14:54:51Z")

</div>

Hi,

I’m using a RAK831 gateway provisioned with [https://github.com/jpmeijers/ttn-resin-gateway-rpi](https://github.com/jpmeijers/ttn-resin-gateway-rpi) and I had a similar issue today.  
From what I’ve seen when starting the multi-protocol packet forwarder, the router address received from the account server is mqtts://bridge.eu.thethings.network: **8882**.  
I’m going through a corporate firewall which doesn’t let pass a TCP connection that port.  
What is strange is that mqtts standard port is normally 8883.  
Was there a change in the config of the account server?

Anyway, I was able to restore my gateway connection by setting the ROUTER\_MQTT\_ADDRESS environment variable to mqtt://bridge.eu.thethings.network: **1883**.

Using nmap, I found that 1883, 8882 and 8883 ports are all opened (I tested it from outside of my corporate network).  
Both 8882 and 8883 ports present the same SSL certificate.  
I’ll ask the opening of these ports on my corporate firewall and check whether I can then connect back with default parameters (and secured MQTT).

I hope some of you will find hints in this to get their gateway back and running.

Best regards

---

<div class="post-metadata">

**Author:** ![jpmeijers](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jpmeijers/32/44875_2.png) [@jpmeijers](https://www.thethingsnetwork.org/forum/u/jpmeijers)\
**Post date:** [September 4, 2018, 8:24pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/8 "2018-09-04T20:24:49Z")

</div>

@froland was on the correct path. The issue is a combination of a few things:

1. MP packet forwarder only supports MQTT, not MQTTS yet.
2. The resin setup started passing the port specified by the account server to MP, so that the setup will work with private backends.
3. The account server very recently started adding the MQTTS ports to the bridge MQTT address for the public routers.

These three in conjunction caused the MQTTS port to be passed to MP. MP would then fail to connect.

As a workaround the two MQTTS addresses `8882` and `8883` are being replaced by `1882` and `1883` respectively before the address is passed to MP. This should solve the connect issue, while not affecting private instances with custom MQTT ports.

Please find the updated resin setup on:

> **[jpmeijers/ttn-resin-gateway-rpi](https://github.com/jpmeijers/ttn-resin-gateway-rpi)**
>
> Contribute to jpmeijers/ttn-resin-gateway-rpi development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![daz37](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/d/ba9def/32.png) [@daz37](https://www.thethingsnetwork.org/forum/u/daz37)\
**Post date:** [September 5, 2018, 8:29am UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/9 "2018-09-05T08:29:25Z")

</div>

Hi,

yes this has sorted the problem thanks very much for the help much appreciated as we were all day yesterday trying to get this gateway back up and running, what rotting luck to have that this was the issue on the day we tore down the gateway for a tutorial. oh well the joys of engineering. again thanks.

---

<div class="post-metadata">

**Author:** ![pe1mew](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/pe1mew/32/45049_2.png) [@pe1mew](https://www.thethingsnetwork.org/forum/u/pe1mew)\
**Post date:** [September 5, 2018, 1:03pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/10 "2018-09-05T13:03:05Z")

</div>

Ok, this issue affected two of my gateways I was currently building/testing. What a coincidence that the change happend at the same time I was testing 😟.  
Question is: will this affect all existing installations of [resin.io](http://resin.io) gateways? I guess yes.

---

<div class="post-metadata">

**Author:** ![jpmeijers](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jpmeijers/32/44875_2.png) [@jpmeijers](https://www.thethingsnetwork.org/forum/u/jpmeijers)\
**Post date:** [September 5, 2018, 1:27pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/11 "2018-09-05T13:27:54Z")

</div>

It is a good idea to keep all your gateways running [Resin.io](http://Resin.io) updated to the latest version. So you should pull/push the code periodically.

The [change that added support for private backends](https://github.com/jpmeijers/ttn-resin-gateway-rpi/commits/master), and indirectly causing this issue was added on 2 August. So any gateways that were installed/updated between 2 August and last night will be affected.

But as stated, it’s a good idea to update all your gateways anyway. That is why we are using [Resin.io](http://Resin.io) isn’t it?

---

<div class="post-metadata">

**Author:** ![thomaswa](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/thomaswa/32/48087_2.png) [@thomaswa](https://www.thethingsnetwork.org/forum/u/thomaswa)\
**Post date:** [September 5, 2018, 1:28pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/12 "2018-09-05T13:28:50Z")

</div>

Is there a way to have an automatic, perdiocally update mechanism?

---

<div class="post-metadata">

**Author:** ![jpmeijers](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jpmeijers/32/44875_2.png) [@jpmeijers](https://www.thethingsnetwork.org/forum/u/jpmeijers)\
**Post date:** [September 5, 2018, 1:31pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/13 "2018-09-05T13:31:31Z")

</div>

Auto update is not necessarily a good idea. An easy one-click supervised update will be better so that you can see if it succeeds or fails and you need to revert to an older version. You can however run a cron job on a linux server that does the pull-push automatically once a day - only if the code on github changed.

If this feature request comes through, it will make the usage of the resin setup much easier:

> **[Resin directly pull github repo](https://forums.balena.io/t/resin-directly-pull-github-repo/2588)**
>
> Many of my users get stuck on the step where they have to clone my Github repo, add resin as 'n remote, and then push the repo to resin. It is also even more complicated by the SSH key exchange. The user do not have to change anything in the code...

---

<div class="post-metadata">

**Author:** ![froland](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/froland/32/36482_2.png) [@froland](https://www.thethingsnetwork.org/forum/u/froland)\
**Post date:** [September 5, 2018, 1:51pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/14 "2018-09-05T13:51:27Z")

</div>

@jpmeijers, what do we miss to support MQTTS?

I can maybe contribute to this feature.

---

<div class="post-metadata">

**Author:** ![pe1mew](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/pe1mew/32/45049_2.png) [@pe1mew](https://www.thethingsnetwork.org/forum/u/pe1mew)\
**Post date:** [September 5, 2018, 2:01pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/15 "2018-09-05T14:01:53Z")

</div>

the [resin.io](http://resin.io) solution is using the multi packet forwarder of Jac Kersing: [https://github.com/kersing/packet\_forwarder](https://github.com/kersing/packet_forwarder). Here you can contribute to support MQTTS.

---

<div class="post-metadata">

**Author:** ![thomaswa](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/thomaswa/32/48087_2.png) [@thomaswa](https://www.thethingsnetwork.org/forum/u/thomaswa)\
**Post date:** [September 6, 2018, 7:20pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/16 "2018-09-06T19:20:56Z")

</div>

Is it possible that the multi packet forwarder somehow loses connection to router and does not re-establish the connection without restarting the gateway?  
I have “Last Seen 29 minutes ago” in gateway status, also in the Application that have nodes near to this gateway, but when I check the last gateway output there is no error and it says connected:’

06.09.18 21:19:34 (+0200) main ##### 2018-09-06 19:19:34 GMT #####  
06.09.18 21:19:34 (+0200) main ### [UPSTREAM] ###  
06.09.18 21:19:34 (+0200) main # RF packets received by concentrator: 0  
06.09.18 21:19:34 (+0200) main # CRC\_OK: 0.00%, CRC\_FAIL: 0.00%, NO\_CRC: 0.00%  
06.09.18 21:19:34 (+0200) main # RF packets forwarded: 0 (0 bytes)  
06.09.18 21:19:34 (+0200) main # PUSH\_DATA datagrams sent: 0 (0 bytes)  
06.09.18 21:19:34 (+0200) main # PUSH\_DATA acknowledged: 0.00%  
06.09.18 21:19:34 (+0200) main ### [DOWNSTREAM] ###  
06.09.18 21:19:34 (+0200) main # PULL\_DATA sent: 0 (0.00% acknowledged)  
06.09.18 21:19:34 (+0200) main # PULL\_RESP(onse) datagrams received: 0 (0 bytes)  
06.09.18 21:19:34 (+0200) main # RF packets sent to concentrator: 0 (0 bytes)  
06.09.18 21:19:34 (+0200) main # TX errors: 0  
06.09.18 21:19:34 (+0200) main ### BEACON IS DISABLED!  
06.09.18 21:19:34 (+0200) main ### [JIT] ###  
06.09.18 21:19:34 (+0200) main # INFO: JIT queue contains 0 packets.  
06.09.18 21:19:34 (+0200) main # INFO: JIT queue contains 0 beacons.  
06.09.18 21:19:34 (+0200) main ### [GPS] ###  
06.09.18 21:19:34 (+0200) main # No time keeping possible due to fake gps.  
06.09.18 21:19:34 (+0200) main # Manual GPS coordinates: latitude 50.69847, longitude 13.00944, altitude 447 m  
06.09.18 21:19:34 (+0200) main ### [PERFORMANCE] ###  
06.09.18 21:19:34 (+0200) main # Upstream radio packet quality: 0.00%.  
06.09.18 21:19:34 (+0200) main ### [CONNECTIONS] ###  
06.09.18 21:19:34 (+0200) main # [ttn.thingsconnected.net](http://ttn.thingsconnected.net): Connected  
06.09.18 21:19:34 (+0200) main # Semtech status report send.  
06.09.18 21:19:34 (+0200) main ##### END #####  
06.09.18 21:19:34 (+0200) main 19:19:34 INFO: [TTN] [ttn.thingsconnected.net](http://ttn.thingsconnected.net) RTT33  
06.09.18 21:19:34 (+0200) main 19:19:34 INFO: [TTN] send status success for [ttn.thingsconnected.net](http://ttn.thingsconnected.net)  
06.09.18 21:19:38 (+0200) main 19:19:38 INFO: [up] TTN lora packet send to server “[ttn.thingsconnected.net](http://ttn.thingsconnected.net)”  
06.09.18 21:20:04 (+0200) main

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [September 6, 2018, 8:00pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/17 "2018-09-06T20:00:00Z")

</div>

As answered on github where you asked the same question:

> If the connection is lost it will log an error and (attempt) to reconnect. Every status update shows the RTT time, this is a turn around time which requires the back-end to send an MQTT ACK for data received.  
> The behavior observed points to a disconnect between the back-end components, not an issue with the packet forwarder connection to the back-end.

BTW, this forum is the right place for questions, just keep in mind I’m not getting paid for this so I do not sit at the computer 24 hours a day, as a result it might take some time before an answer arrives. (Issues on github are not replied to quicker, which gets handled first depends on what lands in my mailbox first.)

---

<div class="post-metadata">

**Author:** ![thomaswa](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/thomaswa/32/48087_2.png) [@thomaswa](https://www.thethingsnetwork.org/forum/u/thomaswa)\
**Post date:** [September 6, 2018, 8:06pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/18 "2018-09-06T20:06:04Z")

</div>

Thank you for your fast answer.

One question I still have: How can the communication be re-established in this case?

---

<div class="post-metadata">

**Author:** ![thomaswa](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/thomaswa/32/48087_2.png) [@thomaswa](https://www.thethingsnetwork.org/forum/u/thomaswa)\
**Post date:** [September 6, 2018, 8:27pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/19 "2018-09-06T20:27:24Z")

</div>

I have restarted the gateway container (forwarder) and just one second later the gateway was again shown in console as connected and it receives its last seen every 30 seconds again.

So I guess, the gateway must be involved in this interrupted communication? Strange that I could not see any error in the log.

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [September 6, 2018, 8:38pm UTC](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511/20 "2018-09-06T20:38:33Z")

</div>

Your gateway was talking to an active mqtt connection otherwise it would have complained. Restarting the packet forwarder reconnected to may-be the same mqtt instance or may-be to a new one, hard to debug without access to the back-end logs. It might just have been an issue in mqtt for that one connection, also hard to determine.

Glad you are up and running again. Keep in mind the community network has no SLA so things like this will happen from time to time. (Talking from experience)

[Next page](https://www.thethingsnetwork.org/forum/t/connection-to-server-bridge-eu-thethings-network-failed/17511.md?page=2)
