fork-dev / TrackerWin

Bug and issue tracker for Fork for Windows
450 stars 10 forks source link

Cannot Fetch Submodule - "Repository Not Found" even though it exists #2159

Closed felix-cloudberrie closed 4 months ago

felix-cloudberrie commented 4 months ago

I am trying the clone a repository through SSH in github but for some reason, the submodule cannot be fetched with a corresponding error that the repository cannot be found. I can clone the said submodule as a separate repository with no problem.

remote: Repository not found.
fatal: repository '<repo link here>' not found
Unable to fetch in submodule path '<submodule path here>'; trying to directly fetch c01080c2da2365a67a887f194d29d4eb7ef1a3d4:
remote: Repository not found.
fatal: repository '<repo link here>' not found
fatal: Fetched in submodule path '<submodule path here>', but it did not contain c01080c2da2365a67a887f194d29d4eb7ef1a3d4. Direct fetching of that commit failed

I already added my SSH key to Fork. My hunch is that there is a problem with the authentication but I'm confused why it only happens when the repo is fetched as a submodule. I also tried a different git client and it seems to be checked out just fine after specifying the SSH key and account.

Any suggestions on how to fix this? Thank you very much.

DanPristupov commented 4 months ago
  1. Accounts only work with HTTPS protocol and are ignored with SSH.
  2. Ensure that your key is the only key selected in 'Fork -> Configure SSH keys' dialog.
felix-cloudberrie commented 4 months ago

SSH-Key

I only have one SSH key so yes that is the only key selected.

DanPristupov commented 4 months ago

Are you sure the submodule uses SSH protocol?

felix-cloudberrie commented 4 months ago

Are you sure the submodule uses SSH protocol?

So upon checking the .gitmodule, the submodule URL is in https but the main repository only allows SSH access. Is this an incompatible setup? Sorry for the confusion. I should have clarified that the main repo is checked out using SSH.

DanPristupov commented 4 months ago

So, you have a problem with HTTPS authentication and SSH is not related.

Try to log in to the account which has an access to the submodule repo (Fork -> Accounts -> +).

felix-cloudberrie commented 4 months ago

I am already logged in with the account when I encountered the issue.

git-account

I already tried cloning just the repo of the submodule and worked with no problems.

DanPristupov commented 4 months ago

Did you try to clone the parent repo by HTTPS?

felix-cloudberrie commented 4 months ago

Did you try to clone the parent repo by HTTPS?

Yes. The same error of repository not found. According to my teammate, the repo is only allowed to be cloned via SSH.

Just to clarify, I was able to clone the same main repo with another git client (SourceTree) with no issues with the submodule and no modifications with the .gitmodule whatsoever so I am wondering if I am just missing some setting(s) in fork.

DanPristupov commented 4 months ago

According to my teammate, the repo is only allowed to be cloned via SSH.

The parent one or the submodule?

felix-cloudberrie commented 4 months ago

Both the parent and submodule require SSH

DanPristupov commented 4 months ago

Both the parent and submodule require SSH

But you just said that the gitmodule is linked by HTTPS:

So upon checking the .gitmodule, the submodule URL is in https

felix-cloudberrie commented 4 months ago

Yes. So basically, my experience with SourceTree is that I can still clone the entire parent repository using SSH with its gitmodule specifying a https connection for its submodule and it still works. So I am wondering if I can do the same with fork.

DanPristupov commented 4 months ago

Both the parent and submodule require SSH

No, looks like submodule doesn't use SSH.

As I said, you have a problem with HTTPS authentication and SSH is not related.

  1. Just to test, copy the submodule repo url and try to clone it. Does it work?
  2. If you open Fork -> Accounts -> GitHub -> Repositories tab, do you see the submodule repo here? If not, ensure that Fork has an access to your organization: https://github.com/settings/connections/applications/debde513eaa447b74d51
felix-cloudberrie commented 4 months ago

Both the parent and submodule require SSH

No, looks like submodule doesn't use SSH.

As I said, you have a problem with HTTPS authentication and SSH is not related.

  1. Just to test, copy the submodule repo url and try to clone it. Does it work?
  2. If you open Fork -> Accounts -> GitHub -> Repositories tab, do you see the submodule repo here? If not, ensure that Fork has an access to your organization: https://github.com/settings/connections/applications/debde513eaa447b74d51

The problem is indeed with the access of Fork to the organization. It only had access to my personal repositories. Thank you for your assistance and patience.