symphony icon indicating copy to clipboard operation
symphony copied to clipboard

bug: Silent failure during installation - stow conflicts not properly handled ???

Open hayarza opened this issue 11 months ago • 7 comments

What went wrong?

boot.sh → install.sh → install/stow.sh

Steps to reproduce

  • cannot stow dotfiles/.config/hypr/hyprland.conf over existing target .config/hypr/hyprland.conf since neither a link nor a directory and --adopt not specified

guy from reddit here trying to make sense why it would silently fail the the "Linking dotfiles" step in stow.sh

Not exactly sure what's happening here tbh

OS: Arch-based (Omarchy) Existing dotfiles: Yes GNU Stow version: 2.4.1

What did you expect to happen?

for it to backup .dotfiles correctly... it seems to fail halfway thru

What actually happened?

  • cannot stow dotfiles/.config/hypr/hyprland.conf over existing target .config/hypr/hyprland.conf since neither a link nor a directory and --adopt not specified
  • source is an absolute symlink dotfiles/.config/gtk-3.0/colors.css => /home/vyrx/.config/symphony/current/.config/gtk-3.0/colors.css
    • source is an absolute symlink dotfiles/.config/gtk-4.0/colors.css => /home/vyrx/.config/symphony/current/.config/gtk-4.0/colors.css

installer fails silently and trying to switch themes will result in hyprland rebooting to defaults

Theme

No response

Affected areas (check all that apply)

  • [ ] Terminal (kitty/ghostty/alacritty)
  • [ ] Hyprland
  • [ ] Waybar
  • [ ] Rofi
  • [ ] GTK (3/4)
  • [ ] Swaync
  • [ ] btop
  • [ ] cava
  • [ ] yazi
  • [ ] rmpc
  • [ ] vesktop
  • [ ] Obsidian
  • [ ] Neovim

Logs or screenshots (optional)

  • cannot stow dotfiles/.config/waybar/config.jsonc over existing target .config/waybar/config.jsonc since neither a link nor a directory and --adopt not specified
  • cannot stow dotfiles/.config/waybar/style.css over existing target .config/waybar/style.css since neither a link nor a directory and --adopt not specified
  • source is an absolute symlink dotfiles/.config/gtk-3.0/colors.css => /home/vyrx/.config/symphony/current/.config/gtk-3.0/colors.css
  • source is an absolute symlink dotfiles/.config/gtk-4.0/colors.css => /home/vyrx/.config/symphony/current/.config/gtk-4.0/colors.css All operations aborted.^C

hayarza avatar Dec 24 '25 22:12 hayarza

symlinks being absolute seem to be the issue.. pointing to /home/vyrx/

hayarza avatar Dec 24 '25 22:12 hayarza

looking at the code a little closer the offending line in stow.sh looks to be

echo "$output" | grep -v "^LINK:"

something like:

LINK: .config/tmux => ../dotfiles/.config/tmux
LINK: .config/yazi => ../dotfiles/.config/yazi
WARNING! stowing . would cause conflicts:
  * cannot stow dotfiles/.config/alacritty/alacritty.toml over existing target .config/alacritty/alacritty.toml since neither a link nor a directory and --adopt not specified
  * cannot stow dotfiles/.config/brave-flags.conf over existing target .config/brave-flags.conf since neither a link nor a directory and --adopt not specified
  * cannot stow dotfiles/.config/btop/btop.conf over existing target .config/btop/btop.conf since neither a link nor a directory and --adopt not specified

looks like the warning ones are getting drowned out by grep

hayarza avatar Dec 24 '25 22:12 hayarza

Fixed in commit 14437f9.

Root causes identified:

  1. .config/gtk-3.0/colors.css and .config/gtk-4.0/colors.css were committed as absolute symlinks pointing to /home/vyrx/... - this broke stow for all users since that path doesn't exist on their systems
  2. stow.sh only backed up 5 hardcoded items, missing many configs that Omarchy users would have (ghostty, alacritty, btop, etc.)
  3. Script ended with true, masking all failures

Fix:

  • Removed the absolute symlinks from git (hooks create them at runtime anyway)
  • Rewrote stow.sh to dynamically detect ALL conflicts via dry-run and backup only what's needed
  • Script now fails loudly with exit 1 if stow fails

@hayarza - please try again with a fresh clone and let me know if it works now!

vyrx-dev avatar Dec 25 '25 17:12 vyrx-dev

@vyrx-dev , just flagging, mine still silent failed when running the install. To troubleshoot, I manually did the steps in stow.sh via terminal:

cd /home/alex/dotfiles dry_run=$(stow -n -v . 2>&1) echo $dry_run

This clearly displayed that I had an exisiting nvim install in ~/.config that was preventing stow from running, however the script by itself did not provide this verbose. It seems this may not be performing as expected:

conflicts=$(echo "$dry_run" | grep "cannot stow" | sed -n 's/.existing target ([^ ]).*/\1/p')

Sorry, I would have pasted the output but I deleted nvim and re-ran which resulted in a correct install. Just wanted to flag that with an existing NVIM installation the install script exited without providing any verbose to why it failed. The only words produced were "Linking dotfiles::"

@011000100110111101101111

Did everything else work fine?

vyrx-dev avatar Dec 26 '25 19:12 vyrx-dev

@vyrx-dev

Yes, once manually remediating the rest of the script worked perfectly 😄. Very cool btw, thanks!

Hey everyone, just pushed a fix that should resolve this for good.

What was happening: The script was capturing stow's output and filtering it with grep -v "^LINK:" to hide the noisy link messages. Problem is, this also hid the actual error messages in some cases, leaving you with a silent failure and no idea what went wrong.

What's fixed now:

  • Stow runs directly so you see its real output (errors and all)
  • Conflict detection is more reliable - backs up the exact files stow complains about
  • Backups are now timestamped (~/.dotfiles-backup/20241227_143052/) so multiple runs don't overwrite each other
  • Removed some trailing code that was masking failures

@011000100110111101101111 @hayarza - this should fix the silent failure you both experienced. Pull the latest and give it another shot:

cd ~/dotfiles
git pull
./install.sh

Let me know if you hit any other issues!

vyrx-dev avatar Dec 27 '25 12:12 vyrx-dev