Cloudflared service will not run on Rpi5

Hello.
I am trying to install Cloudflared on a Raspberry Pi 5 following this guide
OS: Bookworm
Tunnel Name: webServer
Environment: Debian and arm64bit

After copying the commands and paste into CLI I get the following:

$ curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64.deb && 

sudo dpkg -i cloudflared.deb && 

sudo cloudflared service install eyJhIjoiZmFhZWY3MjYwOWE1ZjdhZDFlMjE0MjAzNzM4MmZjMWIiLCJ0IjoiOTQyZmM2ODQtZGMwYS00ZDZmLWI4OTItM2UzNGRlMTA0OTVkIiwicyI6Ik5EZzRNV1U1WXpFdFpESm1OeTAwTWprekxUZzFaR010WmpVM01HWmtNamN5WXpjeCJ9
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 15.9M  100 15.9M    0     0  3488k      0  0:00:04  0:00:04 --:--:-- 5728k
Selecting previously unselected package cloudflared.
(Reading database ... 167335 files and directories currently installed.)
Preparing to unpack cloudflared.deb ...
Unpacking cloudflared (2024.4.0) ...
Setting up cloudflared (2024.4.0) ...
Processing triggers for man-db (2.11.2-2) ...
2024-04-15T02:54:43Z INF Using Systemd
systemctl [start cloudflared.service] returned with error code exit status 1 due to: Job for cloudflared.service failed because the control process exited with error code.
See "systemctl status cloudflared.service" and "journalctl -xeu cloudflared.service" for details.

Then I do a status and get this:

$ sudo systemctl status cloudflared.service 
● cloudflared.service - cloudflared
     Loaded: loaded (/etc/systemd/system/cloudflared.service; enabled; preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2024-04-15 12:55:07 AEST; 126ms ago
    Process: 45684 ExecStart=/usr/bin/cloudflared --no-autoupdate tunnel run --token eyJhIjoiZmFhZWY3MjYwOWE1ZjdhZDFlMjE>
   Main PID: 45684 (code=exited, status=1/FAILURE)
        CPU: 69ms

Apr 15 12:55:07 DesktopServer systemd[1]: Failed to start cloudflared.service - cloudflared.

I haven’t been able to find any relevant articles to help fix this.
if anyone has any further ideas it would be appricated.

Thanks

and when I read the journal I get this:

$ journalctl -xeu cloudflared.service
β–‘β–‘ The job identifier is 101144 and the job result is done.
Apr 15 12:55:33 DesktopServer systemd[1]: Starting cloudflared.service - cloudflared...
β–‘β–‘ Subject: A start job for unit cloudflared.service has begun execution
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ A start job for unit cloudflared.service has begun execution.
β–‘β–‘ 
β–‘β–‘ The job identifier is 101144.
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF Starting tunnel tunnelID=942fc684-dc0a-4d6f-b>
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF Version 2024.4.0
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF GOOS: linux, GOVersion: go1.21.5, GoArch: arm>
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF Settings: map[no-autoupdate:true token:*****]
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF cloudflared will not automatically update if >
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF Generated Connector ID: 94f5a4c0-8c90-43ac-b0>
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF Initial protocol quic
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF ICMP proxy will use 192.168.1.35 as source fo>
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF ICMP proxy will use 2403:5803:2fa7:0:3413:e01>
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF Starting metrics server on 127.0.0.1:43459/me>
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF You requested 4 HA connections but I can give>
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z INF Tunnel server stopped
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z ERR Initiating shutdown error="there are no free >
Apr 15 12:55:33 DesktopServer cloudflared[45816]: 2024-04-15T02:55:33Z ERR icmp router terminated error="context cancele>
Apr 15 12:55:34 DesktopServer cloudflared[45816]: 2024-04-15T02:55:34Z INF Metrics server stopped
Apr 15 12:55:34 DesktopServer cloudflared[45816]: there are no free edge addresses left to resolve to
Apr 15 12:55:34 DesktopServer systemd[1]: cloudflared.service: Main process exited, code=exited, status=1/FAILURE
β–‘β–‘ Subject: Unit process exited
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ An ExecStart= process belonging to unit cloudflared.service has exited.
β–‘β–‘ 
β–‘β–‘ The process' exit code is 'exited' and its exit status is 1.
Apr 15 12:55:34 DesktopServer systemd[1]: cloudflared.service: Failed with result 'exit-code'.
β–‘β–‘ Subject: Unit failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ The unit cloudflared.service has entered the 'failed' state with result 'exit-code'.
Apr 15 12:55:34 DesktopServer systemd[1]: Failed to start cloudflared.service - cloudflared.
β–‘β–‘ Subject: A start job for unit cloudflared.service has failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ A start job for unit cloudflared.service has finished with a failure.
β–‘β–‘ 
β–‘β–‘ The job identifier is 101144 and the job result is failed.


Thanks

Can you expand the logs line for these messages

This is likely where the error is.

Thanks Cyb3r_Jak3 for responding. Here is the full report

journalctl -xeu cloudflared.service
β–‘β–‘ The job identifier is 889491 and the job result is done.
Apr 16 05:18:49 DesktopServer systemd[1]: Starting cloudflared.service - cloudflared...
β–‘β–‘ Subject: A start job for unit cloudflared.service has begun execution
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ A start job for unit cloudflared.service has begun execution.
β–‘β–‘ 
β–‘β–‘ The job identifier is 889491.
Apr 16 05:18:49 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF Starting tunnel tunnelID=942fc684-dc0a-4d6f-b892-3e34de10495d
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF Version 2024.4.0
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF GOOS: linux, GOVersion: go1.21.5, GoArch: arm64
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF Settings: map[no-autoupdate:true token:*****]
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF cloudflared will not automatically update if installed by a package manager.
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF Generated Connector ID: c740b9b3-e317-47c4-9733-e336a715ef30
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF Initial protocol quic
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF ICMP proxy will use 192.168.1.35 as source for IPv4
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF ICMP proxy will use 2403:5803:2fa7:0:3413:e014:920a:260d in zone wlan0 as source for IPv6
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF Starting metrics server on 127.0.0.1:39533/metrics
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF You requested 4 HA connections but I can give you at most 0.
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z INF Tunnel server stopped
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z ERR Initiating shutdown error="there are no free edge addresses left to resolve to"
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:49Z ERR icmp router terminated error="context canceled"
Apr 16 05:18:50 DesktopServer cloudflared[318938]: 2024-04-15T19:18:50Z INF Metrics server stopped
Apr 16 05:18:50 DesktopServer cloudflared[318938]: there are no free edge addresses left to resolve to
Apr 16 05:18:50 DesktopServer systemd[1]: cloudflared.service: Main process exited, code=exited, status=1/FAILURE
β–‘β–‘ Subject: Unit process exited
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ An ExecStart= process belonging to unit cloudflared.service has exited.
β–‘β–‘ 
β–‘β–‘ The process' exit code is 'exited' and its exit status is 1.
Apr 16 05:18:50 DesktopServer systemd[1]: cloudflared.service: Failed with result 'exit-code'.
β–‘β–‘ Subject: Unit failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ The unit cloudflared.service has entered the 'failed' state with result 'exit-code'.
Apr 16 05:18:50 DesktopServer systemd[1]: Failed to start cloudflared.service - cloudflared.
β–‘β–‘ Subject: A start job for unit cloudflared.service has failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: https://www.debian.org/support
β–‘β–‘ 
β–‘β–‘ A start job for unit cloudflared.service has finished with a failure.
β–‘β–‘ 
β–‘β–‘ The job identifier is 889491 and the job result is failed.

Hi
Well I seem to have had a bit of a break through today. I got the tunnel working. But I’m not exactly sure what caused it to start working. I rebooted my server and wifi modem which I’ve done countless times since January when the tunnel first stopped working. But this time when I re-installed Cloudflared it came back with Cloudflared successfully installed. So I left it for a bit then configured a couple of endpoints and they worked. So I left them for about an hour and still worked. But I wasn’t convinced it was 100% fixed. So I uninstalled CloudFlared and reinstalled only for it fail to install as before. So I went through all the same processes as before by rebooting server and modem but still would not install… But then later this afternoon I did a check of the tunnel on the Cloudflare dashboard to find it in a Healthy state. This would have been to least 45 minutes after the last install attempt that failed. So I’ll leave it on this temporary server for now and see how it goes. Is it possible to run the same tunnel on 2 different servers?? Thanks.

Well that didn’t last long. The tunnel has stopped and again can’t reinstall it.

Hi. Does anyone know what the 2 following errors mean when running up a tunnel??

You requested 4 HA connections but I can give you at most 0.

and

ERR Initiating shutdown error="there are no free edge addresses left to resolve to"

below is the output of the run command: /usr/bin/cloudflared --no-autoupdate tunnel run --token <token>

2024-04-20T02:50:37Z INF Starting tunnel tunnelID=942fc684-dc0a-4d6f-b892-3e34de10495d
2024-04-20T02:50:37Z INF Version 2024.4.0
2024-04-20T02:50:37Z INF GOOS: linux, GOVersion: go1.21.5, GoArch: arm64
2024-04-20T02:50:37Z INF Settings: map[no-autoupdate:true token:*****]
2024-04-20T02:50:37Z INF cloudflared will not automatically update if installed by a package manager.
2024-04-20T02:50:37Z INF Generated Connector ID: 0682d48b-463e-4d87-8345-ade92f831817
2024-04-20T02:50:37Z INF Initial protocol quic
2024-04-20T02:50:37Z INF ICMP proxy will use 192.168.1.35 as source for IPv4
2024-04-20T02:50:37Z INF ICMP proxy will use 2403:5803:2fa7:0:3413:e014:920a:260d in zone wlan0 as source for IPv6
2024-04-20T02:50:37Z INF Starting metrics server on 127.0.0.1:39411/metrics
2024-04-20T02:50:37Z INF You requested 4 HA connections but I can give you at most 0.
2024-04-20T02:50:37Z INF Tunnel server stopped
2024-04-20T02:50:37Z ERR Initiating shutdown error="there are no free edge addresses left to resolve to"
2024-04-20T02:50:37Z ERR icmp router terminated error="context canceled"
2024-04-20T02:50:38Z INF Metrics server stopped
there are no free edge addresses left to resolve to
256

Thanks

@hutchosgarage did you resolved ? I get same wrong on pi 5

I use docker, get same errror

2024-04-25T01:45:33Z INF Starting tunnel tunnelID=a7940863-e528-40e9-a463-27e7b8b46c99
2024-04-25T01:45:33Z INF Version 2024.4.1
2024-04-25T01:45:33Z INF GOOS: linux, GOVersion: go1.21.5-devel-cf, GoArch: arm64
2024-04-25T01:45:33Z INF Settings: map[no-autoupdate:true token:*****]
2024-04-25T01:45:33Z INF Generated Connector ID: 50c20c9b-a46c-4e63-af97-1caa18951c42
2024-04-25T01:45:33Z INF Initial protocol quic
2024-04-25T01:45:33Z INF ICMP proxy will use 172.17.0.5 as source for IPv4
2024-04-25T01:45:33Z INF ICMP proxy will use :: as source for IPv6
2024-04-25T01:45:33Z INF Starting metrics server on 127.0.0.1:42105/metrics
2024-04-25T01:45:33Z INF You requested 4 HA connections but I can give you at most 0.
2024-04-25T01:45:33Z INF Tunnel server stopped
2024-04-25T01:45:33Z ERR Initiating shutdown error="there are no free edge addresses left to resolve to"
2024-04-25T01:45:33Z ERR icmp router terminated error="context canceled"
2024-04-25T01:45:34Z INF Metrics server stopped
there are no free edge addresses left to resolve to

Hi @ndsunwei . I have not been able to find out what those 2 errors mean. However I have recently been rebooting my NetComm NF20MESH modem which seems to get the tunnel working. Although it can take a couple of reboots to bring the tunnel up.

I am now working on the theory that the ethernet cable that runs from the modem to my garage may be the problem. That cable connects to a Cloudmesh Satellite NS-02 access point in the garage. I have already swapped that access point with another one but did not help. I will test that cable over the next few days and let you know how it goes.

I would really like to know what the 4 HA reference means in the error message. It could really help!!!

Can you try forcing cloudflared to use ipv4?

Hi @Cyb3r-Jak3. Thanks for the suggestion.

I added the parameter –edge-ip-version 4 to the command in the service file. Is that what you meant??

/usr/bin/cloudflared --no-autoupdate tunnel --edge-ip-version 4 run --token

However it didn’t make any difference. I rebooted the Rpi now I can’t connect at all.

Weird. At this point, I’d recommend filing an issue at the Cloudflared repo

1 Like

Thanks @Cyb3r-Jak3 . I’ll try that. Yesterday I did manage to get the tunnel up after a few modem reboots and port resets. I’ll just leave it running now!!

1 Like

I use Ubuntu virtual machine to run Docker,run successful。So I guess Pi5 uses ipv6, but my network doesn’t support it,Can we consider this issue from this direction. My Pi5 closed ipv6 in /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Hi @ndsunwei,
Have you had any luck getting the Cloudflare connection working??

I made a complete tutorial showing all the steps needed to get Raspberry Pi working with Cloudflare:

Raspberry-PI-CloudFlare

I hope it helps you

Hi

Thank you for the tutorial.

I tried the steps but still get an error when installing cloudflared on a raspberry pi as below:

pi@raspberrypi3:~ $ curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64.deb &&

sudo dpkg -i cloudflared.deb &&

sudo cloudflared service install

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0
100 16.3M 100 16.3M 0 0 1672k 0 0:00:10 0:00:10 --:–:-- 1789k
Selecting previously unselected package cloudflared.
(Reading database … 158948 files and directories currently installed.)
Preparing to unpack cloudflared.deb …
Unpacking cloudflared (2024.10.0) …
Setting up cloudflared (2024.10.0) …
Processing triggers for man-db (2.11.2-2) …
2024-10-19T00:51:52Z INF Using Systemd
systemctl [start cloudflared.service] returned with error code exit status 1 due to: Job for cloudflared.service failed because the control process exited with error code.
See β€œsystemctl status cloudflared.service” and β€œjournalctl -xeu cloudflared.service” for details.

I first installed Cloudflared in December 2022 and it worked fine up until 1/1/2024 when it just stopped working. And I’ve had this error ever since trying to re-install.

So I went to Tailscale which works ok.

But thanks anyway

Regards
John Hutcheson