jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
9.95k stars 286 forks source link

bug(mise): when a plugin is missing and the internet connection is out, it crashes the OS. #2485

Closed aamkye closed 2 months ago

aamkye commented 2 months ago

Describe the bug I've noticed that when entering a repository with top-level .mise.toml that has “outdated” versions against system-wide .mise.toml it starts creating system forks, that easily hits max processes limit, and forces me to reboot my system. It seems like Mise is trying to fetch the newest versions — which is okay. But the problem starts whenever there is a network change event — like VPN server switching IPs.

I've figured it out, to raise the limits:

CleanShot 2024-08-21 at 13 22 40

But I think this is not expected behavior to spam this number of forks.

It seems like this might be a problem:

# .mise.toml
settings:
  [status]
  missing_tools = "if_other_versions_installed"

To Reproduce Steps to reproduce the behavior.

Expected behavior Mise does not create such number of forks/subprocesses.

mise doctor output

> mise doctor
version: 2024.8.11 macos-arm64 (2024-08-19)
activated: yes
shims_on_path: yes

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Mon, 19 Aug 2024 02:35:58 +0000
  Rust Version: rustc 1.80.1 (3f5fd8dd4 2024-08-06) (Homebrew)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin23.0)

dirs:
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/Library/Caches/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files:
  ~/.config/mise/config.toml
  ~/.mise.toml
  ~/Projects/Inetum/internal-terraform/.mise.toml

backends:
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  awscli          https://github.com/MetricMike/asdf-awscli.git#ac99537
  git             https://gitlab.com/jcaigitlab/asdf-git.git#0bfd42e
  helm            https://github.com/Antiarchitect/asdf-helm.git#f4b7f38
  k9s             https://github.com/looztra/asdf-k9s.git#2b3af87
  kubectl         https://github.com/asdf-community/asdf-kubectl.git#cbe6df4
  kubectx         https://gitlab.com/wt0f/asdf-kubectx.git#8c0b4aa
  opentofu        https://github.com/virtualroot/asdf-opentofu.git#f49a5f9
  pre-commit      https://github.com/jonathanmorley/asdf-pre-commit.git#26bfc42
  terraform       https://github.com/asdf-community/asdf-hashicorp.git#f1602b6
  terraform-docs  https://github.com/looztra/asdf-terraform-docs.git#acfd01c
  trivy           https://github.com/zufardhiyaulhaq/asdf-trivy.git#537a22a
  trufflehog      https://github.com/Inetum-Poland/asdf-trufflehog.git#809a126

toolset:
  awscli@2.15.61        (missing)
  go@1.22.3             (missing)
  pre-commit@3.7.1      (missing)
  python@3.12.3         (missing)
  terraform@1.8.4
  terraform-docs@0.18.0
  trivy@0.51.4          (missing)
  trufflehog@3.77.0     (missing)
  git@2.46.0
  helm@3.15.3
  k9s@0.32.5
  kubectl@1.30.3
  kubectx@0.9.5

env_vars:
  MISE_SHELL=zsh

settings:
  activate_aggressive = true
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf = true
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_tools = []
  experimental = true
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = 30
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = [
      "python",
      "terraform",
  ]
  libgit2 = true
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = ["~/Projects"]
  quiet = false
  verbose = false
  vfox = false
  yes = false
  ci = false
  debug = false
  trace = false
  log_level = "info"
  python_venv_auto_create = false

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = true
  show_tools = false

No warnings found
2 problems found:

1. shims are missing, run mise reshim to create them
   Missing shims: mid3cp, mid3iconv, mid3v2, moggsplit, mutagen-inspect, mutagen-pony, normalizer, yt-dlp

2. new mise version 2024.8.12 available, currently on 2024.8.11

Additional context CleanShot 2024-08-21 at 13 19 29

CleanShot 2024-08-21 at 13 18 28

This is usually around 660-700:

CleanShot 2024-08-21 at 13 29 56

However, can raise up to this: CleanShot 2024-08-21 at 13 18 37

CleanShot 2024-08-21 at 13 26 13

jdx commented 2 months ago

don't manage git with mise, it's a bad idea

aamkye commented 2 months ago

@jdx can you elaborate on that? And/or may it be related to this issue?

jdx commented 2 months ago

the asdf plugin is calling git which since it's managed by mise requires launching mise then git again ending up in an endless loop

aamkye commented 2 months ago

Ahhhh, so the loop comes from there.., got it, issue, to be closed. You could use this issue in the documentation as a caution for others, "what could happen".