ublue-os / fleek

[deprecated] Own your $HOME
https://getfleek.dev
Apache License 2.0
831 stars 27 forks source link

Brittle hostname makes `fleek apply` fail with `Error: system not found` #324

Open DanielJomphe opened 1 year ago

DanielJomphe commented 1 year ago

Describe the bug fleek apply worked fine yesterday after I installed Fleek and every time I called it in the next hour or so.

Today:

image

To Reproduce Put the Mac to sleep and let it wake? Not sure.

Expected behavior A stable way to identify the host would fix this without having us editing our .fleek.yml.

Environment

Additional context I didn't change the Mac's hostname. Here's what it was yesterday, and still is today:

image

149 is similar in some ways.

DanielJomphe commented 1 year ago

So there would be some inconsistency somewhere.

I suppose /bin/hostname and the go util for hostname don't see things eye to eye.

It would help if instead of printing

Error: system not found 

we got e.g.

Error: `admins-MBP` system not found among the expected systems:

        admins-MacBook-Pro.local
        abcd.local
        efgh.whatever

I wonder if this new employer would allow me to take some time to try contributing a patch for this? I'm no regular go and nix developer, though, and obviously, making the hostname resolution more consistent, or standardizing based on serial number might be better (as suggested in #149; not sure I like the idea of this, though, since it's not readable and a bit creepy).

Furthermore, what should I do now? I could copy-paste or rename stuff around in my dotfiles but I'm trying to reach for an easier way to recuperate so that my less tech-savvy colleagues would feel OK with us using fleek. I hoped fleek join could be abused locally but it doesn't seem to be the case. Or if colleagues did initially get their fleek setup through fleek join <git...>, yes, it might repair their setup if they joined again the same way, assuming that this new joining would use the new hostname, not the old hostname (that's assuming a lot!)... I'm going to try this on the next computer when I see it happen again.

DanielJomphe commented 1 year ago

A way to circumvent the issue is by abusing the ephemeral systems feature:

export FLEEK_HOST_OVERRIDE=admins-MacBook-Pro.local
fleek apply

But still, having colleagues export an envar for this might be a bit too much.

DanielJomphe commented 1 year ago

Reproduced the issue on a new mac.

If I remember well, here are the results of running hostname, based on when I ran it:

e-minguez commented 11 months ago

Documented here https://getfleek.dev/docs/troubleshooting/system_not_found

It happened to me when I switched to a different network.

DanielJomphe commented 10 months ago

The same new mac as on Nov 20 above echoes a third different hostname today:

Air-de-Daniel which is clearly that of my personal MacBook Air on the same network, which uses a different username and Apple ID, etc.!!

If I toggle off my network adapter, hostname reverts to one of the other values.

This all goes to confirm that hostname is too brittle on the mac.

My current strategy is to duplicate the systems in .fleek.yml and to symlink each duplicate system's folder to its original config name...

Update: this symlinking strategy is only good when my mac steals the hostname of another mac which I will never use fleek with! Otherwise, I obviously don't want them to conflict on their hostname. When my mac recently stole the hostname of another fleek-equipped mac, I chose to use the export FLEEK_HOST_OVERRIDE=... trick above...

cem2ran commented 10 months ago

Going home and to work it breaks as hostname is dependent on the network and I would have to make the change every day, potentially multiple times a day. Wouldn't consider this a fix: https://getfleek.dev/docs/troubleshooting/system_not_found