asdf: bug: lib/utils.bash: line 234: ASDF_.._VERSION: invalid variable name
Describe the Bug
When I run neovim latest asdf
reports an invalid variable name.
Steps to Reproduce
~
➜ nvim
/home/jesse/.asdf/lib/utils.bash: line 234: ASDF_.._VERSION: invalid variable name
Expected Behaviour
Neovim would start with no error notice in the terminal.
Actual Behaviour
I see this error message:
/home/jesse/.asdf/lib/utils.bash: line 234: ASDF_.._VERSION: invalid variable name
Environment
OS:
Linux jimmie 5.11.0-31-generic #33-Ubuntu SMP Wed Aug 11 13:19:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
SHELL:
fish, version 3.1.2
ASDF VERSION:
v0.8.1-a1ef92a
ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/home/jesse/.asdf
ASDF INSTALLED PLUGINS:
deno https://github.com/asdf-community/asdf-deno.git
dotnet-core https://github.com/emersonsoares/asdf-dotnet-core.git
elixir https://github.com/asdf-vm/asdf-elixir.git
elm https://github.com/asdf-community/asdf-elm.git
erlang https://github.com/asdf-vm/asdf-erlang.git
haskell https://github.com/vic/asdf-haskell.git
lua https://github.com/Stratus3D/asdf-lua.git
neovim https://github.com/richin13/asdf-neovim.git
nodejs https://github.com/asdf-vm/asdf-nodejs.git
postgres https://github.com/smashedtoatoms/asdf-postgres.git
python https://github.com/danhper/asdf-python.git
redis https://github.com/smashedtoatoms/asdf-redis.git
ruby https://github.com/asdf-vm/asdf-ruby.git
rust https://github.com/code-lever/asdf-rust.git
shfmt https://github.com/luizm/asdf-shfmt.git
yq https://github.com/sudermanjr/asdf-yq.git
### asdf plugins affected (if relevant)
It might be one of the later plugins I have installed. Plugins that might be affecting it:
* dotnet-core
* haskell
* neovim (naturally)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 26 (12 by maintainers)
Commits related to this issue
- Only iterate over directories in the plugins/ directory Fixes part of #1029 — committed to Stratus3D/asdf by Stratus3D 2 years ago
- fix: only iterate over directories in the plugins/ directory Fixes part of #1029 — committed to Stratus3D/asdf by Stratus3D 2 years ago
- fix: only iterate over directories in the plugins/ directory Fixes part of #1029 — committed to Stratus3D/asdf by Stratus3D 2 years ago
- fix: only iterate over directories in the plugins/ directory Fixes part of #1029 — committed to Stratus3D/asdf by Stratus3D 2 years ago
- fix: only iterate over directories in the plugins/ directory (#1228) Fixes part of #1029 — committed to asdf-vm/asdf by Stratus3D 2 years ago
The problem (at least on my side) is that running
asdf reshim
sometimes (god knows why) adds a ghost plugin candidate..
to the shim file, and because how the reshim script works, it’s never removed.Print from my
npm
shim file for example:See those
asdf-plugin: ..
, those are the ones that are causing the issue.The workaround for me is deleting the shim script and then reshimming:
You might as well delete all others shims and reshim them all over again:
I don’t know if this issue exists because I kept messing with symlinks in the plugins dir, or because some bug in the past created them.
I think the solution should be cleaning these ghost plugins after reshims, or making a specific command for pruning/cleaning the shims directory
@augustobmoura thanks for the comment. It appears we’ve got a bug somewhere in our reshim logic as I just encountered issue myself (and I’m not using any symlinks). It does appear
..
is getting added somehow. Perhaps from the output ofls
or a similar command.Update:
asdf-vm
is not the root cause for my case; it’s actually a container virtualization bug in Alpine Linux 3.14 and has nothing to do with extra/missing files under~/.asdf
. Upgrading to a newer Docker version, which contains a newerrunc
, fixed the issue in my case.It does seem like ASDF has some circular error case, where a stub that is non executable causes bizarre error messages (because asdf is parsing its own error output to determine something about the shim). Not a big issue though, as long as one’s shims are all proper.
For me
seemed to do the trick
Closing as I’ve not gotten any responses on whether this issue still exists with the latest version. I will reopen if not resolved.
I’m encountering this too, but weirdly, only in CI, while invoking asdf inside a Docker image that I have previously built. Tt does not reproduce locally for me. I pasted some things you’ve asked others for, but I don’t think the issue involves stray files under
~/.asdf/plugins
in my case.My findings: cannot identify shim as executable
I narrowed it down to
shim_plugin_versions
and specifically to this conditional:shim_path
is/var/www/.asdf/shims/bundle
in this case, and in fact I can reproduce the test from the bash CLI:However, it looks executable to me! I don’t understand why the
-x
test is failing; I tried adding a proper space to the shebang line (#! /usr/bin/env bash
) as well as just directly invoking bash (#! /bin/bash
).Obviously I can invoke this shim (it’s how we get into the error condition in the first place!) but something makes bash 5 think it’s not executable.
Marginally useful troubleshooting info