Giter Club home page Giter Club logo

Comments (8)

AdamLearns avatar AdamLearns commented on May 31, 2024 1

Ahh, this is embarrassing. 😳 I had been running the uninstallation command by copy/pasting it from the output of sudo cloudflared service install, which means I was running cloudflared service uninstall and not sudo cloudflared service uninstall that whole time. Sorry to waste your time on an issue that ended up being user error! πŸ€¦β€β™‚οΈ

from cloudflared.

luckman212 avatar luckman212 commented on May 31, 2024

It's working for me... M1 Mac Mini on macOS 14.4

You're installing with sudo right? (You need to)

sudo cloudflared service install <very_long_key> (~180 chars)

from cloudflared.

AdamLearns avatar AdamLearns commented on May 31, 2024

You're installing with sudo right? (You need to)

Yeah, I'm just pasting the commands right from the dashboard, and they include sudo. I'm on a Mac Studio M2 Ultra.

from cloudflared.

luckman212 avatar luckman212 commented on May 31, 2024

Why is the daemon plist under your user account? (/Users/adam/Library/LaunchAgents/com.cloudflare.cloudflared.plist)

Shouldn't it be in /Library/LaunchDaemons/ (that's where mine is)

I would try manually deleting that plist and then running the install command again.

from cloudflared.

AdamLearns avatar AdamLearns commented on May 31, 2024

Why is the daemon plist under your user account? (/Users/adam/Library/LaunchAgents/com.cloudflare.cloudflared.plist)

It isn't actually there though; the error just says that it can't delete a file at that location since it doesn't exist. I don't know why it's looking in that location in the first place though, nor do I know where it used to look a few weeks ago when this was working. 😒

Like I said though, if I touch that file and then run the uninstall command, then the uninstallation goes from failing to passing:

2024-03-09T21:24:59Z INF Uninstalling cloudflared as a user launch agent
2024-03-09T21:24:59Z INF Launchd for cloudflared was uninstalled successfully

...but then the installation still fails:

sudo cloudflared service install [omitted the token]
2024-03-09T21:25:12Z INF Installing cloudflared client as a system launch daemon. cloudflared client will run at boot
2024-03-09T21:25:12Z ERR error generating launchd template error="cloudflared service is already installed at /Library/LaunchDaemons/com.cloudflare.cloudflared.plist; if you are running a cloudflared tunnel, you can point it to multiple origins, avoiding the need to run more than one cloudflared service in the same machine; otherwise if you are really sure, you can do `cloudflared service uninstall` to clean up the existing service and then try again this command"
cloudflared service is already installed at /Library/LaunchDaemons/com.cloudflare.cloudflared.plist; if you are running a cloudflared tunnel, you can point it to multiple origins, avoiding the need to run more than one cloudflared service in the same machine; otherwise if you are really sure, you can do `cloudflared service uninstall` to clean up the existing service and then try again this command

from cloudflared.

luckman212 avatar luckman212 commented on May 31, 2024

Ok. That's really odd. And, even if you become root, there's no corresponding file at /Library/LaunchDaemons ?

from cloudflared.

AdamLearns avatar AdamLearns commented on May 31, 2024

And, even if you become root, there's no corresponding file at /Library/LaunchDaemons

That file exists, and deleting it and then running the install command worked! πŸŽ‰

So maybe the real issue here is that cloudflared service uninstall is trying to delete the wrong file? Even after verifying that my tunnel is up and running, I still get this:

╰─❯ cloudflared service uninstall
2024-03-10T03:44:34Z INF Uninstalling cloudflared as a user launch agent
error deleting /Users/adam/Library/LaunchAgents/com.cloudflare.cloudflared.plist: remove /Users/adam/Library/LaunchAgents/com.cloudflare.cloudflared.plist: no such file or directory

I'm just not sure how that could happen. Is there any configuration that I can look into...?

(P.S. thank you very much for the help! πŸ™)

from cloudflared.

luckman212 avatar luckman212 commented on May 31, 2024

Not sure either, but glad you got it working!

According to the source code

if isRootUser() {
log.Info().Msg("Uninstalling cloudflared as a system launch daemon")
} else {
log.Info().Msg("Uninstalling cloudflared as a user launch agent")
}

It seems that somehow the program is not properly detecting that you're running as root. I would troubleshoot it from that angle.

The code is just checking if your EUID is 0

func isRootUser() bool {
return os.Geteuid() == 0
}

What does the command below yield on your system?

sudo bash -c 'echo $EUID'

from cloudflared.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.