Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

thread 'main' panicked at 'failed to parse remote name: RefFormat(Space)' #233

Open
adaszko opened this issue Aug 25, 2022 · 8 comments
Open

Comments

@adaszko
Copy link
Contributor

adaszko commented Aug 25, 2022

I'm getting an error when trying to clone a project from willow.radicle.garden:

$ rad clone --no-confirm rad://willow.radicle.garden/hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio
Git version 2.37.2

Syncing 🌱 project rad:git:hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio from https://willow.radicle.garden/

ok Fetching project identity...
From https://willow.radicle.garden/hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio
 = [up to date]            refs/rad/id -> refs/namespaces/hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio/refs/rad/id

ok Fetching project delegate hnrkrrwkajfh65ep7jozcr48fymqxy61f498o...
From https://willow.radicle.garden/hnrkrrwkajfh65ep7jozcr48fymqxy61f498o
 = [up to date]            refs/rad/id -> refs/namespaces/hnrkrrwkajfh65ep7jozcr48fymqxy61f498o/refs/rad/id

ok Fetching project delegate hnrkrrwkajfh65ep7jozcr48fymqxy61f498o...
ok Verifying project identity...
ok Remotes fetched.
From https://willow.radicle.garden/hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio
 = [up to date]            hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh/heads/master -> refs/namespaces/hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio/refs/remotes/hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh/heads/master
 = [up to date]            hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh/rad/id -> refs/namespaces/hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio/refs/remotes/hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh/rad/id
 = [up to date]            hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh/rad/ids/hnrkrrwkajfh65ep7jozcr48fymqxy61f498o -> refs/namespaces/hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio/refs/remotes/hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh/rad/ids/hnrkrrwkajfh65ep7jozcr48fymqxy61f498o
 = [up to date]            hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh/rad/self -> refs/namespaces/hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio/refs/remotes/hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh/rad/self
 = [up to date]            hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh/rad/signed_refs -> refs/namespaces/hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio/refs/remotes/hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh/rad/signed_refs


Initializing local checkout for 🌱 rad:git:hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio (Bob Walsh)

ok Remote master branch found via hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh...
|
thread 'main' panicked at 'failed to parse remote name: RefFormat(Space)', /Users/runner/.cargo/git/checkouts/radicle-link-009c17032bc5eda9/a9485b7/cli/lnk-identities/src/git/checkout.rs:179:63
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: lnk_identities::git::checkout::checkout
   4: lnk_identities::project::checkout
   5: radicle_common::project::checkout
   6: rad_checkout::execute
   7: rad_clone::clone_project
   8: rad_clone::run
   9: radicle_terminal::run_command
  10: rad_clone::main
ok Performing checkout...
@FintanH
Copy link

FintanH commented Aug 25, 2022

Something worth doing is checking all the references under that namespace and checking the references. Hypothetically, there might be a reference which contains a space in it, which means that the check would fail.

What version of radicle-link is being used here, btw? Would be good to know for digging into where the panic is happening.

@adaszko
Copy link
Contributor Author

adaszko commented Aug 25, 2022

What version of radicle-link is being used here, btw? Would be good to know for digging into where the panic is happening.

Thanks for taking a look Fintan. I'm on rad 0.6.1 installed from homebrew, so this commit exactly: https://github.com/radicle-dev/radicle-cli/tree/v0.6.1

@pinkforest
Copy link
Contributor

Yeah this is old code that has disappeared.. I found from log that what added it

diff --git a/cli/lnk-identities/src/git/checkout.rs b/cli/lnk-identities/src/git/checkout.rs
index b85163dd..5a949465 100644
--- a/cli/lnk-identities/src/git/checkout.rs
+++ b/cli/lnk-identities/src/git/checkout.rs

...

+        let name =
+            RefLike::try_from(format!("{}@{}", handle, peer)).expect("failed to parse remote name");

@FintanH
Copy link

FintanH commented Aug 25, 2022

Ya, but this still exists in our code today https://github.com/radicle-dev/radicle-link/blob/master/cli/lnk-identities/src/git/checkout.rs#L200-L201

So I think it's actually the handle that has a space in it, could you confirm that? Guess I didn't expect that 🙃

@pinkforest
Copy link
Contributor

pinkforest commented Aug 25, 2022

LOL I had different error message... guess that clone I had was out of sync! 🥳

EDIT: err I mean 0.6 error message was diff :P yeah that makes sense - more coffee, or sleep ... 🤔

        let name = ref_format::RefString::try_from(format!("{}@{}", handle, peer))
            .expect("handle and peer are reflike");

@adaszko
Copy link
Contributor Author

adaszko commented Aug 25, 2022

Ya, but this still exists in our code today https://github.com/radicle-dev/radicle-link/blob/master/cli/lnk-identities/src/git/checkout.rs#L200-L201

So I think it's actually the handle that has a space in it, could you confirm that? Guess I didn't expect that 🙃

If by handle, you mean the project name, then yes, it's got spaces in it ("Bob Walsh"):

   {
      "defaultBranch" : "master",
      "delegates" : [
         {
            "ids" : [
               "hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh"
            ],
            "type" : "indirect",
            "urn" : "rad:git:hnrkrrwkajfh65ep7jozcr48fymqxy61f498o"
         }
      ],
      "description" : "test of radicle",
      "head" : "4364f4fab76766558dbf07bb4c41d00862b39016",
      "issues" : 0,
      "name" : "Bob Walsh",
      "patches" : 0,
      "remotes" : [
         "hydyqotuhn83syw9e4nphuhrnwg77ttw9zn33ccyy1sxzsiyc83syh"
      ],
      "urn" : "rad:git:hnrkn74zy5j579p1dkizn6kwg4tse4t39nbio"
   },

@pinkforest
Copy link
Contributor

pinkforest commented Aug 25, 2022

So how do we go about backporting a fix in radicle-link.. we probably can't atm 🤔

In case I missed something:

We probably just roll a fix on master on radicle-link that .. some day will end up to the used radicle-cli release binary when e.g. garden seeds are brought up to new master CLI compatibility wise that links release cycle basis to link git tag

Backporting fixes currently is interesting including with this release cycle coupling as reasonable person just would assume current master is what the users use with community seed nodes but in the end CLI binary was built long time ago and there is no way for us to nudge them to update

@FintanH
Copy link

FintanH commented Aug 26, 2022

If by handle, you mean the project name, then yes, it's got spaces in it ("Bob Walsh"):

I believe it would be a Person's name field that is used. I've outlined what the issue is and proposed a couple of potential solutions in the mailing list https://lists.sr.ht/~radicle-link/dev/%3Cg4n2QVjm-5Ii65VzonnxKkffi0ubUyyM_PCQj4DadhGeyPuyreRiJyEwtxbyIvhxqyMwHERn_TwwTdXNsI5TCcFZRz5UuOFKflFIFFnuMq0%3D%40protonmail.com%3E#%3CCMFTBPJ0AOY7.25ECAXMPWAHSY@haptop%3E

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

No branches or pull requests

3 participants