jfrog / bower-art-resolver

Apache License 2.0
15 stars 17 forks source link

bower-art-resolver not working, still trying to use github.com rather than internal artifactory #7

Closed sheeley closed 8 years ago

sheeley commented 8 years ago

I'm trying to set up an install using bower-art-resolver, and not having luck. Our repos appear to be set up correctly according to the instructions, but it is still trying to hit github.com rather than our internal virtual repo (bower-dev-repo).

Here's my setup:

✗ cat .bowerrc

{
  "registry": "http://internalrepo.corp/artifactory/api/bower/bower-dev-repo",
  "resolvers": [
      "bower-art-resolver"
  ]
}

✗ cat bower.json

{
  ...
  "dependencies": {
    "jquery-legacy": "jquery#1.10",
    "jquery": "jquery#2",
    "jquery-migrate": "~1.2.1",
    "jquery-validation": "~1.14.0",
    "jquery-cookie": "~1.4.1"
  }
}

✗ node_modules/bower/bin/bower -v

1.5.2

✗ cat node_modules/bower-art-resolver/package.json

{
  "name": "bower-art-resolver",
  "version": "2.0.1",
  "description": "The Artifactory Bower Resolver",
  "main": "./lib/index.js",
  "keywords": [
    "bower-resolver"
  ],
  "dependencies": {
    "decompress-zip": "^0.2.0",
    "graceful-fs": "^4.1.2",
    "junk": "^1.0.2",
    "mout": "~0.9.0",
    "path": "*",
    "q": "~1.0.1",
    "request": "~2.42.0",
    "request-progress": "^0.3.1",
    "retry": "^0.6.1",
    "semver": "^4.3.6",
    "tar-fs": "^1.7.0",
    "tmp": "0.0.26",
    "url": "*"
  },
  "gitHead": "92a60352b6ea34d522ac2e2189023b4102daf171",
  "_id": "bower-art-resolver@2.0.1",
  "scripts": {},
  "_shasum": "9a7ab9fb1073b0bd17dcdb6f6711ae1a356cb7ef",
  "_from": "bower-art-resolver@*",
  "_npmVersion": "2.12.1",
  "_nodeVersion": "0.12.6",
  "_npmUser": {
    "name": "jfrog",
    "email": "npm@jfrog.com"
  },
  "dist": {
    "shasum": "9a7ab9fb1073b0bd17dcdb6f6711ae1a356cb7ef",
    "tarball": "http://registry.npmjs.org/bower-art-resolver/-/bower-art-resolver-2.0.1.tgz"
  },
  "maintainers": [
    {
      "name": "jfrog",
      "email": "npm@jfrog.com"
    }
  ],
  "directories": {},
  "_resolved": "https://registry.npmjs.org/bower-art-resolver/-/bower-art-resolver-2.0.1.tgz",
  "readme": "ERROR: No README data found!"
}

✗ node_modules/bower/bin/bower -V install

bower jquery-legacy#1.10        cached git://github.com/jquery/jquery.git#1.10.2
bower jquery-legacy#1.10      validate 1.10.2 against git://github.com/jquery/jquery.git#1.10
bower jquery#2                  cached git://github.com/jquery/jquery.git#2.1.4
bower jquery#2                validate 2.1.4 against git://github.com/jquery/jquery.git#2
bower jquery-migrate#~1.2.1     cached git://github.com/appleboy/jquery-migrate.git#1.2.1
bower jquery-migrate#~1.2.1   validate 1.2.1 against git://github.com/appleboy/jquery-migrate.git#~1.2.1
bower jquery-validation#~1.14.0 cached git://github.com/jzaefferer/jquery-validation.git#1.14.0
bower jquery-validation#~1.14.0         validate 1.14.0 against git://github.com/jzaefferer/jquery-validation.git#~1.14.0
bower jquery-cookie#~1.4.1                cached git://github.com/carhartl/jquery-cookie.git#1.4.1
bower jquery-cookie#~1.4.1              validate 1.4.1 against git://github.com/carhartl/jquery-cookie.git#~1.4.1
bower jquery-cookie#~1.4.1               ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/carhartl/jquery-cookie.git", exit code of #128 fatal: unable to connect to github.com: github.com[0: 127.0.0.1]: errno=Connection refused

Additional error details:
fatal: unable to connect to github.com:
github.com[0: 127.0.0.1]: errno=Connection refused

Stack trace:
Error: Failed to execute "git ls-remote --tags --heads git://github.com/carhartl/jquery-cookie.git", exit code of #128
fatal: unable to connect to github.com:
github.com[0: 127.0.0.1]: errno=Connection refused
    at createError (~/bowertest/node_modules/bower/lib/util/createError.js:4:15)
    at ChildProcess.<anonymous> (~/bowertest/node_modules/bower/lib/util/cmd.js:102:21)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Socket.<anonymous> (child_process.js:1183:11)
    at Socket.emit (events.js:107:17)
    at Pipe.close (net.js:485:12)
From previous event:
    at executeCmd (~/bowertest/node_modules/bower/lib/util/cmd.js:61:22)
    at PThrottler._processEntry (~/bowertest/node_modules/bower/node_modules/p-throttler/index.js:89:25)
    at Promise.apply (~/bowertest/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:1122:26)
    at Promise.promise.promiseDispatch (~/bowertest/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:752:41)
    at ~/bowertest/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:1337:14
    at flush (~/bowertest/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:108:17)

Console trace:
Error
    at StandardRenderer.error (~/bowertest/node_modules/bower/lib/renderers/StandardRenderer.js:82:37)
    at Logger.<anonymous> (~/bowertest/node_modules/bower/bin/bower:110:22)
    at Logger.emit (events.js:107:17)
    at Logger.emit (~/bowertest/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
    at ~/bowertest/node_modules/bower/lib/commands/index.js:45:20
    at _rejected (~/bowertest/node_modules/bower/node_modules/q/q.js:844:24)
    at ~/bowertest/node_modules/bower/node_modules/q/q.js:870:30
    at Promise.when (~/bowertest/node_modules/bower/node_modules/q/q.js:1122:31)
    at Promise.promise.promiseDispatch (~/bowertest/node_modules/bower/node_modules/q/q.js:788:41)
    at ~/bowertest/node_modules/bower/node_modules/q/q.js:604:44
System info:
Bower version: 1.5.2
Node version: 0.12.7
OS: Darwin 14.5.0 x64

Any suggestions?

shikloshi commented 8 years ago

Hi, I can't seem to see anything wrong with the configurations but I would try with installing both bower and bower-art-resolver globally (e.g. npm i -g bower-art-resolver) and check again.

sheeley commented 8 years ago

Hi, I tried that: npm install -g bower bower-art-resolver

➜  bower-test  npm list -g | grep bower
├─┬ bower@1.5.2
│ ├─┬ bower-config@0.6.1
│ ├── bower-endpoint-parser@0.2.2
│ ├─┬ bower-json@0.4.0
│ ├── bower-logger@0.2.2
│ ├─┬ bower-registry-client@0.3.0
├─┬ bower-art-resolver@2.0.1

Still seeing this error:

➜  bower-test  bower install jquery
bower jquery#*              not-cached git://github.com/jquery/jquery.git#*
bower jquery#*                 resolve git://github.com/jquery/jquery.git#*
bower jquery#*                 ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/jquery/jquery.git", exit code of #128 fatal: unable to connect to github.com: github.com[0: 127.0.0.1]: errno=Connection refused

Additional error details:
fatal: unable to connect to github.com:
github.com[0: 127.0.0.1]: errno=Connection refused

When I hit the artifactory URL itself (http://artifactory.../artifactory/api/bower/bower-dev-repo/packages/jquery), I see this:

{
  "name" : "jquery",
  "url" : "git://github.com/jquery/jquery.git"
}

I assume that URL should be replaced by the artifactory one?

What else can I do to help debug?

sheeley commented 8 years ago
screen shot 2015-09-19 at 8 00 15 pm screen shot 2015-09-19 at 8 04 21 pm screen shot 2015-09-19 at 8 04 32 pm

Is this setup correct?

freddy33 commented 8 years ago

It looks like your bower-dev-repo is not declared as a bower repository. By the way, upgrading to the latest version 4.1.0 of Artifactory will make this whole setup process a lot easier :)

sheeley commented 8 years ago

@freddy33 Sorry, I didn't include bower-dev-repo:

screen shot 2015-09-19 at 8 17 57 pm

I'm not the owner of our artifactory, but will pass that info along :)

eyalbe4 commented 8 years ago

@sheeley , We've been trying to replicate this issue, and the only way we managed to have a situation where the bowerrc contains the above configuration and bower still resolves from github is when we override the data inside the bowerrc file with another file in a preceding location, environment variables or CLI flags (as the bower documentation states). Could it be that your bowerrc is overridden? As a troubleshooting step, you can try and force the registry URL through a command line argument as follows: bower install jquery --config.registry=https://bower.herokuapp.com This should resolve from github (same behavior as you experience today). Then try: bower install jquery --config.registry=Artifactory registry URL If you get an error saying: Could not find appropriate resolver for art://jquery/jquery it might mean that the configuration is not taken from the bowerrc you're looking at, but from a different file or env var. Let us know if the above provides any new clue.

sheeley commented 8 years ago

Thanks for taking a look, @eyalbe4.

I don't have another .bowerrc or any env variables set (I've just started to use bower), there's just the one I shared earlier, unfortunately.

When installing using the command line args, I still see it going to github:

  bower-test  bower install jquery --config.registry=https://bower.herokuapp.com
bower jquery#*              not-cached git://github.com/jquery/jquery.git#*
bower jquery#*                 resolve git://github.com/jquery/jquery.git#*
bower jquery#*                download https://github.com/jquery/jquery/archive/2.1.4.tar.gz
bower jquery#*                 extract archive.tar.gz
bower jquery#*                resolved git://github.com/jquery/jquery.git#2.1.4
➜  bower-test  bower install jquery --config.registry=https://
➜  bower-test  cat bower_components/
➜  bower-test  cat .bowerrc
{
  "registry": "http://repo.fanatics.corp/artifactory/api/bower/bower-dev-repo",
  "resolvers": [
      "bower-art-resolver"
  ]
}

➜  bower-test  bower install jquery-ui --config.registry=http://repo.fanatics.corp/artifactory/api/bower/bower-dev-repo
bower jquery-ui#*           not-cached git://github.com/components/jqueryui.git#*
bower jquery-ui#*              resolve git://github.com/components/jqueryui.git#*
bower jquery-ui#*             download https://github.com/components/jqueryui/archive/1.11.4.tar.gz
bower jquery-ui#*              extract archive.tar.gz
bower jquery-ui#*             resolved git://github.com/components/jqueryui.git#1.11.4
bower jquery-ui#~1.11.4        install jquery-ui#1.11.4

jquery-ui#1.11.4 bower_components/jquery-ui
└── jquery#2.1.4
eyalbe4 commented 8 years ago

@sheeley , in order for us to find the root cause of this issue, please send an e-mail to support@jfrog.com to get our Support Team involved (I have already notified them about this). If needed, we will go online with you and troubleshoot the issue.

ghost commented 8 years ago

Hello. Do you have an answer for this problem as I think I am facing the same issue?

sheeley commented 8 years ago

After doing some debugging, the JFrog folks suggested that it is fixed in the 3.7.0 version of Artifactory - we are running 3.6.x.

eyalbe4 commented 8 years ago

Correct. And thanks again @sheeley for working with us to pinpoint the issue. Version 3.7.0 should have this issue resolved, but we do recommend upgrading to the latest version, where the Bower repository configuration became much simpler and intuitive.

sheeley commented 8 years ago

Thank you all for looking at it with me. :)