dotbot: An error was encountered while executing action link

Here is my current install.conf.yaml file:

#!/usr/bin/env bash

- clean: ['~']

set -e

- link:
  ~/.tmux.conf: tmux.conf
  ~/.vim: vim/
  ~/.vimrc: vimrc
  ~/.zsh: zsh/
  ~/.zshrc: zshrc

- shell:
  - [git submodule update --init --recursive, Installing/updating submodules]

Here is my install script:

#!/usr/bin/env bash

CONFIG="install.conf.yaml"
DOTBOT_DIR="dotbot"

DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

cd "${BASEDIR}"
git submodule update --init --recursive "${DOTBOT_DIR}"

"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}"

Here is my output:

All targets have been cleaned
An error was encountered while executing action link
Action link not handled
Action ~/.zsh not handled
Action ~/.vimrc not handled
Action ~/.vim not handled
Action ~/.zshrc not handled
Action ~/.tmux.conf not handled
Installing/updating submodules [git submodule update --init --recursive]
All commands have been executed

==> Some tasks were not executed successfully

This happens no matter what. I have created and destroyed multiple vimrc, zshrc, etc. files, I have completely removed Dotbot and re-downloaded it, I have tried using JSON formatting. Nothing I seem to try will let me create the links. I’m not sure what the problem is at this point; any suggestions will be appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 21 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I’m glad it’s working now. The issue is that the file represents an array, and the second element of that array is an object with the single mapping, link to an array of links. Written this way:

- link:
  ~/.vimrc: vim

It is interpreted as the following structure:

[
  {
    "link": null,
    "~/.vimrc": "vim"
  }
]

But what you want is this (4 spaces before the vimrc entry):

- link:
    ~/.vimrc: vim

Which is equivalent to:

[
  {
    "link": {
      "~/.vimrc": "vim"
    }
  }
]

Whitespace as part of syntax is kinda annoying, but YAML looks a lot nicer. It’s a tradeoff… And yeah, the JSON, with the right structure, should work.

And by the way, the .yaml file is not a bash script, so I’m not sure why there is a #!/usr/bin/env bash and set -e. The shebang should be treated as a YAML comment, so it’ll still work, but the set -e would cause problems…

Encountered the same error message running on a windows 10 machine with python 2.7.13 and git shell (MINGW64).

$ ./install
All targets have been cleaned
An error was encountered while executing action link
Action link not handled

Upon further investigation the root cause of my issue was that git shell didn’t have sufficient permissions to create a symlink. Running git shell as admin resolved the issue. I also updated python to 3.x

Future Explorers: My issue was caused by my “$SHELL” environment variable containing a newline. Correcting that fixed it. Original problem follows


I’m experiencing this with a config that previously worked… perhaps I made a change and didn’t notice, I do have a yaml formatter on this repo.

brew update
An error was encountered while executing action shell
Action shell not handled

==> Some tasks were not executed successfully
make: *** [setup-home] Error 1
git submodule status
 f5e019105ec5a70a71d5afa78dc44baa0e87b721 dotbot (v1.17.0-3-gf5e0191)
 19407cbe2635d47ec0561d89337de69f4764ae0f dotbot-brew (heads/master)

I’m indenting with 4 spaces.

- defaults:
    link:
      relink: true
      create: true
      force: true
    shell:
      stdin: true
      stdout: true
      stderr: true
    clean:
      force: true

- clean:
    ~/:
      force: true
    ~/.config:
      recursive: true
    ~/.tmux:
      recursive: true
    ~/.gnupg:
      recursive: true
    ~/Documents/Code:
      force: false

- link:
    # Convenience
    ~/Documents/Code: ~/Code
    # Bash
    ~/.bashrc: bash/xdg-shim
    ~/.config/bash/bashrc: bash/bashrc
    # Fasd
    ~/.fasdrc: fasd/.fasdrc
    ~/.config/fasd/.fasdrc: fasd/.fasdrc
    # Fish
    ~/.config/fish/config.fish: fish/config.fish
    ~/.config/fish/fishfile: fish/fishfile
    ~/.config/fish/functions/:
      glob: true
      path: fish/functions/*
    # Git
    ~/.config/git/config: git/config
    ~/.config/git/config.insteadofhttp: git/config.insteadofhttp
    ~/.config/git/message: git/message
    ~/.config/git/ignore: git/ignore
    ~/.config/git/init-template/hooks/prepare-commit-msg:
      path: /usr/local/bin/mit-prepare-commit-msg
      ignore-missing: true
    ~/.config/git/init-template/hooks/commit-msg:
      path: /usr/local/bin/mit-commit-msg
      ignore-missing: true
    ~/.config/git/init-template/hooks/pre-commit:
      path: /usr/local/bin/mit-pre-commit
      ignore-missing: true
    # git-mit
    ~/.config/git-mit/authors.yml: git-mit/authors.yml
    # Git Duet
    ~/.config/git-duet/authors.yml: git-duet/authors.yml
    ~/.bin/git-duet:
      path: /usr/local/bin/git-duet-wrap-for-sops
      ignore-missing: true
    ~/.bin/git-duet-commit:
      path: /usr/local/bin/git-duet-wrap-for-sops
      ignore-missing: true
    ~/.bin/git-duet-install-hook:
      path: /usr/local/bin/git-duet-wrap-for-sops
      ignore-missing: true
    ~/.bin/git-duet-merge:
      path: /usr/local/bin/git-duet-wrap-for-sops
      ignore-missing: true
    ~/.bin/git-duet-post-commit:
      path: /usr/local/bin/git-duet-wrap-for-sops
      ignore-missing: true
    ~/.bin/git-duet-prepare-commit-msg:
      path: /usr/local/bin/git-duet-wrap-for-sops
      ignore-missing: true
    ~/.bin/git-duet-pre-commit:
      path: /usr/local/bin/git-duet-wrap-for-sops
      ignore-missing: true
    ~/.bin/git-duet-revert:
      path: /usr/local/bin/git-duet-wrap-for-sops
      ignore-missing: true
    ~/.bin/git-solo:
      path: /usr/local/bin/git-duet-wrap-for-sops
      ignore-missing: true

    # GnuPG
    ~/.gnupg/gpg-agent.conf: gnupg/gpg-agent.conf
    # Starship
    ~/.config/starship.toml: starship/starship.toml
    # Tmux
    ~/.config/tmux/tmux.conf: tmux/tmux.conf
    # Vim
    ~/.config/vim/.vimrc: vim/.vimrc
    # ZSH
    ~/.zshenv: zsh/.zshenv
    ~/.config/zsh/.zshrc: zsh/.zshrc
    # Kitty
    ~/.config/kitty/kitty.conf: kitty/kitty.conf
    ~/.config/kitty/dracula.conf: kitty/dracula.conf
    # Sops
    ~/.sops.yaml: sops/sops.yaml
    ~/.bin/1password: 1password/bin/1password
    # Cargo
    ~/.cargo/config: cargo/config

- create:
    - ~/Code/
    - ~/Downloads/
    - ~/Documents/
    - ~/Desktop/
    - ~/Library/Caches/
    - ~/Library/Caches/run/
    - ~/.local/share/
    # Tmux
    - ~/.config/tmux/plugins

- brewfile:
    - brew/Brewfile

- shell:
    - command: brew update
    - command: brew upgrade
    - command: brew cask upgrade
    - command: brew bundle cleanup --force --file="brew/Brewfile"
    - command: mas upgrade
    - command: rustup-init -y
    - command: rustup update
    - command: cargo install cargo-script
    - command: crontab - <"crontab/crontab"
    - command: ./fish/bin/make-default-shell
    - command: fish -c fisher
    - command: ./bash/bin/test
    - command: gcloud components update --quiet
    - command: ./git/bin/test
    - command: ./git-duet/bin/test
    - command: fix-gnupg-permissions
    - command: ./gnupg/bin/test
    - command: ./tldr/bin/test
    - command: ./vim/bin/test
    - command: fix-compaudit
    - command: ./zsh/bin/test
    - command: setup-a-keyring-for-sops secret-store purplebooth-secret-storage sops sops-key
    - command: bash -c "if [[ ! -f ~/.config/gcloud/application_sops_credentials.json ]] ; then cp \"~/.config/gcloud/application_default_credentials.json\" \"~/.config/gcloud/application_sops_credentials.json\" ; fi"
    - command: ./1password/bin/generate-envsecret

This exact install yaml worked a couple of days ago.