Skip to content
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

Failed to remove lock / rename file #705

Open
crashdump opened this issue Jan 24, 2025 · 6 comments
Open

Failed to remove lock / rename file #705

crashdump opened this issue Jan 24, 2025 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@crashdump
Copy link
Contributor

What version?

0.45.0

Which command?

proto install

What happened?

I'm seeing intermittent failures in Github Action (std runner) related to lock and file rename.

  × Failed to rename ~/.proto/temp/go-
  │ efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm
  │ to ~/.proto/plugins/go-
  │ efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm.
  ╰─▶ No such file or directory (os error 2)
  × Main thread panicked.
  ├─▶ at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/
  │   starbase_utils-0.10.0/src/fs_lock.rs:93:13
  ╰─▶ Failed to remove lock /home/runner/.proto/bin/.lock: Failed to remove
      path ~/.proto/bin/.lock.

Because I can randomly see one or the other (and sometimes no errors at all), I assume they are related, but that may not be the case!

.prototools:

atlas = "0.30.0"
buf = "1.49.0"
gh = "2.65.0"
go = "1.23.5"
mockery = "2.50.4"
moon = "1.31.2"
node = "22.13.0"
openfga = "1.8.4"
proto = "0.41.0"
rust = "1.84.0"
staticcheck = "2024.1.1"
terraform = "1.10.3"
tflint = "0.54.0"

[plugins]
atlas = "https://raw.githubusercontent.com/crashdump/proto-tools/main/toml-plugins/atlas/plugin.toml"
buf = "https://raw.githubusercontent.com/stk0vrfl0w/proto-toml-plugins/main/plugins/buf.toml"
gh = "https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/gh/plugin.toml"
mockery = "https://raw.githubusercontent.com/crashdump/proto-tools/main/toml-plugins/mockery/plugin.toml"
openfga = "https://raw.githubusercontent.com/crashdump/proto-tools/main/toml-plugins/openfga/plugin.toml"
staticcheck = "https://raw.githubusercontent.com/crashdump/proto-tools/main/toml-plugins/staticcheck/plugin.toml"
terraform = "https://raw.githubusercontent.com/theomessin/proto-toml-plugins/master/terraform.toml"
tflint = "https://raw.githubusercontent.com/crashdump/proto-tools/main/toml-plugins/tflint/plugin.toml"

[settings]
auto-install = true
detect-strategy = "only-prototools"

Trace logs?

[DEBUG 08:11:11.795] proto Running proto v0.44.4 bin="/home/runner/.proto/tools/proto/0.44.4/proto" args=["run", "go", "--", "generate", "-v", "./..."] shim="go" shim_bin="/home/runner/.proto/shims/go" pid=2873
[TRACE 08:11:11.795] starbase::app Running startup phase
[DEBUG 08:11:11.795] proto_core::proto Creating proto environment, detecting store store="/home/runner/.proto" home="/home/runner"
[TRACE 08:11:11.795] starbase::app Running analyze phase
[DEBUG 08:11:11.795] proto::systems Loading configuration in upwards-global mode working_dir="/home/runner/work/silo/silo/tests/envoy-conf-gen"
[DEBUG 08:11:11.795] proto_core::proto_config Loading .prototools file="/home/runner/work/silo/silo/.prototools"
[TRACE 08:11:11.795] starbase_utils::fs Reading file file="/home/runner/work/silo/silo/.prototools"
[TRACE 08:11:11.795] schematic::config::loader Loading partial configuration config="ProtoConfig"
[TRACE 08:11:11.795] schematic::config::loader Creating layer from source config="ProtoConfig" source=""
[TRACE 08:11:11.795] schematic::config::loader Merging partial layers into a final result config="ProtoConfig"
[DEBUG 08:11:11.795] proto_core::proto_config Loading .prototools file="/home/runner/.proto/.prototools"
[TRACE 08:11:11.795] starbase_utils::fs Opening file file="/home/runner/.proto/.prototools"
[TRACE 08:11:11.795] starbase_utils::fs_lock Locking file file="/home/runner/.proto/.prototools"
[TRACE 08:11:11.795] starbase_utils::fs_lock Unlocking file file="/home/runner/.proto/.prototools"
[TRACE 08:11:11.795] schematic::config::loader Loading partial configuration config="ProtoConfig"
[TRACE 08:11:11.795] schematic::config::loader Creating layer from source config="ProtoConfig" source=""
[TRACE 08:11:11.795] schematic::config::loader Merging partial layers into a final result config="ProtoConfig"
[DEBUG 08:11:11.795] proto_core::proto_config Merging loaded configs with global
[DEBUG 08:11:11.795] proto_core::proto_config Merged 2 configs
[DEBUG 08:11:11.795] proto_core::proto_config Merging loaded configs without global
[DEBUG 08:11:11.795] proto_core::proto_config Merged 1 configs
[TRACE 08:11:11.796] warpgate::loader Creating plugin loader cache_dir="/home/runner/.proto/plugins"
[TRACE 08:11:11.796] warpgate::loader Loading plugin proto id="proto" locator="https://github.com/moonrepo/plugins/releases/download/proto_tool-v0.3.0/proto_tool.wasm"
[TRACE 08:11:11.796] starbase_utils::fs Reading file metadata file="/home/runner/.proto/plugins/proto-18e2857793eba43372aabe39c3f0e5f7f83cc9b2df0d86f5f4700b4fb57bd311.wasm"
[TRACE 08:11:11.796] warpgate::loader Plugin already downloaded and cached id="proto" path="/home/runner/.proto/plugins/proto-18e2857793eba43372aabe39c3f0e5f7f83cc9b2df0d86f5f4700b4fb57bd311.wasm"
[DEBUG 08:11:11.796] proto_core::tool_loader Loading WASM plugin source="/home/runner/.proto/plugins/proto-18e2857793eba43372aabe39c3f0e5f7f83cc9b2df0d86f5f4700b4fb57bd311.wasm"
[TRACE 08:11:11.799] warpgate::plugin Storing plugin identifier id="proto"
[TRACE 08:11:11.799] warpgate::plugin Storing host environment id="proto" env={"arch":"x64","libc":"gnu","os":"linux","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"/home/runner"}}
[DEBUG 08:11:11.799] proto_core::tool Creating tool proto and instantiating plugin
[DEBUG 08:11:11.799] warpgate::client Creating HTTP client
[TRACE 08:11:11.803] warpgate::client Applying middleware to client
[TRACE 08:11:11.803] warpgate::client Adding GET and HEAD request caching
[DEBUG 08:11:11.803] warpgate::client Created HTTP client
[TRACE 08:11:11.803] warpgate::plugin Creating plugin container id="proto"
[TRACE 08:11:11.813] warpgate::plugin Created plugin container id="proto" plugin="1fba68ba-34c2-4cca-bc9e-a62571dd9af3"
[DEBUG 08:11:11.817] proto_core::tool Created tool proto and its WASM runtime
[TRACE 08:11:11.823] warpgate::plugin Calling guest function register_tool id="proto" plugin="1fba68ba-34c2-4cca-bc9e-a62571dd9af3" input={"id":"proto"}
[TRACE 08:11:11.823] warpgate::plugin Called guest function register_tool id="proto" plugin="1fba68ba-34c2-4cca-bc9e-a62571dd9af3" output={"inventory":{},"minimum_proto_version":"0.42.0","name":"proto","plugin_version":"0.3.0","self_upgrade_commands":["up","upgrade"],"type":"CommandLine"}
[DEBUG 08:11:11.823] proto_core::tool_manifest Loading manifest.json file="/home/runner/.proto/tools/proto/manifest.json"
[TRACE 08:11:11.823] starbase_utils::fs Opening file file="/home/runner/.proto/tools/proto/manifest.json"
[TRACE 08:11:11.823] starbase_utils::fs_lock Locking file file="/home/runner/.proto/tools/proto/manifest.json"
[TRACE 08:11:11.823] starbase_utils::fs_lock Unlocking file file="/home/runner/.proto/tools/proto/manifest.json"
[DEBUG 08:11:11.824] proto::systems Downloading a versioned proto because it was configured in .prototools version="0.41.0"
[DEBUG 08:11:11.824] proto_core::flow::resolve Resolving a semantic version or alias tool="proto" initial_version="0.41.0"
[DEBUG 08:11:11.824] proto_core::flow::resolve Loading available versions tool="proto"
[TRACE 08:11:11.824] starbase_utils::fs Reading file metadata file="/home/runner/.proto/tools/proto/remote-versions.json"
[TRACE 08:11:11.824] starbase_utils::fs Reading file file="/home/runner/.proto/tools/proto/remote-versions.json"
[TRACE 08:11:11.824] starbase_utils::json Reading JSON file file="/home/runner/.proto/tools/proto/remote-versions.json"
[TRACE 08:11:11.824] proto_core::version_resolver Resolving a version with manifest candidate="0.41.0"
[TRACE 08:11:11.824] proto_core::version_resolver Found an explicit version, resolving further version="0.41.0"
[TRACE 08:11:11.824] proto_core::version_resolver Resolved to locally installed version version="0.41.0"
[DEBUG 08:11:11.824] proto_core::flow::resolve Resolved to 0.41.0 tool="proto" version="0.41.0"
[DEBUG 08:11:11.824] proto_core::flow::install Tool already installed, continuing tool="proto"
[TRACE 08:11:11.824] starbase::app Running execute phase
[DEBUG 08:11:11.824] proto_core::tool_loader Finding a configured plugin tool="go"
[DEBUG 08:11:11.824] proto_core::tool_loader Using a built-in plugin plugin="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm"
[TRACE 08:11:11.824] warpgate::loader Loading plugin go id="go" locator="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm"
[TRACE 08:11:11.824] warpgate::loader Plugin not cached, downloading id="go"
[TRACE 08:11:11.824] starbase_utils::net Checking for an internet connection timeout=750
[TRACE 08:11:11.846] starbase_utils::net::offline Resolving 1.1.1.1:53
[TRACE 08:11:11.854] starbase_utils::net Online!
[TRACE 08:11:11.854] warpgate::loader Downloading plugin from URL id="go" from="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm" to="/home/runner/.proto/plugins/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:11.854] starbase_utils::net Downloading file from remote URL to local file source_url="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm" dest_file="/home/runner/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:12.639] starbase_utils::fs Creating file file="/home/runner/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:12.642] starbase_utils::fs Renaming file from="/home/runner/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm" to="/home/runner/.proto/plugins/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:12.643] starbase::app Running shutdown phase (because another phase failed)
[TRACE 08:11:12.643] starbase::app Error: Failed to rename ~/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm to ~/.proto/plugins/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm.
[TRACE 08:11:12.643] starbase::app Setting exit code code=1
Error: fs::rename

× Failed to rename ~/.proto/temp/go-
│ efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm
│ to ~/.proto/plugins/go-
│ efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm.
╰─▶ No such file or directory (os error 2)
help: Does the source file exist?
[TRACE 2025-01-24 08:11:11.778] starbase_console::console Creating buffered console
[DEBUG 08:11:11.778] proto Running proto v0.44.4 bin="/home/runner/.proto/tools/proto/0.44.4/proto" args=["run", "go", "--", "generate", "-v", "./..."] shim="go" shim_bin="/home/runner/.proto/shims/go" pid=2842
[TRACE 08:11:11.779] starbase::app Running startup phase
[DEBUG 08:11:11.779] proto_core::proto Creating proto environment, detecting store store="/home/runner/.proto" home="/home/runner"
[TRACE 08:11:11.779] starbase::app Running analyze phase
[DEBUG 08:11:11.779] proto::systems Loading configuration in upwards-global mode working_dir="/home/runner/work/silo/silo/tests/sideloader"
[DEBUG 08:11:11.779] proto_core::proto_config Loading .prototools file="/home/runner/work/silo/silo/.prototools"
[TRACE 08:11:11.779] starbase_utils::fs Reading file file="/home/runner/work/silo/silo/.prototools"
[TRACE 08:11:11.779] schematic::config::loader Loading partial configuration config="ProtoConfig"
[TRACE 08:11:11.779] schematic::config::loader Creating layer from source config="ProtoConfig" source=""
[TRACE 08:11:11.779] schematic::config::loader Merging partial layers into a final result config="ProtoConfig"
[DEBUG 08:11:11.779] proto_core::proto_config Loading .prototools file="/home/runner/.proto/.prototools"
[TRACE 08:11:11.779] starbase_utils::fs Opening file file="/home/runner/.proto/.prototools"
[TRACE 08:11:11.779] starbase_utils::fs_lock Locking file file="/home/runner/.proto/.prototools"
[TRACE 08:11:11.779] starbase_utils::fs_lock Unlocking file file="/home/runner/.proto/.prototools"
[TRACE 08:11:11.779] schematic::config::loader Loading partial configuration config="ProtoConfig"
[TRACE 08:11:11.779] schematic::config::loader Creating layer from source config="ProtoConfig" source=""
[TRACE 08:11:11.779] schematic::config::loader Merging partial layers into a final result config="ProtoConfig"
[DEBUG 08:11:11.779] proto_core::proto_config Merging loaded configs with global
[DEBUG 08:11:11.779] proto_core::proto_config Merged 2 configs
[DEBUG 08:11:11.779] proto_core::proto_config Merging loaded configs without global
[DEBUG 08:11:11.779] proto_core::proto_config Merged 1 configs
[TRACE 08:11:11.779] warpgate::loader Creating plugin loader cache_dir="/home/runner/.proto/plugins"
[TRACE 08:11:11.779] warpgate::loader Loading plugin proto id="proto" locator="https://github.com/moonrepo/plugins/releases/download/proto_tool-v0.3.0/proto_tool.wasm"
[TRACE 08:11:11.779] starbase_utils::fs Reading file metadata file="/home/runner/.proto/plugins/proto-18e2857793eba43372aabe39c3f0e5f7f83cc9b2df0d86f5f4700b4fb57bd311.wasm"
[TRACE 08:11:11.779] warpgate::loader Plugin already downloaded and cached id="proto" path="/home/runner/.proto/plugins/proto-18e2857793eba43372aabe39c3f0e5f7f83cc9b2df0d86f5f4700b4fb57bd311.wasm"
[DEBUG 08:11:11.779] proto_core::tool_loader Loading WASM plugin source="/home/runner/.proto/plugins/proto-18e2857793eba43372aabe39c3f0e5f7f83cc9b2df0d86f5f4700b4fb57bd311.wasm"
[TRACE 08:11:11.793] warpgate::plugin Storing plugin identifier id="proto"
[TRACE 08:11:11.793] warpgate::plugin Storing host environment id="proto" env={"arch":"x64","libc":"gnu","os":"linux","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"/home/runner"}}
[DEBUG 08:11:11.793] proto_core::tool Creating tool proto and instantiating plugin
[DEBUG 08:11:11.793] warpgate::client Creating HTTP client
[TRACE 08:11:11.798] warpgate::client Applying middleware to client
[TRACE 08:11:11.798] warpgate::client Adding GET and HEAD request caching
[DEBUG 08:11:11.798] warpgate::client Created HTTP client
[TRACE 08:11:11.798] warpgate::plugin Creating plugin container id="proto"
[TRACE 08:11:11.815] warpgate::plugin Created plugin container id="proto" plugin="8ef5e926-14f2-4d4d-9a55-ba9bb86542f4"
[DEBUG 08:11:11.815] proto_core::tool Created tool proto and its WASM runtime
[TRACE 08:11:11.815] warpgate::plugin Calling guest function register_tool id="proto" plugin="8ef5e926-14f2-4d4d-9a55-ba9bb86542f4" input={"id":"proto"}
[TRACE 08:11:11.815] warpgate::plugin Called guest function register_tool id="proto" plugin="8ef5e926-14f2-4d4d-9a55-ba9bb86542f4" output={"inventory":{},"minimum_proto_version":"0.42.0","name":"proto","plugin_version":"0.3.0","self_upgrade_commands":["up","upgrade"],"type":"CommandLine"}
[DEBUG 08:11:11.815] proto_core::tool_manifest Loading manifest.json file="/home/runner/.proto/tools/proto/manifest.json"
[TRACE 08:11:11.815] starbase_utils::fs Opening file file="/home/runner/.proto/tools/proto/manifest.json"
[TRACE 08:11:11.815] starbase_utils::fs_lock Locking file file="/home/runner/.proto/tools/proto/manifest.json"
[TRACE 08:11:11.815] starbase_utils::fs_lock Unlocking file file="/home/runner/.proto/tools/proto/manifest.json"
[DEBUG 08:11:11.816] proto::systems Downloading a versioned proto because it was configured in .prototools version="0.41.0"
[DEBUG 08:11:11.816] proto_core::flow::resolve Resolving a semantic version or alias tool="proto" initial_version="0.41.0"
[DEBUG 08:11:11.816] proto_core::flow::resolve Loading available versions tool="proto"
[TRACE 08:11:11.816] starbase_utils::fs Reading file metadata file="/home/runner/.proto/tools/proto/remote-versions.json"
[TRACE 08:11:11.816] starbase_utils::fs Reading file file="/home/runner/.proto/tools/proto/remote-versions.json"
[TRACE 08:11:11.816] starbase_utils::json Reading JSON file file="/home/runner/.proto/tools/proto/remote-versions.json"
[TRACE 08:11:11.816] proto_core::version_resolver Resolving a version with manifest candidate="0.41.0"
[TRACE 08:11:11.816] proto_core::version_resolver Found an explicit version, resolving further version="0.41.0"
[TRACE 08:11:11.816] proto_core::version_resolver Resolved to locally installed version version="0.41.0"
[DEBUG 08:11:11.816] proto_core::flow::resolve Resolved to 0.41.0 tool="proto" version="0.41.0"
[DEBUG 08:11:11.816] proto_core::flow::install Tool already installed, continuing tool="proto"
[TRACE 08:11:11.816] starbase::app Running execute phase
[DEBUG 08:11:11.816] proto_core::tool_loader Finding a configured plugin tool="go"
[DEBUG 08:11:11.816] proto_core::tool_loader Using a built-in plugin plugin="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm"
[TRACE 08:11:11.816] warpgate::loader Loading plugin go id="go" locator="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm"
[TRACE 08:11:11.816] warpgate::loader Plugin not cached, downloading id="go"
[TRACE 08:11:11.816] starbase_utils::net Checking for an internet connection timeout=750
[TRACE 08:11:11.825] starbase_utils::net::offline Resolving 1.1.1.1:53
[TRACE 08:11:11.827] starbase_utils::net Online!
[TRACE 08:11:11.827] warpgate::loader Downloading plugin from URL id="go" from="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm" to="/home/runner/.proto/plugins/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:11.827] starbase_utils::net Downloading file from remote URL to local file source_url="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm" dest_file="/home/runner/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:12.639] starbase_utils::fs Creating file file="/home/runner/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:12.643] starbase_utils::fs Renaming file from="/home/runner/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm" to="/home/runner/.proto/plugins/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:12.643] starbase::app Running shutdown phase (because another phase failed)
[TRACE 08:11:12.643] starbase::app Error: Failed to rename ~/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm to ~/.proto/plugins/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm.
[TRACE 08:11:12.643] starbase::app Setting exit code code=1
Error: fs::rename

× Failed to rename ~/.proto/temp/go-
│ efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm
│ to ~/.proto/plugins/go-
│ efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm.
╰─▶ No such file or directory (os error 2)
help: Does the source file exist?
[TRACE 2025-01-24 08:11:12.081] starbase_console::console Creating buffered console
[DEBUG 08:11:12.081] proto Running proto v0.44.4 bin="/home/runner/.proto/tools/proto/0.44.4/proto" args=["run", "go", "--", "generate", "-v", "./..."] shim="go" shim_bin="/home/runner/.proto/shims/go" pid=2936
[TRACE 08:11:12.081] starbase::app Running startup phase
[DEBUG 08:11:12.081] proto_core::proto Creating proto environment, detecting store store="/home/runner/.proto" home="/home/runner"
[TRACE 08:11:12.081] starbase::app Running analyze phase
[DEBUG 08:11:12.081] proto::systems Loading configuration in upwards-global mode working_dir="/home/runner/work/silo/silo/services/secret-service"
[DEBUG 08:11:12.081] proto_core::proto_config Loading .prototools file="/home/runner/work/silo/silo/.prototools"
[TRACE 08:11:12.081] starbase_utils::fs Reading file file="/home/runner/work/silo/silo/.prototools"
[TRACE 08:11:12.081] schematic::config::loader Loading partial configuration config="ProtoConfig"
[TRACE 08:11:12.081] schematic::config::loader Creating layer from source config="ProtoConfig" source=""
[TRACE 08:11:12.081] schematic::config::loader Merging partial layers into a final result config="ProtoConfig"
[DEBUG 08:11:12.082] proto_core::proto_config Loading .prototools file="/home/runner/.proto/.prototools"
[TRACE 08:11:12.082] starbase_utils::fs Opening file file="/home/runner/.proto/.prototools"
[TRACE 08:11:12.082] starbase_utils::fs_lock Locking file file="/home/runner/.proto/.prototools"
[TRACE 08:11:12.082] starbase_utils::fs_lock Unlocking file file="/home/runner/.proto/.prototools"
[TRACE 08:11:12.082] schematic::config::loader Loading partial configuration config="ProtoConfig"
[TRACE 08:11:12.082] schematic::config::loader Creating layer from source config="ProtoConfig" source=""
[TRACE 08:11:12.082] schematic::config::loader Merging partial layers into a final result config="ProtoConfig"
[DEBUG 08:11:12.082] proto_core::proto_config Merging loaded configs with global
[DEBUG 08:11:12.082] proto_core::proto_config Merged 2 configs
[DEBUG 08:11:12.082] proto_core::proto_config Merging loaded configs without global
[DEBUG 08:11:12.082] proto_core::proto_config Merged 1 configs
[TRACE 08:11:12.082] warpgate::loader Creating plugin loader cache_dir="/home/runner/.proto/plugins"
[TRACE 08:11:12.082] warpgate::loader Loading plugin proto id="proto" locator="https://github.com/moonrepo/plugins/releases/download/proto_tool-v0.3.0/proto_tool.wasm"
[TRACE 08:11:12.082] starbase_utils::fs Reading file metadata file="/home/runner/.proto/plugins/proto-18e2857793eba43372aabe39c3f0e5f7f83cc9b2df0d86f5f4700b4fb57bd311.wasm"
[TRACE 08:11:12.082] warpgate::loader Plugin already downloaded and cached id="proto" path="/home/runner/.proto/plugins/proto-18e2857793eba43372aabe39c3f0e5f7f83cc9b2df0d86f5f4700b4fb57bd311.wasm"
[DEBUG 08:11:12.082] proto_core::tool_loader Loading WASM plugin source="/home/runner/.proto/plugins/proto-18e2857793eba43372aabe39c3f0e5f7f83cc9b2df0d86f5f4700b4fb57bd311.wasm"
[TRACE 08:11:12.091] warpgate::plugin Storing plugin identifier id="proto"
[TRACE 08:11:12.091] warpgate::plugin Storing host environment id="proto" env={"arch":"x64","libc":"gnu","os":"linux","home_dir":{"path":"/userhome/","virtual_prefix":"/userhome","real_prefix":"/home/runner"}}
[DEBUG 08:11:12.092] proto_core::tool Creating tool proto and instantiating plugin
[DEBUG 08:11:12.092] warpgate::client Creating HTTP client
[TRACE 08:11:12.096] warpgate::client Applying middleware to client
[TRACE 08:11:12.096] warpgate::client Adding GET and HEAD request caching
[DEBUG 08:11:12.096] warpgate::client Created HTTP client
[TRACE 08:11:12.096] warpgate::plugin Creating plugin container id="proto"
[TRACE 08:11:12.106] warpgate::plugin Created plugin container id="proto" plugin="d4068bc3-fc9c-420b-a6e5-e0e159e79bf0"
[DEBUG 08:11:12.106] proto_core::tool Created tool proto and its WASM runtime
[TRACE 08:11:12.106] warpgate::plugin Calling guest function register_tool id="proto" plugin="d4068bc3-fc9c-420b-a6e5-e0e159e79bf0" input={"id":"proto"}
[TRACE 08:11:12.106] warpgate::plugin Called guest function register_tool id="proto" plugin="d4068bc3-fc9c-420b-a6e5-e0e159e79bf0" output={"inventory":{},"minimum_proto_version":"0.42.0","name":"proto","plugin_version":"0.3.0","self_upgrade_commands":["up","upgrade"],"type":"CommandLine"}
[DEBUG 08:11:12.106] proto_core::tool_manifest Loading manifest.json file="/home/runner/.proto/tools/proto/manifest.json"
[TRACE 08:11:12.106] starbase_utils::fs Opening file file="/home/runner/.proto/tools/proto/manifest.json"
[TRACE 08:11:12.106] starbase_utils::fs_lock Locking file file="/home/runner/.proto/tools/proto/manifest.json"
[TRACE 08:11:12.106] starbase_utils::fs_lock Unlocking file file="/home/runner/.proto/tools/proto/manifest.json"
[DEBUG 08:11:12.106] proto::systems Downloading a versioned proto because it was configured in .prototools version="0.41.0"
[DEBUG 08:11:12.106] proto_core::flow::resolve Resolving a semantic version or alias tool="proto" initial_version="0.41.0"
[DEBUG 08:11:12.106] proto_core::flow::resolve Loading available versions tool="proto"
[TRACE 08:11:12.106] starbase_utils::fs Reading file metadata file="/home/runner/.proto/tools/proto/remote-versions.json"
[TRACE 08:11:12.106] starbase_utils::fs Reading file file="/home/runner/.proto/tools/proto/remote-versions.json"
[TRACE 08:11:12.106] starbase_utils::json Reading JSON file file="/home/runner/.proto/tools/proto/remote-versions.json"
[TRACE 08:11:12.106] proto_core::version_resolver Resolving a version with manifest candidate="0.41.0"
[TRACE 08:11:12.106] proto_core::version_resolver Found an explicit version, resolving further version="0.41.0"
[TRACE 08:11:12.106] proto_core::version_resolver Resolved to locally installed version version="0.41.0"
[DEBUG 08:11:12.106] proto_core::flow::resolve Resolved to 0.41.0 tool="proto" version="0.41.0"
[DEBUG 08:11:12.106] proto_core::flow::install Tool already installed, continuing tool="proto"
[TRACE 08:11:12.107] starbase::app Running execute phase
[DEBUG 08:11:12.107] proto_core::tool_loader Finding a configured plugin tool="go"
[DEBUG 08:11:12.107] proto_core::tool_loader Using a built-in plugin plugin="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm"
[TRACE 08:11:12.107] warpgate::loader Loading plugin go id="go" locator="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm"
[TRACE 08:11:12.107] warpgate::loader Plugin not cached, downloading id="go"
[TRACE 08:11:12.107] starbase_utils::net Checking for an internet connection timeout=750
[TRACE 08:11:12.107] starbase_utils::net::offline Resolving 1.1.1.1:53
[TRACE 08:11:12.109] starbase_utils::net Online!
[TRACE 08:11:12.109] warpgate::loader Downloading plugin from URL id="go" from="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm" to="/home/runner/.proto/plugins/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:12.109] starbase_utils::net Downloading file from remote URL to local file source_url="https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm" dest_file="/home/runner/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:12.643] starbase_utils::fs Creating file file="/home/runner/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:12.645] starbase_utils::fs Renaming file from="/home/runner/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm" to="/home/runner/.proto/plugins/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm"
[TRACE 08:11:12.645] starbase::app Running shutdown phase (because another phase failed)
[TRACE 08:11:12.645] starbase::app Error: Failed to rename ~/.proto/temp/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm to ~/.proto/plugins/go-efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm.
[TRACE 08:11:12.645] starbase::app Setting exit code code=1
Error: fs::rename

× Failed to rename ~/.proto/temp/go-
│ efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm
│ to ~/.proto/plugins/go-
│ efe4f3369e23919ee457fd0ff1c869b70b2819bcc078d8ffb70f470ea5f52cb6.wasm.
╰─▶ No such file or directory (os error 2)
help: Does the source file exist?


[DEBUG 09:05:50.483] proto_core::flow::link Creating binary symlink tool="staticcheck" source="/home/runner/.proto/tools/staticcheck/2024.1.1/staticcheck/staticcheck" target="/home/runner/.proto/bin/staticcheck-2024"
[TRACE 09:05:50.483] starbase_utils::fs_lock Locking directory dir="/home/runner/.proto/shims"
[DEBUG 09:05:50.483] proto_core::flow::link Creating binary symlink tool="openfga" source="/home/runner/.proto/tools/openfga/1.8.4/openfga" target="/home/runner/.proto/bin/openfga-1.8"
[TRACE 09:05:50.483] starbase_utils::fs Creating file without truncating file="/home/runner/.proto/shims/.lock"
[DEBUG 09:05:50.483] proto_core::flow::link Creating binary symlink tool="staticcheck" source="/home/runner/.proto/tools/staticcheck/2024.1.1/staticcheck/staticcheck" target="/home/runner/.proto/bin/staticcheck-2024.1"
[TRACE 09:05:50.483] starbase_utils::fs_lock Unlocking path path="/home/runner/.proto/bin/.lock"
[TRACE 09:05:50.483] starbase_utils::fs_lock Waiting to acquire lock lock="/home/runner/.proto/shims/.lock"
[TRACE 09:05:50.483] starbase_utils::fs Removing file file="/home/runner/.proto/bin/.lock"
[TRACE 09:05:50.483] starbase_utils::fs_lock Unlocking path path="/home/runner/.proto/bin/.lock"
[TRACE 09:05:50.483] starbase_utils::fs_lock Acquired lock, writing PID lock="/home/runner/.proto/shims/.lock" pid=1944
[TRACE 09:05:50.483] starbase_utils::fs Removing file file="/home/runner/.proto/bin/.lock"
Error:
× Main thread panicked.
├─▶ at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/
│ starbase_utils-0.10.0/src/fs_lock.rs:93:13
╰─▶ Failed to remove lock /home/runner/.proto/bin/.lock: Failed to remove
path ~/.proto/bin/.lock.
help: set the RUST_BACKTRACE=1 environment variable to display a
backtrace.

[TRACE 09:05:50.484] starbase_utils::fs_lock Locking directory dir="/home/runner/.proto/shims"
�[?2026l::error::Error: Command was killed with SIGABRT (Aborted): proto use

Operating system?

Linux

Architecture?

x64

@crashdump crashdump added the bug Something isn't working label Jan 24, 2025
@crashdump
Copy link
Contributor Author

Just seen a new variant with shim.lock:

[DEBUG 11:12:29.545] proto_core::flow::link  Creating binary symlink  tool="tflint" source="/home/runner/.proto/tools/tflint/0.54.0/tflint" target="/home/runner/.proto/bin/tflint"
[DEBUG 11:12:29.545] proto_core::flow::link  Creating binary symlink  tool="tflint" source="/home/runner/.proto/tools/tflint/0.54.0/tflint" target="/home/runner/.proto/bin/tflint-0"
[DEBUG 11:12:29.545] proto_core::flow::link  Creating binary symlink  tool="tflint" source="/home/runner/.proto/tools/tflint/0.54.0/tflint" target="/home/runner/.proto/bin/tflint-0.54"
[TRACE 11:12:29.545] starbase_utils::fs_lock  Unlocking path  path="/home/runner/.proto/bin/.lock"
[TRACE 11:12:29.545] starbase_utils::fs  Removing file  file="/home/runner/.proto/bin/.lock"
[DEBUG 11:12:29.545] proto_core::flow::locate  Locating primary executable for tool  tool="tflint"
[DEBUG 11:12:29.545] proto_core::flow::locate  Found an executable  tool="tflint" exe_path="/home/runner/.proto/tools/tflint/0.54.0/tflint"
[TRACE 11:12:29.543] starbase_utils::fs  Removing file  file="/home/runner/.proto/shims/.lock"
Error: 
  × Main thread panicked.
  ├─▶ at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/
  │   starbase_utils-0.10.0/src/fs_lock.rs:93:13
  ╰─▶ Failed to remove lock /home/runner/.proto/shims/.lock: Failed to remove
      path ~/.proto/shims/.lock.
  help: set the `RUST_BACKTRACE=1` environment variable to display a
        backtrace.

@crashdump
Copy link
Contributor Author

Changing the Github action auto-install settings to false and installing all the app separately with a delay seems to solve it, therefore I suspect some sort of race condition due to the number of plugins in use. See below.

      - name: Install MoonRepo
        uses: "moonrepo/setup-toolchain@v0"
        with:
          proto-version: 0.45.0
          auto-install: false
          cache: true

      - name: Proto race-condition workaround
        run: |
          proto install atlas
          sleep 0.5
          proto install buf
          sleep 0.5
          proto install gh
          sleep 0.5
          proto install go
          sleep 0.5
          proto install mockery
          sleep 0.5
          proto install moon
          sleep 0.5
          proto install node
          sleep 0.5
          proto install openfga
          sleep 0.5
          proto install rust
          sleep 0.5
          proto install staticcheck
          sleep 0.5
          proto install terraform
          sleep 0.5
          proto install tflint

@milesj
Copy link
Contributor

milesj commented Jan 24, 2025

@crashdump

Your logs show proto 0.44.4 and not proto 0.45, so I don't think this is something that changed in 0.45. It's very confusing though, since locks are supposed to help with race conditions by forcing everything to wait in line.

Can you set PROTO_LOG=trace and the paste the full output of what's going on when the auto-install is running in the setup-toolchain?

@milesj
Copy link
Contributor

milesj commented Jan 24, 2025

Trying some stuff here #707

@milesj
Copy link
Contributor

milesj commented Jan 24, 2025

Give 0.45.1 a try

@crashdump
Copy link
Contributor Author

Thanks @milesj, 0.45.1 seems to have done the job. Let me know if you'd still want to understand how the situation happen, I'd be happy to produce the full logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants