Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

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

Open
DanielJomphe opened this issue Nov 16, 2023 · 6 comments
Open

Comments

@DanielJomphe
Copy link

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

  • OS: macOS Sonoma 14.1.1
  • Shell: zsh
  • fleek version 0.10.5

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 DanielJomphe changed the title Brittle hostname makes fleek apply fail Brittle hostname makes ùfleek apply fail Nov 16, 2023
@DanielJomphe DanielJomphe changed the title Brittle hostname makes ùfleek apply fail Brittle hostname makes fleek apply fail Nov 16, 2023
@DanielJomphe
Copy link
Author

DanielJomphe commented Nov 16, 2023

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
Copy link
Author

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
Copy link
Author

Reproduced the issue on a new mac.

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

  • Daniels-MBP last week
  • Daniels-MacBook-Pro.local today

@DanielJomphe DanielJomphe changed the title Brittle hostname makes fleek apply fail Brittle hostname makes fleek apply fail with Error: system not found Nov 21, 2023
@e-minguez
Copy link

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

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

@DanielJomphe
Copy link
Author

DanielJomphe commented Jan 3, 2024

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
Copy link

cem2ran commented Jan 23, 2024

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants