Skip to content

Error on update: No preset version installed for command go

Overview

make gitlab-shell-asdf-install and other make targets in support/makefiles/Makefile.*.mk try to use ASDF_DEFAULT_TOOL_VERSIONS_FILENAME to install dependencies, but it doesn't work properly (at least, the following is what I experienced).

For example, if:

  • gitlab-shell/.tool-versions contains golang 1.21.6

  • and you have golang 1.21.5 installed

  • but you do not have golang 1.21.6

  • and you see these warnings during gdk update:

    Notice: Behaving like ASDF_GOLANG_MOD_VERSION_ENABLED=true
            In the future this will have to be set to continue
            reading from the go.mod and go.work files
  • then make gitlab-shell-asdf-install will not install golang 1.21.6. Instead it will say golang 1.21.5 is already installed.

Impacted categories

The following categories relate to this issue:

Steps to replicate (optional)

  1. Uninstall a tool version which is specified in <your-gdk-dir>/gitlab-shell/.tool-versions, e.g. asdf uninstall golang 1.21.7 (but replace 1.21.7 with the current golang version)

  2. Install a prior tool version if you don't already have one, e.g. asdf install golang 1.21.6

  3. make gitlab-shell-asdf-install

  4. The output will include golang 1.21.6 is already installed

  5. If you see these warnings:

    Notice: Behaving like ASDF_GOLANG_MOD_VERSION_ENABLED=true
            In the future this will have to be set to continue
            reading from the go.mod and go.work files
  6. Then make will fail like this:

Click here to expand
--------------------------------------------------------------------------------
Installing asdf tools from /Users/mkozonogitlab/Developer/gdk/gitlab-shell/.tool-versions
--------------------------------------------------------------------------------
Notice: Behaving like ASDF_GOLANG_MOD_VERSION_ENABLED=true
        In the future this will have to be set to continue
        reading from the go.mod and go.work files
golang 1.21.7 is already installed
ruby 3.2.3 is already installed

--------------------------------------------------------------------------------
Installing gitlab-org/gitlab-shell Ruby gems
--------------------------------------------------------------------------------
Bundle check passed.
Notice: Behaving like ASDF_GOLANG_MOD_VERSION_ENABLED=true
        In the future this will have to be set to continue
        reading from the go.mod and go.work files
Notice: Behaving like ASDF_GOLANG_MOD_VERSION_ENABLED=true
        In the future this will have to be set to continue
        reading from the go.mod and go.work files
Notice: Behaving like ASDF_GOLANG_MOD_VERSION_ENABLED=true
        In the future this will have to be set to continue
        reading from the go.mod and go.work files
No preset version installed for command go
Please install a version by running one of the following:

asdf install golang 1.22.0

or add one of the following versions in your config file at /Users/mkozonogitlab/Developer/gdk/gitlab-shell/.tool-versions
golang 1.18.10
golang 1.18.8
golang 1.20.10
golang 1.20.9
golang 1.21.4
golang 1.21.5
golang 1.21.6
golang 1.21.7
make[2]: *** [bin/gitlab-shell] Error 126
make[1]: *** [gitlab-shell-setup] Error 2
make: *** [gitlab-shell-update-timed] Error 2
ℹ️  gdk update: after hook -> make gitlab/git-checkout-auto-generated-files
❌️ ERROR: Failed to update.
-------------------------------------------------------
You can try the following that may be of assistance:

- Run 'gdk doctor'.

- Visit the troubleshooting documentation:
  https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/troubleshooting/index.md.
- Visit https://gitlab.com/gitlab-org/gitlab-development-kit/-/issues to
  see if there are known issues.

- Run 'gdk reset-data' if appropriate.
- Run 'gdk pristine' which will restore your GDK to a pristine state.
-------------------------------------------------------

Proposal (optional)

It turns out ASDF_DEFAULT_TOOL_VERSIONS_FILENAME must be a filename, not a file path.

There are multiple ideas for how to fix/workaround this in !3547 (closed).

Environment (optional)

  • Operating system name: <!-- output of `uname -a` command -->
  • Architecture: <!-- output of `arch` command -->
  • The contents of your gdk.yml (if any)
  • Ruby version: <!-- output of `ruby --version` command -->
  • GDK version: <!-- output of `git rev-parse --short HEAD` command -->