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
Installing bower dependencies by URL from Github Enterprise stopped working after upgrade to 1.4.1 #1764
Comments
Hmm. You you provide some repository to test against, so we can fix it? |
Ping @nwinkler |
👍 would love on a test case on this also, I kinda figured we would get caught on some weird edges cases like this |
Unfortunately I can't provide you with a repository since it's only available internally at the company where I work. So I understand it's difficult to test and verify... could that be part of the problem though? |
I am also experiencing the same issues running against a private registry. We are using the private-bower registry. https://github.com/Hacklone/private-bower |
for what its worth, I am not able to repo this on my enterprise github on bower 1.4.1, running The dude from huboard mentioned that github gives devs an instance of github enterprise to develop against. Perhaps we could ask them for a dev copy to debug? |
Ah, dang. I was really hoping that this would work without any issue, but I didn't have a GitHub Enterprise instance to test. Can you run the following and post the full output here (replace the URL with yours, feel free to anonymize the result):
The code checks for the following to be present in the output:
All of the sources that I have found indicate that the presence of this value indicates that the server supports shallow cloning, i.e. is a smart Git host. Maybe we could get a sampling from several people using GitHub Enterprise and see if there's a pattern. |
@patrickkettner @anwalkers @samny It would be great if each of you could run that command and post the output here. |
Here's the output when running this against GitHub:
You can clearly see the Content-Type in there. The same results are provided by BitBucket and our internal Atlassian Stash instance, all of which support shallow cloning. |
I've requested GitHub Enterprise instance from GitHub as @patrickkettner suggested. |
Thanks @patrickkettner - that's interesting. I can see that there are two requests made to your server. The first one returns It looks like the check needs to be changed to test the first occurrence of |
Here you go. I change companyName, userName, and IP address to protect the innocent...
|
Just to check my insanity I did downgrade to 1.3.12 and it does work there... |
Thanks for the data, @anwalkers - that's helpful. It looks like it's really the first Content-Type that needs to be verified, as it's returning the smart content type in a later request. Update: This is probably a wrong assumption. |
@anwalkers @samny what version of GHE are you running? |
I'm on Github Enterprise 11.10.348 |
And this is my output from the script: https://gist.github.com/samny/2a189cc4012a0c14c6d8 |
Thanks, @samny Unfortunately, this is not consistent with the other GitHub Enterprise responses. Your response shows the correct Content-Type. |
It shows exactly the same response fields as the one from GitHub. I'm not sure how to solve this at the moment, it looks like the server returns the expected content type, but doesn't act like a smart Git host. |
I've created a PR that includes the check for the first content type here: #1766. But I'm not sure whether it covers all of the GitHub Enterprise use cases - it looks like it won't help @samny for example. Could the content type be dependent on the server that's used for hosting the Git repo, and the kind of authentication that's used? I can spend some more time on this tomorrow, but it would really help if we had access to a GitHub Enterprise instance, or could talk to someone at GitHub who understands the ins and outs of their GitHub Enterprise product and its support for shallow cloning. |
Thanks for getting on this so quickly, awesome work! As expected though, it doesn't seem to solve the issue for my Enterprise version (I tried installing your pull request @nwinkler). |
BTW: Did anyone of you report this issue to GitHub Enterprise support? What's their take on it? Is it recognized as an official bug from their side? I have tried to read through the GitHub Enterprise release notes, but haven't found anything on this topic there (it's not very detailed). Since I don't have a support contract with GitHub Enterprise, can maybe one of you @samny @patrickkettner @anwalkers contact your support and ask them about the issue? I would like to understand why this seems to happen with some versions of GitHub Enterprise, but works fine for others. |
@sheerun said he had contacted them. |
Yes, he contacted them about a test instance that we could use. I would still like to hear what they have to say about not supporting shallow clones, it sounds like a bug on their end to me. Every other Git hosting service seems to support it just fine. |
GitHub says "the bug regarding shallow clones has been fixed on the GitHub Enterprise 2.1-series.". Also, they'll give me access to Github Enterprise, so yay :) |
This means the following: Once we have established whether the server is a smart server in That's a lot of additional requests. Could one of the folks running GitHub Enterprise verify these suggestions against their instance:
Detecting this reliably would involve quite a bit of extra work, all for supporting an older, faulty version of a product. We might be better off with an on/off command line switch or configuration option... |
@nwinkler Maybe we could implement "retry" mode for When running API could be something like:
Maybe we should also consider configuration option, as timeout would occur every Also, due to concurrency there would be multiple timeouts and retries per |
In the proposed timeout scenario, you would also have to do the following:
I think either a configuration on/off switch or a blacklist/whitelist approach like in #1559 would help. Hopefully the need for this will go away over time, as more people update their GitHub Enterprise instance to a version that supports shallow cloning. |
@nwinkler I tried the requests you suggested, and it seems to work as expected. I get a JSON response on |
@samny Thanks for verifying. Now we have to decide whether it's worth implementing a complex fix/check for this... |
+1 for a fix. this issue is messing with us at my work here also. We're going to be using 1.3.12 for now until this issue can get resolved, because we have little control over our Github Enterprise version. |
+1 Same issue and problem as @michaelwarren1106 |
+1 |
I'm experiencing the same issue, but instead GitHub enterprise, we're using a private-hosted RhodeCode server in our company. This is what I'm doing to install a private repo: $ bower install git+https://USER:PASSWORD@privaterhodecode.net/some-angularjs-private-module --save --verbose This is the output I get: It completely hangs after $ GIT_CURL_VERBOSE=2 git ls-remote --heads git+https://USER:PASSWORD@privaterhodecode.net/some-angularjs-private-module I get this output. We're planning to switch from RhodeCode to another solution, but we're facing an enormous amount of work and it's not going to happen soon. |
Looks like a bug with RhodeCode to me. The server is advertising that it supports smart Git features, i.e. it will allow shallow cloning, but in reality it does not, hence the stalled download. The same issue is/was present in earlier versions of GitHub Enterprise. @alvaromb Can you check with the RhodeCode project whether they support shallow cloning? It looks like a bug on their end. Or you could try cloning one of the projects you host on this server using |
This is the output I'm getting while cloning with
|
Thanks for verifying! This looks like an issue in RhodeCode. If they are advertising to support shallow cloning (through the |
One more question: Do you get this error immediately, or does it take a while after starting the |
I get the error 2 or 3 seconds after the clone. |
Some links I found to give more detail on this: |
Ah, right - that would explain the presence of this error in your environment. |
In bower 1.5 it's possible to create custom git resolver that supports shallow cloning by default. To maintain backward compatibility I'm putting this feature behind a flag in Bower's default resolvers. |
Thanks! From looking at the code, it looks like the default behavior is to not use shallow cloning. You have to specify the hosts that support shallow cloning in the global config file, right? The irony is that I had implemented that same approach about a year ago in #1559 and it was rejected because it was adding another configuration value. Now we're back to this. Well, whatever... |
@sheerun Have you updated the documentation with the new key? I'll have to share this info with my team so we can list our private Git repo in the config file. |
Hey @nwinkler, sorry about that.. It would be perfect if your solution worked for all hosts, but bower has huge user base and people keep complaining. I'm thinking about introducing I've documented new configuration key in http://bower.io/docs/config/#shallow-clone-hosts |
@sheerun Thanks - no hard feelings 😄 I understand the concerns with the user base. The problem with whitelisting (or blacklisting) is that you can't possibly account for the myriad of privately hosted corporate Git repos. Someone will have to bite the bullet and either whitelist or blacklist their instance... |
See bower/bower#1764 and bower/bower@26f80d2 for more details The `shallowCloneHosts` array was not documented up to now.
See bower/bower#1764 and bower/bower@26f80d2 for more details The `shallowCloneHosts` array was not documented up to now.
See bower/bower#1764 and bower/bower@26f80d2 for more details The `shallowCloneHosts` array was not documented up to now.
This is how the dependencies section of my bower.json looks:
Running
bower install -V
gives me this output:Then it just hangs indefinitely.
The output suggests it would be related to this in release notes for 1.4: Automatically detecting smart Git hosts (#1628).
I only have this problem when referencing a Github Enterprise repository, the same config works fine with ordinary Github. If I downgrade to Bower 1.3.12 it works again
The text was updated successfully, but these errors were encountered: