GitHub Actions上でmiseで一部のツールだけインストールしようとすると失敗する
何がしたいかというと、mise.toml
にあるうち、CIで必要なツールのみインストールして、時短したい
キャッシュさえあればほぼ時間は変わらないので困ってはいないが一応。mise.toml
に更新が入ってキャッシュが使えないRenovateのPRはCIの時間がやばかったりはする
ほっとけば直るかもと思って放置してたが、全然直る気配すら無いので困った
ただ、これ以外特に関係しそうなPRを見つけられていない
複数のmiseが同時にファイルを読み込もうとしてなどと書いてあるが、GitHub Actions上で複数同時になるはずはない…はず
ちなみに、ローカルだとたまに失敗するがほぼ失敗しない。おそらくツールが何も無い状態からインストールしたときだけ発生する
こんな感じで Install backend tools が失敗してるように見えるが、実際はよく見るとわかるが、そのstepまでは成功していて、その後が時間かかりすぎでキャンセルされている。
ハングアウトしているのかわからないが、ログすら一切表示されない。リアルタイムだと表示されるのだが、jobが完了してからだと見れない
何も表示されずに止まってることもあるが、こんなエラーが表示されることがままある。複数回表示されてることもある
mise failed to parse cache file: /home/runner/.cache/mise/ubi-suzuki-shunsuke-ghalint/remote_versions-d3e61.msgpack.z IO error while reading marker: failed to fill whole buffer: failed to fill whole buffer
msgpack.z
はなんかいい感じのデータ保存フォーマットらしいので、おそらくだがキャッシュを小さくするために使っているのだろう
中身が見れない
shellでjsonに変換できるっぽいので、homebrewで入れて見てみる
homebrewでなんか入らなかったので諦めてaptで入れる
msgpack2json: parse error: mpack_error_io (2)
こんなエラーを吐いた
ちゃんとドキュメント読んだら、zlibで圧縮されてると書かれたので、それが原因っぽそう
これの入れ方がよくわからないので、とりあえずさっきので試してみる
cat /home/runner/.cache/mise/ubi-suzuki-shunsuke-ghalint/remote_versions-d3e61.msgpack.z | \
perl -e 'use Compress::Raw::Zlib;my $d=new Compress::Raw::Zlib::Inflate();my $o;undef $/;$d->inflate(<>,$o);print $o;' | \
msgpack2json -d
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
MISE_EXPERIMENTAL: 1
MISE_LOG_LEVEL: info
MISE_TRUSTED_CONFIG_PATHS: /home/runner/work/dotfiles/dotfiles
MISE_YES: 1
cat: /home/runner/.cache/mise/ubi-suzuki-shunsuke-ghalint/remote_versions-d3e61.msgpack.z: No such file or directory
Usage: Compress::Raw::Zlib::inflateStream::inflate(s, buf, output, eof=FALSE) at -e line 1.
msgpack2json: parse error: mpack_error_io (2)
そんなファイルは無いと言われた。もしかして単に存在しないファイルにアクセスしようとしてエラー吐いてる?
1回もインストールしたことが無くてキャッシュが無いツールが mise.toml
に含まれてる状態で mise run
とかを呼ぶと失敗する説
ls -aR /home/runner/.cache/mise
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
MISE_EXPERIMENTAL: 1
MISE_LOG_LEVEL: info
MISE_TRUSTED_CONFIG_PATHS: /home/runner/work/dotfiles/dotfiles
MISE_YES: 1
/home/runner/.cache/mise:
.
..
bun
lockfiles
node
/home/runner/.cache/mise/bun:
.
..
1.1.29
remote_versions-d3e61.msgpack.z
/home/runner/.cache/mise/bun/1.1.29:
.
..
/home/runner/.cache/mise/lockfiles:
.
..
64bf20b6bbc1e1f5
85864aab989ee7f4
8e219fc550094392
/home/runner/.cache/mise/node:
.
..
22.9.0
remote_versions-d3e61.msgpack.z
/home/runner/.cache/mise/node/22.9.0:
.
..
この通り、インストールしてないツールのキャッシュは無いことは確定
scriptなので、shimsが使われており、bun install
も実際にはmiseのバイナリを呼ぶので、それが原因っぽい
scriptなのでというか、多分miseのactionでやってくれてる
コードを読みます
install_missing_bin
が怪しそう、install時にキャッシュを必要としそう、なので、MISE_NOT_FOUND_AUTO_INSTALL=false
で無視させてみる
mise doctor
を事前に追加しただけのほうで、以下のエラーが bun install
で出た
The application panicked (crashed).
Message: The global thread pool has not been initialized.: ThreadPoolBuildError { kind: IOError(Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }) }
Location: /cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.1/src/registry.rs:168
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
The application panicked (crashed).
Message: The global thread pool has not been initialized.: ThreadPoolBuildError { kind: IOError(Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }) }
Location: /cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.1/src/registry.rs:168
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
mise failed to resolve toolset: Failed to resolve npm:cspell@8.14.4 from ~/work/dotfiles/dotfiles/mise.toml: Resource temporarily unavailable (os error 11): Failed to resolve npm:renovate@38.93.6 from ~/work/dotfiles/dotfiles/mise.toml: Resource temporarily unavailable (os error 11): Failed to resolve npm:markdownlint-cli2@0.14.0 from ~/work/dotfiles/dotfiles/mise.toml: Resource temporarily unavailable (os error 11): Failed to resolve npm:prettier@3.3.3 from ~/work/dotfiles/dotfiles/mise.toml: Resource temporarily unavailable (os error 11): error resolving versions
mise failed to resolve toolset: Failed to resolve npm:cspell@8.14.4 from ~/work/dotfiles/dotfiles/mise.toml: Resource temporarily unavailable (os error 11): Failed to resolve npm:renovate@38.93.6 from ~/work/dotfiles/dotfiles/mise.toml: Resource temporarily unavailable (os error 11): Failed to resolve npm:markdownlint-cli2@0.14.0 from ~/work/dotfiles/dotfiles/mise.toml: Resource temporarily unavailable (os error 11): Failed to resolve npm:prettier@3.3.3 from ~/work/dotfiles/dotfiles/mise.toml: Resource temporarily unavailable (os error 11): error resolving versions
The application panicked (crashed).
Message: The global thread pool has not been initialized.: ThreadPoolBuildError { kind: IOError(Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }) }
Location: /cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.1/src/registry.rs:168
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
The application panicked (crashed).
Message: The global thread pool has not been initialized.: ThreadPoolBuildError { kind: IOError(Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }) }
failed to resolve toolset
云々は、なぜnodeが入ってるのに失敗しているのかはさておき、あまり問題ではない
なんかスレッドプールがいっぱいになってるっぽいエラーだが、原因がわからない。rustのエラーなので、bunではなくmiseのエラーではある
昔調べてた記憶が薄っすらよみがえってきたが、rayonは確かスレッド管理のライブラリだった気がする
並列計算のライブラリだった
MISE_NOT_FOUND_AUTO_INSTALL=false
にしたほうはこのエラーが出なかったが、ハングアウトするのは変わらない
ちょっと似てるエラーは見つけたが、違いそう
ローカルでWSLを起動した直後に同様のエラーが出た
The global thread pool has not been initialized.
という通りっぽいが、GHAでは要因が別そう
別に最初のstepというわけでもないので
cancelledなstepのログが見れない件、view raw logsから見れるらしいが、見れないときがある
多分ログの保存すらできていない?
もしかして、メモリリークをmiseが起こしている?
Rustでメモリリークとかあるんだろうか
何らかの処理が無限ループしており、そのせいでメモリが足りなくなってるらしい
これがGHAのログが見れない、またThe global thread pool has not been initialized
の原因っぽい
ログ
[TRACE] (1) xx::file: [/cargo/registry/src/index.crates.io-6f17d22bba15001f/xx-1.1.8/src/file.rs:165] touch /home/runner/.cache/mise/.auto_prune
[DEBUG] (1) xx::file: [/cargo/registry/src/index.crates.io-6f17d22bba15001f/xx-1.1.8/src/file.rs:111] mkdirp: "/home/runner/.cache/mise/.auto_prune"
[DEBUG] (1) mise::cache: [src/cache.rs:193] pruning old cache files, this behavior can be modified with the MISE_CACHE_PRUNE_AGE setting
[DEBUG] (1) mise::cli: [src/cli/mod.rs:222] ARGS: mise x -- bun install
[TRACE] (1) mise::config: [src/config/mod.rs:69] Settings: Settings {
activate_aggressive: false,
all_compile: false,
always_keep_download: false,
always_keep_install: false,
asdf: true,
asdf_compat: false,
cache_prune_age: "30d",
cargo_binstall: true,
color: true,
disable_default_shorthands: false,
disable_hints: {},
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_gobin: None,
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: {},
libgit2: true,
node_compile: false,
not_found_auto_install: true,
paranoid: false,
pipx_uvx: false,
plugin_autoupdate_last_check_duration: "7d",
python_compile: None,
python_default_packages_file: Some(
"/home/runner/.default-python-packages",
),
python_patch_url: None,
python_patches_directory: None,
python_precompiled_arch: None,
python_precompiled_os: None,
python_pyenv_repo: "https://github.com/pyenv/pyenv.git",
raw: false,
ruby: SettingsRuby {
apply_patches: None,
default_packages_file: "~/.default-gems",
ruby_build_repo: "https://github.com/rbenv/ruby-build.git",
ruby_build_opts: None,
ruby_install: false,
ruby_install_repo: "https://github.com/postmodern/ruby-install.git",
ruby_install_opts: None,
verbose_install: None,
},
shorthands_file: None,
status: SettingsStatus {
missing_tools: IfOtherVersionsInstalled,
show_env: false,
show_tools: false,
},
task_output: None,
trusted_config_paths: {
"/home/runner/work/dotfiles/dotfiles",
},
quiet: false,
use_versions_host: true,
verbose: true,
vfox: false,
yes: true,
ci: true,
cd: None,
debug: true,
env_file: None,
trace: true,
log_level: "trace",
python_venv_auto_create: false,
}
[TRACE] (2) mise::file: [src/file.rs:149] cat ~/.local/share/mise/installs/ubi/.mise.backend.json
[TRACE] (3) mise::file: [src/file.rs:149] cat ~/.local/share/mise/installs/bun/.mise.backend.json
[TRACE] (5) mise::file: [src/file.rs:149] cat ~/.local/share/mise/installs/node/.mise.backend.json
[TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:85] parsing: ~/work/dotfiles/dotfiles/mise.toml
[TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/dotfiles/dotfiles/mise.toml
[TRACE] (1) mise::file: [src/file.rs:149] cat ~/work/dotfiles/dotfiles/mise.toml
[TRACE] (1) mise::config::config_file::mise_toml: [src/config/config_file/mise_toml.rs:98] # ref: https://mise.jdx.dev/configuration.html
#:schema https://mise.jdx.dev/schema/mise.json
[tools]
bun = "1.1.29"
node = "22.9.0"
# cspell:ignore datasource
# renovate: datasource=crate
"ubi" = "0.1.2"
# renovate: extractVersion=^cli/v(?<version>.+)
"ubi:biomejs/biome" = "cli/v1.9.2"
actionlint = "1.7.2"
"ubi:suzuki-shunsuke/ghalint" = "v0.2.12" # cspell:ignore shunsuke
"ubi:suzuki-shunsuke/pinact" = "v0.2.1"
"ubi:tamasfe/taplo" = "0.9.2" # cspell:ignore tamasfe
"npm:prettier" = "3.3.3"
"npm:markdownlint-cli2" = "0.14.0"
shfmt = "3.9.0"
shellcheck = "0.10.0"
yamlfmt = "0.13.0"
# renovate: datasource=pypi
yamllint = "1.35.1" # cspell:ignore pypi
"npm:renovate" = "38.94.3"
"npm:cspell" = "8.14.4"
"ubi:lycheeverse/lychee" = "v0.15.1" # cspell:ignore lycheeverse
# renovate: extractVersion=^v(?<version>\d+\..+)
"ubi:crate-ci/typos" = "v1.24.6"
[tasks.commit]
depends = ["buni:root"]
run = ["git add .", "bun run git-cz"]
[tasks."commit:staged"]
depends = ["buni:root"]
run = "bun run git-cz"
[tasks.check]
depends = [
"check:*", # lint and/or fix formatting
"lint:*", # lint only
]
[tasks.ci]
depends = [
"ci:*", # lint and/or check formatting
"lint:*", # lint only
]
hide = true
[tasks."check:biome"]
run = "biome check --write --error-on-warnings"
[tasks."ci:biome"]
run = "biome ci --error-on-warnings"
hide = true
[tasks."check:tsc"]
depends = ["buni"]
run = ["bun run tsc", "bun run --cwd worker tsc"]
[tasks."ci:tsc"]
depends = ["buni"]
run = [
"bun run tsc --incremental false",
"bun run --cwd worker tsc --incremental false",
]
hide = true
[tasks."lint:jsonschema"]
depends = ["buni:root"]
run = "bun run scripts/validate-json-schema.ts"
alias = "check:jsonschema"
[tasks."lint:actionlint"]
run = "actionlint -color"
alias = "check:actionlint"
[tasks."lint:ghalint"]
run = "ghalint run"
alias = "check:ghalint"
[tasks."check:pinact"]
run = "pinact run --verify"
[tasks."ci:pinact"]
depends = ["check:pinact"]
run = "mise run util:nodiff"
hide = true
[tasks."check:taplo"]
# schema of wrangler.toml is in node_modules
depends = ["buni:worker"]
run = ["taplo lint", "taplo fmt"]
[tasks."ci:taplo"]
depends = ["buni:worker"]
run = ["taplo lint", "taplo fmt --check --diff"]
hide = true
[tasks."check:prettier"]
run = "prettier --write --cache ."
[tasks."ci:prettier"]
run = "prettier --check ."
hide = true
[tasks."check:markdownlint"]
run = "markdownlint-cli2 --fix"
[tasks."ci:markdownlint"]
run = "markdownlint-cli2"
hide = true
[tasks."check:shfmt"]
run = "shfmt --list --write --simplify . **/.bashrc"
[tasks."ci:shfmt"]
run = "shfmt --diff --simplify . **/.bashrc"
hide = true
[tasks."lint:shellcheck"]
run = "shellcheck **/*.sh **/.bashrc"
alias = "check:shellcheck"
[tasks."check:yamlfmt"]
run = "yamlfmt ."
[tasks."ci:yamlfmt"]
run = "yamlfmt -lint ."
hide = true
[tasks."lint:yamllint"]
run = "yamllint --strict ."
alias = "check:yamllint"
[tasks."lint:renovate"]
run = "renovate-config-validator --strict"
alias = "check:renovate"
[tasks."check:cspell"]
run = "cspell --cache \"**/*\""
[tasks."ci:cspell"]
run = "cspell \"**/*\""
hide = true
[tasks."check:lychee"]
run = "lychee --cache \"**/*\""
[tasks."ci:lychee"]
run = "lychee --verbose \"**/*\""
hide = true
[tasks."check:typos"]
run = "typos --write-changes"
[tasks."ci:typos"]
run = "typos"
hide = true
[tasks."check:ignore-sync"]
depends = ["buni:root"]
run = "bun run ignore-sync ."
[tasks."ci:ignore-sync"]
depends = ["check:ignore-sync"]
run = "mise run util:nodiff"
hide = true
[tasks."worker:dev"]
depends = ["buni:worker", "worker:util:prepare-vars"]
run = "bun run wrangler dev --compatibility-date $(mise run worker:util:extract-compat-date)"
dir = "worker"
[tasks."worker:test"]
depends = ["buni:worker"]
run = "bun run vitest watch --ui"
dir = "worker"
[tasks."worker:test:ci"]
depends = ["buni:worker"]
run = "bun run vitest run"
dir = "worker"
[tasks."buni"] # cspell:ignore buni
depends = ["buni:root", "buni:worker"]
[tasks."buni:root"]
run = "bun install --frozen-lockfile"
hide = true
[tasks."buni:worker"]
run = "bun install --frozen-lockfile"
dir = "worker"
hide = true
[tasks."util:nodiff"] # cspell:ignore nodiff
run = ["git add .", "git diff --staged --exit-code"]
hide = true
[tasks."sync:brew"]
run = "brew bundle dump --global --force"
[DEBUG] (1) mise::config: [src/config/mod.rs:90] Config {
Config Files: [
"~/work/dotfiles/dotfiles/mise.toml",
],
}
[TRACE] (4) mise::backend: [src/backend/mod.rs:322] Ensuring dependencies installed for ubi:suzuki-shunsuke/ghalint
[TRACE] (3) mise::backend: [src/backend/mod.rs:322] Ensuring dependencies installed for npm:markdownlint-cli2
[TRACE] (5) mise::backend: [src/backend/mod.rs:322] Ensuring dependencies installed for ubi:biomejs/biome
[DEBUG] (4) mise::toolset::tool_request_set: [src/toolset/tool_request_set.rs:152] ToolRequestSet.build(93.715µs): ToolRequestSet: bun@1.1.29 node@22.9.0 ubi@0.1.2 ubi:biomejs/biome@cli/v1.9.2 actionlint@1.7.2 ubi:suzuki-shunsuke/ghalint@v0.2.12 ubi:suzuki-shunsuke/pinact@v0.2.1 ubi:tamasfe/taplo@0.9.2 npm:prettier@3.3.3 npm:markdownlint-cli2@0.14.0 shfmt@3.9.0 shellcheck@0.10.0 yamlfmt@0.13.0 yamllint@1.35.1 npm:renovate@38.94.3 npm:cspell@8.14.4 ubi:lycheeverse/lychee@v0.15.1 ubi:crate-ci/typos@v1.24.6
[TRACE] (4) mise::backend: [src/backend/mod.rs:191] Listing remote versions for ubi:suzuki-shunsuke/ghalint
[TRACE] (4) mise::cache: [src/cache.rs:88] reading ~/.cache/mise/ubi-suzuki-shunsuke-ghalint/remote_versions-d3e61.msgpack.z
[TRACE] (3) mise::backend: [src/backend/mod.rs:191] Listing remote versions for npm:markdownlint-cli2
[DEBUG] (3) mise::cmd: [src/cmd.rs:91] $ npm view markdownlint-cli2 versions --json
[TRACE] (5) mise::backend: [src/backend/mod.rs:191] Listing remote versions for ubi:biomejs/biome
[TRACE] (5) mise::cache: [src/cache.rs:88] reading ~/.cache/mise/ubi-biomejs-biome/remote_versions-d3e61.msgpack.z
[TRACE] (2) mise::backend: [src/backend/mod.rs:322] Ensuring dependencies installed for npm:renovate
[TRACE] (2) mise::backend: [src/backend/mod.rs:191] Listing remote versions for npm:renovate
[DEBUG] (2) mise::cmd: [src/cmd.rs:91] $ npm view renovate versions --json
[TRACE] (5) mise::backend: [src/backend/mod.rs:322] Ensuring dependencies installed for npm:cspell
[TRACE] (5) mise::backend: [src/backend/mod.rs:191] Listing remote versions for npm:cspell
[DEBUG] (5) mise::cmd: [src/cmd.rs:91] $ npm view cspell versions --json
[TRACE] (4) mise::backend: [src/backend/mod.rs:322] Ensuring dependencies installed for ubi:suzuki-shunsuke/pinact
[TRACE] (4) mise::backend: [src/backend/mod.rs:191] Listing remote versions for ubi:suzuki-shunsuke/pinact
[TRACE] (4) mise::cache: [src/cache.rs:88] reading ~/.cache/mise/ubi-suzuki-shunsuke-pinact/remote_versions-d3e61.msgpack.z
[TRACE] (4) mise::backend: [src/backend/mod.rs:322] Ensuring dependencies installed for ubi:tamasfe/taplo
[TRACE] (4) mise::backend: [src/backend/mod.rs:191] Listing remote versions for ubi:tamasfe/taplo
[TRACE] (4) mise::cache: [src/cache.rs:88] reading ~/.cache/mise/ubi-tamasfe-taplo/remote_versions-d3e61.msgpack.z
[TRACE] (4) mise::backend: [src/backend/mod.rs:322] Ensuring dependencies installed for npm:prettier
[TRACE] (4) mise::backend: [src/backend/mod.rs:191] Listing remote versions for npm:prettier
[DEBUG] (4) mise::cmd: [src/cmd.rs:91] $ npm view prettier versions --json
[TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view markdownlint-cli2 versions --json
[TRACE] (1) mise::config: [src/config/mod.rs:69] Settings: Settings {
activate_aggressive: false,
all_compile: false,
always_keep_download: false,
always_keep_install: false,
asdf: true,
asdf_compat: false,
cache_prune_age: "30d",
cargo_binstall: true,
color: true,
disable_default_shorthands: false,
disable_hints: {},
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_gobin: None,
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: {},
libgit2: true,
node_compile: false,
not_found_auto_install: true,
paranoid: false,
pipx_uvx: false,
plugin_autoupdate_last_check_duration: "7d",
python_compile: None,
python_default_packages_file: Some(
"/home/runner/.default-python-packages",
),
python_patch_url: None,
python_patches_directory: None,
python_precompiled_arch: None,
python_precompiled_os: None,
python_pyenv_repo: "https://github.com/pyenv/pyenv.git",
raw: false,
ruby: SettingsRuby {
apply_patches: None,
default_packages_file: "~/.default-gems",
ruby_build_repo: "https://github.com/rbenv/ruby-build.git",
ruby_build_opts: None,
ruby_install: false,
ruby_install_repo: "https://github.com/postmodern/ruby-install.git",
ruby_install_opts: None,
verbose_install: None,
},
shorthands_file: None,
status: SettingsStatus {
missing_tools: IfOtherVersionsInstalled,
show_env: false,
show_tools: false,
},
task_output: None,
trusted_config_paths: {
"/home/runner/work/dotfiles/dotfiles",
},
quiet: false,
use_versions_host: true,
verbose: true,
vfox: false,
yes: true,
ci: true,
cd: None,
debug: true,
env_file: None,
trace: true,
log_level: "trace",
python_venv_auto_create: false,
}
minimum reproを作るしかなさそう…
MISE_LOG_LEVEL=trace RUST_BACKTRACE=full mise
The application panicked (crashed).
Message: The global thread pool has not been initialized.: ThreadPoolBuildError { kind: IOError(Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }) }
Location: /home/linuxbrew/.cache/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.1/src/registry.rs:168
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⋮ 8 frames hidden ⋮
9: rayon_core::registry::global_registry::h6ee19b48975e57aa
at <unknown source file>:<unknown line>
10: rayon_core::current_num_threads::h24982e7cbb41e6a3
at <unknown source file>:<unknown line>
11: <rayon::vec::IntoIter<T> as rayon::iter::IndexedParallelIterator>::with_producer::h71f6561a87994137
at <unknown source file>:<unknown line>
12: rayon::iter::from_par_iter::collect_extended::h3883dda4a9316b5d
at <unknown source file>:<unknown line>
13: mise::backend::load_tools::hac438e222b535dc5
at <unknown source file>:<unknown line>
14: mise::cli::Cli::run::hfecbc8ef4754c020
at <unknown source file>:<unknown line>
15: mise::main::h142bf94bf7873ce0
at <unknown source file>:<unknown line>
16: std::sys::backtrace::__rust_begin_short_backtrace::h2a5215425bd4f8c1
at <unknown source file>:<unknown line>
17: std::rt::lang_start::{{closure}}::h0d03ffdcf9accd58
at <unknown source file>:<unknown line>
18: std::rt::lang_start_internal::h8b59a41649a2a845
at <unknown source file>:<unknown line>
19: main<unknown>
at <unknown source file>:<unknown line>
20: __libc_start_main<unknown>
at <unknown source file>:<unknown line>
21: _start<unknown>
at <unknown source file>:<unknown line>
Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
The application panicked (crashed).
Message: The global thread pool has not been initialized.: ThreadPoolBuildError { kind: IOError(Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }) }
Location: /home/linuxbrew/.cache/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.1/src/registry.rs:168
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
ローカルで発生したのでトレースが見れた
ろぼいんさんの記事出てきてわろた
RAYON_NUM_THREADS: 1
を設定はしてみたがやっぱり直らなさそう
これが原因というより結果な気がする
推論でしかないが、miseがshimで呼ばれるとその中でnpmとかをバージョン取得のために呼んで、さらにmiseが呼ばれてと繰り返してしまい、スレッドが足りなくなっているのではないか
shim使うのやめれば解決しそうだけれども、scriptではそれしかないので、一旦nodeをshimに含まないようにしてみたい
成功した!!!
npm backendsを使いすぎてることが原因なのだろうか…
Issueを立てることとする
これを整理して書くのめんどいな
とりあえず何が原因か調べるところから始めたい
理解した。shimsで呼ばれるとmissingなツールについて読み込もうとして、そのときに npm view
を使うので無限ループになる
cat job-logs.txt | grep src/shims.rs
2024-09-24T09:48:55.4356478Z [TRACE] (1) mise::shims: [src/shims.rs:176] get_shim_diffs(210.716µs): sizes: (6,0)
2024-09-24T09:48:55.4600908Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[bun] args: bun install
2024-09-24T09:48:55.5063105Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view markdownlint-cli2 versions --json
2024-09-24T09:48:55.5226491Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view renovate versions --json
2024-09-24T09:48:55.9630370Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view cspell versions --json
2024-09-24T09:48:56.2559434Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view prettier versions --json
2024-09-24T09:48:57.9212805Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view markdownlint-cli2 versions --json
2024-09-24T09:48:58.0671035Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view renovate versions --json
2024-09-24T09:48:58.0779297Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view renovate versions --json
2024-09-24T09:48:58.1332298Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view cspell versions --json
2024-09-24T09:48:58.3564409Z [TRACE] (1) mise::shims: [src/shims.rs:31] shim[npm] args: npm view markdownlint-cli2 versions --json
こんな感じで、npm view
でshimsが呼ばれることを繰り返している
Issueあった…
ここで呼ばれているので、なぜこれがmissingなツールがあるときだけ呼ばれるか調べる
ちなみに既にnpm backendはexperimentalではない。1週間前だけれど
ここのどこかで無限ループが発生している。成功時のトレースを見た限り
こう呼ばれているので、どう直せばいいのかよくわからない…
何のshimが呼ばれたか調べる際に、ツールのリストを生成しており、ここでローカルにインストールされていないツールはリモートにバージョンを取りに行っている。バージョンが不明のまま返せればそれがいいのかもしれない?
shimで呼ばれているときだけそうすることは、これが下にあるので、先に設定すればなんとかはできそう
一応こういうPRで一部の警告は消されたみたい
workaroundとしては、すべてのツールをインストールしておく、nodeをmiseの管理下から外す、くらいしか思いつかない
結局特に途中で分岐とか無かったので…
mise.toml
からインストールしないのを消すのが一番手っ取り早そう
直った(直してくれた)