iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

IceGitHubError: Not found on cloning private github repos

Open astares opened this issue 6 years ago • 10 comments

When I clone a private GitHub repo using Iceberg using HTTPS the Iceberg tool asks for credentials and then clones correctly into a local repo in filesystem - but throws a "NotFound" error in Pharo afterwards. One then always have to use the "attach existing" afterwards to find the already cloned repo and connect to it.

Reason is because for private repos one gets a HTTP 404 that does not pass the #isSuccess test in responseWithValidationDo:

astares avatar Feb 20 '19 11:02 astares

image

astares avatar Feb 20 '19 11:02 astares

Guille answered on Discord:

well... known... I think I could know what the cause is when we clone from github, we call the github API anonymously to check if the repo is a fork or not (if it's a fork we automatically configure remotes) now, we probably should use the credentials (if available) or ask for them again (if not saved/ not available) and do not fail miserably like that in case the request failed

astares avatar Feb 20 '19 11:02 astares

Interesting thing is that it actually load the repository (at least on my device), but still throw the error. So you can "import from existing clone" the directory.

hogoww avatar Feb 26 '19 11:02 hogoww

Similar issue #1167

hogoww avatar Feb 27 '19 15:02 hogoww

Yes, I concur, the error only happens on private repositories, not public ones. The exact error is: "IceGitHubError: Not Found". The error is happening on the http level and the response from the server is: a ZnResponse(404 Not Found application/json;charset=utf-8 88B)

I am using Linux x64 with Pharo 7.

If there is any more information that would be helpful to you, ask and I can retrieve it for you.

steveeq1 avatar Mar 10 '19 16:03 steveeq1

this happened to me again yesterday , I had also reported last year on Pharo7 , this is present in Pharo 8 as well, just some steps for recreating which I think are well understood but here they are nonetheless:

these are the steps I took :

  1. created private virgin github repo initialized with a readme.md
  2. From Iceberg I engaged "Clone from Github" using the https protocol for auth, I entered my github user name i.e. "owner name" , and entered the flat repo name i.e. "Project Name" e.g. TestIceberg3

this gnerates a walkback with exception IceGitHubError : Not Found , "a ZnResponse(404 Not Found application/json;charset=utf-8 88B)" HTTP/1.1 404 Not Found, I have done this now multiple times , its not a typo thing, Now if I repeat the above steps but instead I create a new "public" repo, then there's no issue

Also the workaround is to first clone a virgin public repo, hook it up via Iceberg, and then go back to GitHub and via settings make the repo private, subsequent submits to GitHub will work fine

thanks

amiracam avatar Apr 02 '20 11:04 amiracam

Hi @tesonep, it seems to me that this issue has not been solved yet. I have just run into the same issue as mentioned here on cloning a private GitHub repo. To us at Object Guild, being able to clone private repositories is essential.

The change made in IceBerg pull request https://github.com/pharo-vcs/iceberg/pull/1611 doesn't seem to be included in Pharo 10.0. How can we get this integrated into P10 stable so that it is available in new images created using the Pharo Launcher?

Cheers, Jonathan

jvalteren avatar Dec 19 '22 16:12 jvalteren

Sorry for the noise, I think I mistagged this issue in PR #1611

We'll check this issue this week. Happy new year!

guillep avatar Jan 03 '23 10:01 guillep

As I mentioned last week on Discord, this is popping up for everyone trying to use Pharo to do development on a private github repository. This means: companies and independent developers. So, anyone giving it a try is immediately thrown this error (for years now). Seasoned Pharo developers can sort it out and just apply the following patch to get going (which is what we did):

IceTipGitHubRepositoryPanel>>getGitHubRepository

	^ [ IceGitHubAPI new
		beAnonymous;
		getRepository: self userName project: self projectName ]
			on: IceGitHubError
			do: [ nil ]

I'm not sure what a 'good' solution here would be?

jbrichau avatar Mar 06 '23 09:03 jbrichau

Guille explained the issue to me 3/4 years ago, but I do not remember the problem with fixing the error well enough to explain it. At the time, I had proposed a semantic preserving intermediate solution with a simple comment, that was discarded. I didn't have the time to followup, particularly because there was little interest at the time.

Here if someone want to do something similar: https://github.com/pharo-vcs/iceberg/pull/1232

Pierre

hogoww avatar Mar 08 '23 06:03 hogoww