cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

Service stalls on boot

Open mrparkerlol opened this issue 6 years ago • 4 comments

After installing the service, it appears to stall on boot. Here's the logs for the service start:

parker@ubuntu:~$ sudo service cloudflared status
[sudo] password for parker: 
● cloudflared.service - Argo Tunnel
   Loaded: loaded (/etc/systemd/system/cloudflared.service; enabled; vendor preset: enabled)
   Active: activating (start) since Mon 2020-02-10 16:47:49 PST; 16min ago
 Main PID: 3876 (cloudflared)
    Tasks: 10 (limit: 4915)
   CGroup: /system.slice/cloudflared.service
           └─3876 /usr/local/bin/cloudflared --config /etc/cloudflared/config.yml --origincert /etc/cloudflared/cert.pem --no-autoupdate

Feb 10 16:47:49 ubuntu systemd[1]: Starting Argo Tunnel...
Feb 10 16:47:49 ubuntu cloudflared[3876]: time="2020-02-10T16:47:49-08:00" level=info msg="Version 2020.2.0"
Feb 10 16:47:49 ubuntu cloudflared[3876]: time="2020-02-10T16:47:49-08:00" level=info msg="GOOS: linux, GOVersion: go1.12.7, GoArch: amd64"
Feb 10 16:47:49 ubuntu cloudflared[3876]: time="2020-02-10T16:47:49-08:00" level=info msg=Flags config=/etc/cloudflared/config.yml hostname=tunnel.domain no-au
Feb 10 16:47:49 ubuntu cloudflared[3876]: time="2020-02-10T16:47:49-08:00" level=info msg="Starting metrics server" addr="127.0.0.1:33829"
Feb 10 16:47:49 ubuntu cloudflared[3876]: time="2020-02-10T16:47:49-08:00" level=info msg="Proxying tunnel requests to http://localhost"
Feb 10 16:47:50 ubuntu cloudflared[3876]: time="2020-02-10T16:47:50-08:00" level=info msg="Connected to LAX" connectionID=0

It doesn't ever appear in the control panel, and doesn't ever allow connections through the tunnel it creates.

I have read the documentation and have re-read it - it just doesn't seem to ever fully start. I have installed the service using sudo permissions.

After manually starting it after logging in after boot - it works using the same config file. I honestly don't know what could be happening here.

mrparkerlol avatar Feb 11 '20 01:02 mrparkerlol

I am running into this same exact issue. It works fine if I manually run cloudflared, but when I try to start the service which specifies a config file, it gets stuck on the "Connected to DFW connectionID=0 line.

It's very odd because I went through the exact same process setting up the cloudflared service on another server and it worked perfectly fine. I don't know what is different in this case.

aftadros avatar Feb 15 '20 20:02 aftadros

I just figured out the cause of this issue. You need to make sure you copy the certificate that gets generated when you do the cloudflared login step, it needs to be copied from /root/.cloudflared/cert.pem over to /etc/cloudflared/cert.pem. After I did this it was able to start up successfully.

aftadros avatar Feb 15 '20 20:02 aftadros

I think cloudflared should provide more information about a certificate issue though, instead of just stalling like it currently does.

aftadros avatar Feb 15 '20 20:02 aftadros

Doing what @aftadros suggested fixed it. ~~Even though I provide a path to the actual certificate in the config yml - it seems to just ignore it?~~ scratch that, I completely forgot that - I will have to re-read the documentation to figure if I can add it.

Odd fix, would've never thought of this - thanks! Will keep this open so maybe someone could add this as a warning for people to the project or for people to find this easier.

mrparkerlol avatar Feb 16 '20 01:02 mrparkerlol