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 read command when attempting ion summon #48

Open
Krastanov opened this issue Apr 9, 2023 · 9 comments
Open

Failed to read command when attempting ion summon #48

Krastanov opened this issue Apr 9, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@Krastanov
Copy link

I installed ion in a local path, successfully authenticated it to github, successfully used bump but then summon is erroring with error code 101:

stefan@cube ~/D/S/q/QuantumClifford.jl (master) > ion summon
Failed to read command
stefan@cube ~/D/S/q/QuantumClifford.jl (master) [101]> ion -V
ion 0.1.21

Not really sure what to do to debug now

@Roger-luo
Copy link
Owner

Roger-luo commented Apr 9, 2023

what does it say if you run

RUST_LOG=debug ion summon

also what OS are you on? is this a linux distro?

@Roger-luo Roger-luo added the bug Something isn't working label Apr 9, 2023
@Krastanov
Copy link
Author

[2023-04-09T21:42:38Z DEBUG ion::config] config file: /home/stefan/.config/ion/config.toml
[2023-04-09T21:42:38Z DEBUG ion::config] config file: true
[2023-04-09T21:42:38Z DEBUG ion::commands::summon] summoning JuliaRegistrator to register /home/stefan/Documents/ScratchSpace/quantumjulia/QuantumClifford.jl/Project.toml
[2023-04-09T21:42:38Z DEBUG ion::utils::git] get_toplevel_path("/home/stefan/Documents/ScratchSpace/quantumjulia/QuantumClifford.jl")
[2023-04-09T21:42:38Z DEBUG ion::utils::read_command] Running command: Command {
        program: "git",
        args: [
            "git",
            "rev-parse",
            "--show-toplevel",
        ],
        cwd: Some(
            "/home/stefan/Documents/ScratchSpace/quantumjulia/QuantumClifford.jl",
        ),
        create_pidfd: false,
    }
[2023-04-09T21:42:39Z DEBUG ion::utils::git] current_branch("/home/stefan/Documents/ScratchSpace/quantumjulia/QuantumClifford.jl")
[2023-04-09T21:42:39Z DEBUG ion::utils::read_command] Running command: Command {
        program: "git",
        args: [
            "git",
            "rev-parse",
            "--abbrev-ref",
            "HEAD",
        ],
        cwd: Some(
            "/home/stefan/Documents/ScratchSpace/quantumjulia/QuantumClifford.jl",
        ),
        create_pidfd: false,
    }
[2023-04-09T21:42:39Z DEBUG ion::utils::read_command] Running command: Command {
        program: "git",
        args: [
            "git",
            "symbolic-ref",
            "refs/remotes/origin/HEAD",
        ],
        cwd: Some(
            "/home/stefan/Documents/ScratchSpace/quantumjulia/QuantumClifford.jl",
        ),
        create_pidfd: false,
    }
Failed to read command

@Roger-luo
Copy link
Owner

It seems the following command doesn't work

git symbolic-ref refs/remotes/origin/HEAD

this command is for getting the current default branch, could you try it locally and see if this fails?

@Krastanov
Copy link
Author

This is on Ubuntu 22.04. It is on git 2.37.2

The command indeed fails:

> git symbolic-ref refs/remotes/origin/HEAD
fatal: ref refs/remotes/origin/HEAD is not a symbolic ref

But this issue seems very similar and seems to suggest a workaround jhauberg/gitdoctor#3

> git remote show origin
Host key fingerprint is ...
...
+----[SHA256]-----+
* remote origin
  Fetch URL: [email protected]:Krastanov/QuantumClifford.jl.git
  Push  URL: [email protected]:Krastanov/QuantumClifford.jl.git
  HEAD branch: master
... many more lines of output

@Krastanov
Copy link
Author

Or maybe there is some standard way to create refs/remotes/origin/HEAD?

@Krastanov
Copy link
Author

Another place where a similar issue has popped up dhimmel/manubot-rootstock@667d170

@Roger-luo
Copy link
Owner

So I wrote that because of this StackOverflow post: https://stackoverflow.com/questions/28666357/how-to-get-default-git-branch

Maybe there is a more robust way of detecting the default repo branch in the remote repo, the other way might be using the GitHub API to get the default repo branch, I'm not sure if how it works yet.

@Krastanov
Copy link
Author

If I first run git remote set-head origin --auto then git symbolic-ref refs/remotes/origin/HEAD works fine. Could that be enough of a solution?

@Roger-luo
Copy link
Owner

Hmm, I think I need to understand when refs/remotes/origin/HEAD will appear first and why it might not be there first. But yeah, please use this as a workaround for now until we figure out something more robust.

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

No branches or pull requests

2 participants