Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Crash on aqua:gitlab.com/gitlab-org/cli install #3310

Closed
scop opened this issue Nov 30, 2024 · 13 comments
Closed

Crash on aqua:gitlab.com/gitlab-org/cli install #3310

scop opened this issue Nov 30, 2024 · 13 comments
Labels

Comments

@scop
Copy link
Contributor

scop commented Nov 30, 2024

Describe the bug

mise crashes on installing aqua:gitlab.com/gitlab-org/cli.

To Reproduce

mise use -g aqua:gitlab.com/gitlab-org/cli

Expected behavior

No crash, glab installed.

mise doctor output

version: 2024.11.37 linux-x64 (7ac5ab3 2024-11-30)
activated: yes
shims_on_path: no

build_info:
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Sat, 30 Nov 2024 01:03:00 +0000
  Rust Version: rustc 1.82.0 (f6e511eec 2024-10-15)
  Profile: release

shell:
  /bin/bash
  GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
  Copyright (C) 2022 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

  This is free software; you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

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

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

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

plugins:
  dprint  https://github.com/asdf-community/asdf-dprint#79889ec
  usage   https://github.com/jdx/mise-usage.git#fe3888a

toolset:
  aqua:astral-sh/[email protected]
  aqua:cli/[email protected]
  aqua:crate-ci/[email protected]
  aqua:evilmartians/[email protected]
  aqua:goreleaser/[email protected]
  aqua:gotestyourself/[email protected]
  aqua:mvdan/[email protected]
  asdf:[email protected]
  asdf:[email protected]
  core:[email protected]
  ubi:aquaproj/[email protected]
  ubi:golangci/[email protected]
  ubi:goreleaser/[email protected]
  ubi:koalaman/[email protected]
  ubi:suzuki-shunsuke/[email protected]

env_vars:
  MISE_USE_TOML=true
  MISE_SHELL=bash

settings:

1 warning found:

1. plugin python overrides a core plugin

No problems found

Additional context

$ RUST_BACKTRACE=1 mise --debug use -g "aqua:gitlab.com/gitlab-org/cli"
DEBUG ARGS: mise --debug use -g aqua:gitlab.com/gitlab-org/cli
DEBUG config: ~/.config/mise/config.toml
DEBUG install_some_versions: aqua:gitlab.com/gitlab-org/cli@latest
INFO  aqua:gitlab.com/gitlab-org/cli@latest install
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Builder, source: RelativeUrlWithoutBase }
Location: src/http.rs:83

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮                               
   9: mise::http::Client::head::hf337410e89320aac
      at <unknown source file>:<unknown line>
  10: mise::backend::aqua::AquaBackend::fetch_url::hfe48d6c1d73dc83c
      at <unknown source file>:<unknown line>
  11: <mise::backend::aqua::AquaBackend as mise::backend::Backend>::install_version_::h2c271abff9df44aa
      at <unknown source file>:<unknown line>
  12: mise::backend::Backend::install_version::h9a6449a4599c50c9
      at <unknown source file>:<unknown line>
  13: std::sys::backtrace::__rust_begin_short_backtrace::h1a6635786c8f2a07
      at <unknown source file>:<unknown line>
  14: core::ops::function::FnOnce::call_once{{vtable.shim}}::hd4f76bfb90e81c2b
      at <unknown source file>:<unknown line>
  15: std::sys::pal::unix::thread::Thread::new::thread_start::hcdbd1049068002f4
      at <unknown source file>:<unknown line>
  16: start_thread<unknown>
      at ./nptl/pthread_create.c:447
  17: clone3<unknown>
      at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
@scop scop added the bug label Nov 30, 2024
@jdx
Copy link
Owner

jdx commented Nov 30, 2024

perhaps the docs need to be updated but I think you need to specify https:// it's possible github.com is an exception, we could add gitlab too if that's the case.

@scop
Copy link
Contributor Author

scop commented Dec 1, 2024

Hmm, not sure how to specify https there.

$ mise use -g aqua:https://gitlab.com/gitlab-org/cli
mise ERROR HTTP status client error (404 Not Found) for url (https://mise-versions.jdx.dev/aqua-registry/https://gitlab.com/gitlab-org/cli/registry.yaml)
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information

The aqua registry does have explicit gitlab.com/gitlab-org/cli path for this, I haven't checked if there are any others with the domain in it:

Anyway I thought the crash was the more interesting thing here rather than failure to install (be it due to using a wrong syntax or not).

@jdx
Copy link
Owner

jdx commented Dec 1, 2024

oh sorry, I forgot, everything in aqua is hardcoded to github. I hadn't seen anything in there that wasn't using github. In fact it seems this is something handled as a special case because the registry is specified as http: https://github.com/aquaproj/aqua-registry/blob/main/pkgs/gitlab.com/gitlab-org/cli/registry.yaml#L3-L5

I don't think we can support this one unless we also add in similar exceptions

@jdx
Copy link
Owner

jdx commented Dec 1, 2024

I think I'm inclined to wait on this one until aqua more formally defines gitlab, other I'd basically need to handle this one package uniquely in the repo in many ways

@scop
Copy link
Contributor Author

scop commented Dec 3, 2024

That's all fine with me, thanks for considering. Although perhaps the crash could be fixed meanwhile, even if installing the thing would not work.

I hadn't seen anything in there that wasn't using github.

Just thought I'd note that at least 1password is specified as http in aqua too, but it's not a GitHub thing, and installing it via mise works fine (albeit without automatic remote version info).

$ mise install aqua:1password/[email protected]
mise aqua:1password/[email protected] ✓ installed                                       

@jdx
Copy link
Owner

jdx commented Dec 3, 2024

http is not a problem, using gitlab is since this appears to be the only tool in aqua not using github

@scop
Copy link
Contributor Author

scop commented Dec 3, 2024

The mentioned 1password/cli in aqua is not using github. Neither is slack.com/slack-cli, and both of them install fine.

@jdx
Copy link
Owner

jdx commented Dec 3, 2024

we don't use either one, and it doesn't appear mise can get the versions for either one

@scop
Copy link
Contributor Author

scop commented Dec 3, 2024

I'm not sure what "we don't use" means. aqua:1password/cli exists in mise's registry. aqua:slack.com/slack.cli does not, but that in general does not mean one cannot use mise to install it (or just about any arbitrary aqua registry entry even if it's not in mise's registry). Or is that ability a coincidence?

Anyway, https://mise.jdx.dev/registry.html even explicitly says

You can also specify the full name for a tool using mise use aqua:1password/cli if you want to use a specific backend.

So, to highlight the difference and that it does not seem to be about GitHubness:

  • mise install aqua:1password/[email protected] works (you're right mise can't get versions for this so @latest does not work, but that's unrelated)
  • mise install aqua:slack.com/slack-cli works, although that can be a coincidence as there happens to be a latest version available

On the other hand:

  • mise install aqua:gitlab.com/gitlab-org/cli crashes, as mentioned
  • mise install aqua:gitlab.com/gitlab-org/[email protected] crashes as well

@jdx
Copy link
Owner

jdx commented Dec 3, 2024

Tools only "work" in the strictest sense in mise if we can't list the versions. So much of the functionality doesn't work if we can't list versions that I don't really consider something "working" if we can't list them. That's why 1password doesn't use aqua by default.

I take your point that something other than listing versions is making this tool not work, but unless we were able to list the versions I wouldn't consider putting it into the registry anyways.

@scop
Copy link
Contributor Author

scop commented Dec 3, 2024

I agree with version listing availability being a good "gatekeeper" for what gets included in mise's registry.

But I hope the general ability to just use something from aqua (or ubi for that matter) no matter if they're in mise's registry or not does not go away or become a coincidence. In some use cases, version listing is entirely moot, and tools are always installed or exec'd by explicit versions, and mise's ability to transparently download them if needed on the fly is very useful.

Anyway, we digress -- this bug report is not about version support or whether a tool is supported for one reason or the other, but that in my (not so humble :)) opinion, crashing on something like the reproducer here is not appropriate. Gracefully exiting with a non-zero exit code and a descriptive message would be fine.

@jdx
Copy link
Owner

jdx commented Dec 3, 2024

from a practical standpoint, this is the only tool in aqua that uses gitlab. It appears from the aqua registry given the TODO there are plans to more formally support gitlab. I think at that point, once aqua has a gitlab_release type or something it would be worth fixing this. I just don't think it's worth spending any of my time on this—including changing the error output—until then because it only affects one tool and I'll eventually need to revisit it when aqua gitlab support lands.

@jdx
Copy link
Owner

jdx commented Dec 3, 2024

I don't have an example but I believe there are http packages in aqua that do support listing versions without relying on github releases/tags somehow so the fix for 1password and slack is likely for that information to go in the aqua registry

Repository owner locked and limited conversation to collaborators Dec 14, 2024
@jdx jdx converted this issue into discussion #3547 Dec 14, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants