# Failed to connect Cumulocity cloud

**URL:** <https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306>\
**Category:** Forum\
**Tags:** cumulocity-edge, thin-edge-io, device-connectivity, cumulocity\
**Created:** [August 9, 2023, 1:10pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306 "2023-08-09T13:10:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bayrem\_Trabelsi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bayrem_trabelsi/32/14349_2.png) [@Bayrem\_Trabelsi](https://community.cumulocity.com/u/Bayrem_Trabelsi)\
**Post date:** [August 9, 2023, 1:10pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/1 "2023-08-09T13:10:53Z")

</div>

I ran this command:

“sudo tedge connect c8y”

after installing “thin-edge” and uploading the required certificate but I got this error message:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/f/6/f6373b847e9a8f2f54cb56baf231cc81fde508f6.png)

What should I do ?

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [August 9, 2023, 1:31pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/2 "2023-08-09T13:31:21Z")

</div>

The error means that [thin-edge.io](http://thin-edge.io) can’t resolve the c8y.url address that you have configured. This could be for different reasons, but mostly the most common causes are just some operating system level misconfiguration.

Try the following commands to at least gather more information

**Can curl reach the c8y.url?**

```sh
curl https://thin-edge-io.eu-latest.cumulocity.com

# If the above fails, try google
curl google.com

```

**Can you ping the c8y.url?**

```sh
ping thin-edge-io.eu-latest.cumulocity.com

# If the above fails, try google
ping google.com

```

If the [google.com](http://google.com) addresses don’t work, then you definitely have a network issue (connectivity or configuration).

---

<div class="post-metadata">

**Author:** ![Bayrem\_Trabelsi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bayrem_trabelsi/32/14349_2.png) [@Bayrem\_Trabelsi](https://community.cumulocity.com/u/Bayrem_Trabelsi)\
**Post date:** [August 9, 2023, 2:01pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/3 "2023-08-09T14:01:47Z")

</div>

it works

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/f/5/f5216ebce7f0316dbf7eb5233b0f618c1817e11a.png)

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [August 9, 2023, 2:17pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/4 "2023-08-09T14:17:09Z")

</div>

Though you have to use the urls that you configured 😉 Those urls were for my tenant.

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [August 9, 2023, 2:51pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/5 "2023-08-09T14:51:13Z")

</div>

This can be easily done using some bash commands which will read your `c8y.url` settings using convenient `tedge` cli commands.

```sh
C8Y_URL="$(tedge config get c8y.url)"
curl "https://$C8Y_URL"
ping "$C8Y_URL"

```

The above is doing the following:

1. Get the `c8y.url` settings from the tedge config and storing the value in a variable
2. Curl against the url (using the c8y.url from step 1, and adding https:// prefix)
3. Ping against the url (from step 1 as well)

---

<div class="post-metadata">

**Author:** ![Bayrem\_Trabelsi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bayrem_trabelsi/32/14349_2.png) [@Bayrem\_Trabelsi](https://community.cumulocity.com/u/Bayrem_Trabelsi)\
**Post date:** [August 14, 2023, 8:16am UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/6 "2023-08-14T08:16:19Z")

</div>

I dont understand this variable “$(tedge config get c8y.url)”  
can you give me an example

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [August 14, 2023, 9:19am UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/7 "2023-08-14T09:19:05Z")

</div>

You just need to run the code as is. Did you try running it?

Using `$(tedge config get c8y.url)` just uses the tedge cli command to lookup what you have configured as the c8y.url property with [thin-edge.io](http://thin-edge.io) and assigns the value to a bash variable (`C8Y_URL`). The bash variable is then referenced in the follow up curl and ping commands.

---

<div class="post-metadata">

**Author:** ![Bayrem\_Trabelsi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bayrem_trabelsi/32/14349_2.png) [@Bayrem\_Trabelsi](https://community.cumulocity.com/u/Bayrem_Trabelsi)\
**Post date:** [August 14, 2023, 1:18pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/8 "2023-08-14T13:18:31Z")

</div>

I did and this what I get:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/e/b/eb24abc077915ba71b971c8954a154ac00e97335.png)

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [August 14, 2023, 1:34pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/9 "2023-08-14T13:34:25Z")

</div>

You seem to have misspelled your url, it is `cumulocity` (not `cumolocity`)

So try correcting the setting via:

```sh
sudo tedge config set c8y.url wi-hwg-lu.cumulocity.com

```

---

<div class="post-metadata">

**Author:** ![Robert\_Neale](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/robert_neale/32/31965_2.png) [@Robert\_Neale](https://community.cumulocity.com/u/Robert_Neale)\
**Post date:** [August 14, 2023, 1:34pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/10 "2023-08-14T13:34:34Z")

</div>

You’ve got ‘cumolocity’ - should be ‘cumulocity’ configured.

---

<div class="post-metadata">

**Author:** ![Bayrem\_Trabelsi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bayrem_trabelsi/32/14349_2.png) [@Bayrem\_Trabelsi](https://community.cumulocity.com/u/Bayrem_Trabelsi)\
**Post date:** [August 14, 2023, 3:10pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/11 "2023-08-14T15:10:37Z")

</div>

I got this

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/f/6/f6dffbfec17dd61c3ee9b7b5681eb9dbae4d69e7.png)

---

<div class="post-metadata">

**Author:** ![Bayrem\_Trabelsi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bayrem_trabelsi/32/14349_2.png) [@Bayrem\_Trabelsi](https://community.cumulocity.com/u/Bayrem_Trabelsi)\
**Post date:** [August 14, 2023, 3:16pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/12 "2023-08-14T15:16:11Z")

</div>

![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/b/0/b0bf29dc646c64f13ac559043e46d919ed27b212.png)

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [August 14, 2023, 3:24pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/13 "2023-08-14T15:24:40Z")

</div>

I suspect your misspelled url is still in the mosquitto bridge configuration, so you will need to disconnect then connect again using the following commands:

```sh
sudo tedge disconnect c8y
sudo tedge connect c8y

```

---

<div class="post-metadata">

**Author:** ![Bayrem\_Trabelsi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bayrem_trabelsi/32/14349_2.png) [@Bayrem\_Trabelsi](https://community.cumulocity.com/u/Bayrem_Trabelsi)\
**Post date:** [August 14, 2023, 3:48pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/14 "2023-08-14T15:48:59Z")

</div>

I did but still failed to connect

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/5/f/5f82baabb52aa02e917c02f12e686a890677fb59.png)

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [August 14, 2023, 4:19pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/15 "2023-08-14T16:19:11Z")

</div>

> [@Reuben\_Miller2](#):
>
> `wi-hwg-lu.cumulocity.com`

Can you please print out what your settings are (using code blocks please, not screenshots, see [💻 \</\> How to format code in posts and articles - Community news, tips & tricks - Software AG Tech Community & Forums](https://tech.forums.softwareag.com/t/how-to-format-code-in-posts-and-articles/235101)):

**1. Check the mosquitto bridge settings**

```sh
sudo cat /etc/tedge/mosquitto-conf/c8y-bridge.conf

```

**2. Check the tedge settings**

```sh
sudo tedge config list

```

---

<div class="post-metadata">

**Author:** ![Bayrem\_Trabelsi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bayrem_trabelsi/32/14349_2.png) [@Bayrem\_Trabelsi](https://community.cumulocity.com/u/Bayrem_Trabelsi)\
**Post date:** [August 14, 2023, 5:15pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/16 "2023-08-14T17:15:50Z")

</div>

For the first command I’ve got this

> file or directory not found

but for the second one I’ve got this list

> [device.id=iwilr2-5.hwg-lu.de](http://device.id=iwilr2-5.hwg-lu.de)  
> device.key\_path=/etc/tedge/device-certs/tedge-private-key.pem  
> device.cert\_path=/etc/tedge/device-certs/tedge-certificate.pem  
> [device.type=thin-edge.io](http://device.type=thin-edge.io)  
> [c8y.url=wi-hwg-lu.cumulocity.com](http://c8y.url=wi-hwg-lu.cumulocity.com)  
> c8y.root\_cert\_path=/etc/ssl/certs  
> c8y.smartrest.templates=  
> [c8y.http:443=wi-hwg-lu.cumolocity.com](http://c8y.http:443=wi-hwg-lu.cumolocity.com)  
> [c8y.mqtt:8883=wi-hwg-lu.cumolocity.com](http://c8y.mqtt:8883=wi-hwg-lu.cumolocity.com)  
> c8y.topics=[“tedge/measurements”, “tedge/measurements/+”, “tedge/alarms/+/+”, “tedge/alarms/+/+/+”, “tedge/events/+”, “tedge/events/+/+”, “tedge/health/+”, “tedge/health/+/+”]  
> az.root\_cert\_path=/etc/ssl/certs  
> az.mapper.timestamp=true  
> az.topics=[“tedge/measurements”, “tedge/measurements/+”, “tedge/health/+”, “tedge/health/+/+”]  
> aws.root\_cert\_path=/etc/ssl/certs  
> aws.mapper.timestamp=true  
> aws.topics=[“tedge/measurements”, “tedge/measurements/+”, “tedge/alarms/+/+”, “tedge/alarms/+/+/+”, “tedge/events/+”, “tedge/events/+/+”, “tedge/health/+”, “tedge/health/+/+”]  
> mqtt.bind.address=127.0.0.1  
> mqtt.bind.port=1883  
> mqtt.client.host=localhost  
> mqtt.client.port=1883  
> http.bind.port=8000  
> http.bind.address=127.0.0.1  
> software.plugin.max\_packages=1000  
> run.path=/run  
> run.lock\_files=true  
> logs.path=/var/log  
> tmp.path=/tmp  
> data.path=/var/tedge  
> firmware.child.update.timeout=3600  
> service.type=service

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [August 14, 2023, 5:40pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/17 "2023-08-14T17:40:52Z")

</div>

Though can you check the following additional steps:

fyi, you can create a code block using the following (triple backticks), as you previous post contained quoted blocks.

````auto
```
example code
```

````

**1. Check if openssl is able to reach the url**

Though could you just check if openssl is able to reach the Cumulocity IoT url (because if openssl has a problem then tedge will most likely also have a problem), or do you have the VPN still connected, maybe the traffic is being route

```sh
yes | openssl s_client -connect wi-hwg-lu.cumulocity.com:8883

```

**2. Did you upload the cert using the tedge cli?**

Did you upload the certificate using the following command (note: the user will have to be your user). Because I’m kind of surprised that uploading the cert worked, but the connection to c8y doesn’t…or did you manually upload the certificate…if so they why? As this would point to a general connectivity problem with your device.

```auto
tedge cert upload c8y --user myuser@example.com

```

**If everything else fails**

If this still fails then it possible that the device has some custom networking (e.g. using a proxy, or a VPN which is interfering), you might have some success talking with your network admin if this is the case.

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [August 14, 2023, 5:48pm UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/18 "2023-08-14T17:48:33Z")

</div>

> [@Bayrem\_Trabelsi](#):
>
> [c8y.http:443=wi-hwg-lu.cumolocity.com](http://c8y.http:443=wi-hwg-lu.cumolocity.com)  
> [c8y.mqtt:8883=wi-hwg-lu.cumolocity.com](http://c8y.mqtt:8883=wi-hwg-lu.cumolocity.com)

Wait one sec…I just saw that you have some incorrect settings (it was a bit hard to spot because you used a quoted block instead of a code block)…

The `tedge config list` output shows that you have two “weird” entries, which I’m not sure where they came from…

```auto
c8y.http:443=wi-hwg-lu.cumolocity.com
c8y.mqtt:8883=wi-hwg-lu.cumolocity.com

```

It looks like you have accidentally set some invalid settings…can post the contents of the following commands?

```sh
env | grep "TEDGE"
cat /etc/tedge/tedge.toml

```

---

<div class="post-metadata">

**Author:** ![Bayrem\_Trabelsi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bayrem_trabelsi/32/14349_2.png) [@Bayrem\_Trabelsi](https://community.cumulocity.com/u/Bayrem_Trabelsi)\
**Post date:** [August 15, 2023, 7:56am UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/19 "2023-08-15T07:56:18Z")

</div>

Another user uploaded the certificate

you have right there are wrong entries

```auto
pi@IWILR2-5:~ $ env | grep "TEDGE"
pi@IWILR2-5:~ $ cat /etc/tedge/tedge.toml
[config]
version = "2"

[c8y]
url = "wi-hwg-lu.cumulocity.com"
http = "wi-hwg-lu.cumolocity.com:443"
mqtt = "wi-hwg-lu.cumolocity.com:8883"

```

the other user have the admin rights so he uploaded the certificate, can I do it as well or what

---

<div class="post-metadata">

**Author:** ![Reuben\_Miller2](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/reuben_miller2/32/317_2.png) [@Reuben\_Miller2](https://community.cumulocity.com/u/Reuben_Miller2)\
**Post date:** [August 15, 2023, 10:13am UTC](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306/20 "2023-08-15T10:13:23Z")

</div>

> [@Bayrem\_Trabelsi](#):
>
> http = “[wi-hwg-lu.cumolocity.com:443](http://wi-hwg-lu.cumolocity.com:443)”  
> mqtt = “[wi-hwg-lu.cumolocity.com:8883](http://wi-hwg-lu.cumolocity.com:8883)”

It is always worth while reading the output before posting it, as the output shows that your configuration still has the typo in the urls.

Since you are just using the default Cumulocity IoT endpoints, you can actually just delete the `http` and `mqtt` keys under the `c8y` section, so afterwards your `/etc/tedge/tedge.toml` should look like this:

```sh
[config]
version = "2"

[c8y]
url = "wi-hwg-lu.cumulocity.com"

```

[Next page](https://community.cumulocity.com/t/failed-to-connect-cumulocity-cloud/4306.md?page=2)
