Skip to content

Sometimes mise just hangs when executing a task #4302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jdx opened this issue Feb 4, 2025 · 14 comments
Open

Sometimes mise just hangs when executing a task #4302

jdx opened this issue Feb 4, 2025 · 14 comments

Comments

@jdx
Copy link
Owner

jdx commented Feb 4, 2025

Discussed in #4275

Originally posted by plu January 31, 2025
We've seen this happen on CI sometimes, but I also found a way to trigger it:

mise-tasks/example

#!/usr/bin/env bash
set -eou pipefail
echo "start $1"
sleep 5
echo "done $1"

Execute:

for i in $(seq 1 30); do mise example $i &; done
ps auxww | grep mise
johannes.plunien 74117   0.0  0.0 411387360  20720 s007  SN    1:35PM   0:00.03 /Users/johannes.plunien/.local/bin/mise example 22

The strange thing is, that the whole invocation of 22 in this case is missing. So it didn't print start 22, neither done 22.

Any idea what this might be?

@plu
Copy link

plu commented Feb 4, 2025

The easiest way to reproduce it is:

mise.toml

[tasks.test]
run = "echo $1"
for i in $(seq 1 20000); do mise test $i; done

It's not necessary to execute anything in parallel.

@jdx jdx marked this as a duplicate of #4303 Feb 6, 2025
@phyber
Copy link

phyber commented Feb 6, 2025

Just a random datapoint that probably doesn't help, but I couldn't reproduce this with either of these examples on a Raspberry Pi 4 running Debian Bookworm, using mise 2025.2.1 linux-arm64 (2025-02-03) from the apt repository.

Perhaps the Raspberry Pi is too slow (it took just over 20 minutes for the [tasks.test] example to complete running) or the behaviour is platform specific (amd64?).

@plu
Copy link

plu commented Feb 7, 2025

I'm also on arm64, but more powerful hardware.

version: 2025.2.1 macos-arm64 (2025-02-03)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL, SELF_UPDATE
  Built: Mon, 3 Feb 2025 11:34:40 +0000
  Rust Version: rustc 1.84.0 (9fc6b4312 2025-01-07)
  Profile: release

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

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

config_files:
  ~/.config/mise/config.toml
  /private/tmp/tmp/mise.toml

ignored_config_files: (none)

backends:
  aqua
  asdf
  cargo
  core
  dotnet
  gem
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  ag           https://github.com/mise-plugins/mise-ag#3a3e2b3
  awscli       https://github.com/MetricMike/asdf-awscli.git#c26bbb4
  create-dmg   https://github.com/tuist/asdf-create-dmg.git#de7c6c1
  maven        https://github.com/mise-plugins/asdf-maven.git#c872214
  pipx         https://github.com/mise-plugins/mise-pipx.git#31db618
  sourcedocs   https://github.com/tuist/asdf-sourcedocs#1d8b6b7
  sourcery     https://github.com/younke/asdf-sourcery.git#1ddd8f1
  swiftformat  https://github.com/mise-plugins/mise-swiftformat#ab1f91f
  swiftlint    https://github.com/mise-plugins/mise-swiftlint#447f94c
  tmux         https://github.com/mise-plugins/mise-tmux.git#f405ff0
  tuist        https://github.com/mise-plugins/mise-tuist#44c87b2
  vim          https://github.com/mise-plugins/mise-vim.git#cd917b0
  xcbeautify   https://github.com/mise-plugins/asdf-xcbeautify#48563a3
  xcodes       https://github.com/younke/asdf-xcodes.git#9f037bf

toolset:
  aqua:FiloSottile/[email protected]
  aqua:jqlang/[email protected]
  aqua:kubernetes/[email protected]
  asdf:[email protected]
  asdf:[email protected]
  asdf:[email protected]
  asdf:[email protected]
  asdf:[email protected]
  asdf:[email protected]
  asdf:[email protected]
  asdf:[email protected]
  [email protected]
  core:[email protected]
  core:[email protected]
  core:[email protected]
  core:[email protected]
  ubi:cli/[email protected]
  ubi:dandavison/[email protected]
  ubi:getsops/[email protected]
  ubi:git-lfs/[email protected]
  ubi:jdx/[email protected]
  ubi:mikefarah/[email protected]
  ubi:sharkdp/[email protected]

path:
  ~/.local/share/mise/installs/age/1.2.1/age
  ~/.local/share/mise/installs/awscli/2.23.4/bin
  ~/.local/share/mise/installs/bat/0.25.0
  ~/.local/share/mise/installs/delta/0.18.2
  ~/.local/share/mise/installs/jq/1.7.1
  ~/.local/share/mise/installs/kubectl/1.32.1
  ~/.local/share/mise/installs/node/23.6.1/bin
  ~/.local/share/mise/installs/python/3.13.1/bin
  ~/.local/share/mise/installs/ruby/3.4.1/bin
  ~/.cargo/bin
  ~/.local/share/mise/installs/sops/3.9.3
  ~/.local/share/mise/installs/swiftformat/0.55.5/bin
  ~/.local/share/mise/installs/swiftlint/0.58.2/bin
  ~/.local/share/mise/installs/tmux/3.5a/bin
  ~/.local/share/mise/installs/tuist/4.40.0/bin
  ~/.local/share/mise/installs/ubi-cli-cli/2.65.0
  ~/.local/share/mise/installs/ubi-git-lfs-git-lfs/3.6.1/bin
  ~/.local/share/mise/installs/usage/2.0.3
  ~/.local/share/mise/installs/vim/9.1.1048/bin
  ~/.local/share/mise/installs/xcbeautify/2.23.0/bin
  ~/.local/share/mise/installs/xcodes/1.6.0/bin
  ~/.local/share/mise/installs/yq/4.45.1/bin
  ~/.local/share/mise/installs/cargo/0.85.0/bin
  ~/.rd/bin
  ~/.local/bin
  /opt/homebrew/bin
  /opt/homebrew/sbin
  ~/bin
  ~/Library/Android/sdk/tools
  ~/Library/Android/sdk/platform-tools
  ~/.rd/bin
  /usr/local/bin
  /System/Cryptexes/App/usr/bin
  /usr/bin
  /bin
  /usr/sbin
  /sbin
  /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
  /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
  /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
  /Library/Apple/usr/bin
  /Applications/iTerm.app/Contents/Resources/utilities

env_vars:
  MISE_SHELL=zsh
  MISE_GITHUB_TOKEN=REDACTED

settings:
  experimental  true    ~/.config/mise/config.toml
  task_output   "quiet" ~/.config/mise/config.toml

No problems found

@hverlin
Copy link
Contributor

hverlin commented Feb 7, 2025

I could not reproduce as well. Are you able to reproduce with the mise docker image?

docker run --pull=always -it --rm --entrypoint bash jdxcode/mise:latest

@plu
Copy link

plu commented Feb 7, 2025

I cannot reproduce it in the docker image either. But I can reproduce it on:

  • Corporate MacBook (M1)
  • Private iMac (M4)
  • Corporate CI runner, Mac Mini, both M1 and x86

@plu
Copy link

plu commented Feb 7, 2025

A quick test on GitHub runners came back negative: https://github.com/plu/mise-test/actions/runs/13198350890/job/36844555169

So it must be something else that all my environments here have in common to trigger the hang.

@phyber
Copy link

phyber commented Feb 7, 2025

Attempting this on a more powerful amd64 machine (also running Debian Bookworm), I got some mise processes to hang using the parallel example. The [tasks.test] example still completed successfully.
This was using the version from the apt repo 2025.2.1 linux-x64 (2025-02-03).

Where in the code are these tasks run from? Is it src/cli/run.rs or somewhere else?

@thedavidharris
Copy link

#4314 seems to describe the situation where we saw this pop up. As soon as we either excluded tools we did not want to be installed, excluded config files altogether or installed all tools before running a task, we no longer saw task hangs.

@boris-smidt-klarrio
Copy link
Contributor

On github actions is completely locks up like this and it can't progress the task.
The weird thing is that it first runs a few tasks and then it starts locking with this trace logging:

TRACE 11 [src/cli/run.rs:324] running task: [ci:pre-test:go]
TRACE 11 [src/lockfile.rs:212] [go@] reading all lockfiles
TRACE 11 [src/lockfile.rs:212] [golangci-lint@] reading all lockfiles
TRACE 11 [src/lockfile.rs:212] [typos@] reading all lockfiles
TRACE 11 [src/toolset/tool_version.rs:40] resolving [email protected] (use_locked_version)
TRACE 11 [src/lockfile.rs:205] [[email protected]] reading lockfile for ~/work/project/mise.toml
TRACE 10 [src/toolset/tool_version.rs:40] resolving [email protected] (use_locked_version)
TRACE 10 [src/lockfile.rs:205] [[email protected]] reading lockfile for ~/work/project/mise.toml
TRACE  7 [src/toolset/tool_version.rs:40] resolving [email protected] (use_locked_version)
TRACE  7 [src/lockfile.rs:205] [[email protected]] reading lockfile for ~/work/tempo-proxy/tempo-proxy/mise.toml
TRACE 11 [src/toolset/builder.rs:52] toolset::builder::build
TRACE 11 [src/toolset/mod.rs:499] env start
TRACE 11 [src/toolset/mod.rs:527] env end
TRACE 11 [src/aqua/aqua_registry.rs:191] reading baked-in aqua-registry for golangci/golangci-lint
TRACE 11 [src/aqua/aqua_registry.rs:191] reading baked-in aqua-registry for crate-ci/typos
TRACE 11 [src/toolset/mod.rs:730] EnvResults
TRACE 11 [src/toolset/mod.rs:499] env start
TRACE 11 [src/toolset/mod.rs:527] env end
TRACE 11 [src/aqua/aqua_registry.rs:191] reading baked-in aqua-registry for golangci/golangci-lint
TRACE  7 [src/aqua/aqua_registry.rs:191] reading baked-in aqua-registry for crate-ci/typos
TRACE 11 [src/toolset/mod.rs:499] env start
TRACE 11 [src/toolset/mod.rs:527] env end
TRACE 11 [src/aqua/aqua_registry.rs:191] reading baked-in aqua-registry for golangci/golangci-lint
TRACE  8 [src/aqua/aqua_registry.rs:191] reading baked-in aqua-registry for crate-ci/typos
TRACE 11 [src/toolset/mod.rs:730] EnvResults
TRACE 11 [src/toolset/mod.rs:499] env start
TRACE 11 [src/toolset/mod.rs:527] env end
TRACE 11 [src/aqua/aqua_registry.rs:191] reading baked-in aqua-registry for golangci/golangci-lint
TRACE 11 [src/aqua/aqua_registry.rs:191] reading baked-in aqua-registry for crate-ci/typos
TRACE  7 [src/cli/run.rs:324] running task: [ci:pre-test]
TRACE  7 [src/lockfile.rs:212] [go@] reading all lockfiles
TRACE  7 [src/lockfile.rs:212] [golangci-lint@] reading all lockfiles

@mhulscher
Copy link

I've only recently started playing around with mise. Today I tried using the gh action and found that running any mise-managed executable would hang. After much fiddling around, it turned out to be the python.uv_venv_auto=true setting. I moved this out of the project mise.toml and into my personal config. Now my github actions no longer block.

@boris-smidt-klarrio
Copy link
Contributor

I found out that the post_dependency and wait_for can cause this lock up.

@motlin
Copy link

motlin commented Feb 27, 2025

I also found that the presence of depends_post can cause a hang, before the task or its dependencies ever execute.

I have two tasks called git:check-local-modifications and maven:compile. If maven:compile includes depends_post like this:

#MISE depends=["git:check-local-modifications"]
#MISE depends_post=["git:check-local-modifications"]

Then mise run maven:compile hangs immediately with no output, and mise run git:check-local-modifications ::: maven:compile also hangs with no output, but mise run git:check-local-modifications works fine.

As a workaround, I call mise run rather than use a depends_post.

@syhol
Copy link
Contributor

syhol commented Mar 11, 2025

I think I'm experiencing the same thing, I've detailed my findings in this discussion: #4608 For my issue, the criteria seem to be:

  • Apple Silicon
  • A few tools used (at least 2 or 3)
  • Multiple task files (recommend trying it with ~50, see my debug script)

@ssbarnea
Copy link
Contributor

ssbarnea commented Apr 8, 2025

I found something that effectively triggers the hand in mise:

[tools]
"npm:prettier-plugin-toml" = "latest" # <-- add this line to make it hang

Not sure that is magic about it but it seems really effective, even running with -vv does not five more info about what is make it choke. The python line has nothing to do with the issue, just happens to be done before that.

TRACE  8 [src/toolset/tool_version.rs:40] resolving [email protected] (use_locked_version)
TRACE  8 [src/lockfile.rs:205] [[email protected]] reading lockfile for ~/.config/mise/config.toml
^CDEBUG  2 [src/ui/ctrlc.rs:27] Ctrl-C pressed, exiting...
DEBUG  2 [src/exit.rs:12] exiting with code: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants