3scale-archive / 3scale-cli

DEPRECATED Beta of 3scale CLI, manage your 3scale installation directly from terminal (community supported)
https://www.3scale.net
MIT License
9 stars 21 forks source link

3scale-cli and Your credentials are invalid #71

Closed 4integration closed 6 years ago

4integration commented 6 years ago

Trying to use 3scale-cli but fails at configuration.

C:> 3scale-cli config [ 3scale-cli ] Please answer the following questions to configure 3scale cli. ? 3scale access token 015e77038cccbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxad8f2d0854f352 ? 3scale id myaccount ? 3scale wildcard domain 3scale.net [3scale-cli] ERROR encountered: Your credentials are invalid. Check them and try again.

The access token have read&write to Billing API, Account Management API, and Analytics API I have also tried with another access token (that I am using for gateway and getting config) - same fault.

Any idea what could be wrong?

kevprice83 commented 6 years ago

Also tried is exporting NODE_TLS_REJECT_UNAUTHORIZED=0 but that didn't fix the issue.

cc @sgutierr @picsoung

sgutierr commented 6 years ago

I can't reproduce it using my 3scale account, could you share which npm package version you have installed, this is going /usr/lib/node_modules/node-3scale-cli (maybe your path is different) and executing "npm list"

kevprice83 commented 6 years ago

cc @4integration ^^

4integration commented 6 years ago

Here are some info...

C:\Users\jj\AppData\Roaming\npm\node_modules\node-3scale-cli /> node -v v9.0.0

C:\Users\jj\AppData\Roaming\npm\node_modules\node-3scale-cli /> npm -v 5.5.1

C:\Users\jj\AppData\Roaming\npm\node_modules\node-3scale-cli /> npm list node-3scale-cli@0.11.2 C:\Users\jj\AppData\Roaming\npm\node_modules\node-3scale-cli +-- colors@1.1.2 +-- commander@2.15.0 +-- debug@3.1.0 |-- ms@2.0.0 +-- delay-promise@2.1.0 +-- easy-table@1.1.1 | +-- ansi-regex@3.0.0 | -- wcwidth@1.0.1 |-- defaults@1.0.3 | -- clone@1.0.3 +-- http-error-constructor@0.1.0 | +-- lodash.camelcase@3.0.1 | |-- lodash._createcompounder@3.0.0 | | +-- lodash.deburr@3.2.0 | | | -- lodash._root@3.0.1 | |-- lodash.words@3.2.0 | | -- lodash._root@3.0.1 deduped |-- lodash.capitalize@3.0.0 | -- lodash._basetostring@3.0.1 +-- inquirer@3.3.0 | +-- ansi-escapes@3.0.0 | +-- chalk@2.3.2 | | +-- ansi-styles@3.2.1 | | |-- color-convert@1.9.1 | | | -- color-name@1.1.3 | | +-- escape-string-regexp@1.0.5 | |-- supports-color@5.3.0 | | -- has-flag@3.0.0 | +-- cli-cursor@2.1.0 | |-- restore-cursor@2.0.0 | | +-- onetime@2.0.1 | | | -- mimic-fn@1.2.0 | |-- signal-exit@3.0.2 | +-- cli-width@2.2.0 | +-- external-editor@2.1.0 | | +-- chardet@0.4.2 | | +-- iconv-lite@0.4.19 | | -- tmp@0.0.33 | |-- os-tmpdir@1.0.2 | +-- figures@2.0.0 | | -- escape-string-regexp@1.0.5 deduped | +-- lodash@4.17.5 | +-- mute-stream@0.0.7 | +-- run-async@2.3.0 | |-- is-promise@2.1.0 | +-- rx-lite@4.0.8 | +-- rx-lite-aggregates@4.0.8 | | -- rx-lite@4.0.8 deduped | +-- string-width@2.1.1 | | +-- is-fullwidth-code-point@2.0.0 | |-- strip-ansi@4.0.0 deduped | +-- strip-ansi@4.0.0 | | -- ansi-regex@3.0.0 deduped |-- through@2.3.8 +-- mkdirp@0.5.1 | -- minimist@0.0.8 +-- nconf@0.8.5 | +-- async@1.5.2 | +-- ini@1.3.5 | +-- secure-keys@1.0.0 |-- yargs@3.32.0 | +-- camelcase@2.1.1 | +-- cliui@3.2.0 | | +-- string-width@1.0.2 | | | +-- code-point-at@1.1.0 deduped | | | +-- is-fullwidth-code-point@1.0.0 | | | | -- number-is-nan@1.0.1 deduped | | |-- strip-ansi@3.0.1 deduped | | +-- strip-ansi@3.0.1 | | | -- ansi-regex@2.1.1 | |-- wrap-ansi@2.1.0 | | +-- string-width@1.0.2 | | | +-- code-point-at@1.1.0 deduped | | | +-- is-fullwidth-code-point@1.0.0 | | | | -- number-is-nan@1.0.1 deduped | | |-- strip-ansi@3.0.1 deduped | | -- strip-ansi@3.0.1 | |-- ansi-regex@2.1.1 | +-- decamelize@1.2.0 | +-- os-locale@1.4.0 | | -- lcid@1.0.0 | |-- invert-kv@1.0.0 | +-- string-width@1.0.2 | | +-- code-point-at@1.1.0 | | +-- is-fullwidth-code-point@1.0.0 | | | -- number-is-nan@1.0.1 | |-- strip-ansi@3.0.1 | | -- ansi-regex@2.1.1 | +-- window-size@0.1.4 |-- y18n@3.2.1 +-- os-homedir@1.0.2 +-- prettyjson@1.2.1 | +-- colors@1.1.2 deduped | -- minimist@1.2.0 +-- prompt@1.0.0 | +-- colors@1.1.2 deduped | +-- pkginfo@0.4.1 | +-- read@1.0.7 | |-- mute-stream@0.0.7 deduped | +-- revalidator@0.1.8 | +-- utile@0.3.0 | | +-- async@0.9.2 | | +-- deep-equal@0.2.2 | | +-- i@0.3.6 | | +-- mkdirp@0.5.1 deduped | | +-- ncp@1.0.1 | | -- rimraf@2.6.2 | |-- glob@7.1.2 | | +-- fs.realpath@1.0.0 | | +-- inflight@1.0.6 | | | +-- once@1.4.0 deduped | | | -- wrappy@1.0.2 | | +-- inherits@2.0.3 | | +-- minimatch@3.0.4 | | |-- brace-expansion@1.1.11 | | | +-- balanced-match@1.0.0 | | | -- concat-map@0.0.1 | | +-- once@1.4.0 | | |-- wrappy@1.0.2 deduped | | -- path-is-absolute@1.0.1 |-- winston@2.1.1 | +-- async@1.0.0 | +-- colors@1.0.3 | +-- cycle@1.0.3 | +-- eyes@0.1.8 | +-- isstream@0.1.2 deduped | +-- pkginfo@0.3.1 | -- stack-trace@0.0.10 +-- q@1.5.1 +-- raml-1-parser@1.1.41 | +-- base64url@2.0.0 | +-- change-case@3.0.1 | | +-- camel-case@3.0.0 | | | +-- no-case@2.3.2 deduped | | |-- upper-case@1.1.3 deduped | | +-- constant-case@2.0.0 | | | +-- snake-case@2.1.0 deduped | | | -- upper-case@1.1.3 deduped | | +-- dot-case@2.1.1 | | |-- no-case@2.3.2 deduped | | +-- header-case@1.0.1 | | | +-- no-case@2.3.2 deduped | | | -- upper-case@1.1.3 deduped | | +-- is-lower-case@1.1.3 | | |-- lower-case@1.1.4 deduped | | +-- is-upper-case@1.1.2 | | | -- upper-case@1.1.3 deduped | | +-- lower-case@1.1.4 | | +-- lower-case-first@1.0.2 | | |-- lower-case@1.1.4 deduped | | +-- no-case@2.3.2 | | | -- lower-case@1.1.4 deduped | | +-- param-case@2.1.1 | | |-- no-case@2.3.2 deduped | | +-- pascal-case@2.0.1 | | | +-- camel-case@3.0.0 deduped | | | -- upper-case-first@1.1.2 deduped | | +-- path-case@2.1.1 | | |-- no-case@2.3.2 deduped | | +-- sentence-case@2.1.1 | | | +-- no-case@2.3.2 deduped | | | -- upper-case-first@1.1.2 deduped | | +-- snake-case@2.1.0 | | |-- no-case@2.3.2 deduped | | +-- swap-case@1.1.2 | | | +-- lower-case@1.1.4 deduped | | | -- upper-case@1.1.3 deduped | | +-- title-case@2.1.1 | | | +-- no-case@2.3.2 deduped | | |-- upper-case@1.1.3 deduped | | +-- upper-case@1.1.3 | | -- upper-case-first@1.1.2 | |-- upper-case@1.1.3 deduped | +-- fs-extra@4.0.2 | | +-- graceful-fs@4.1.11 | | +-- jsonfile@4.0.0 | | | -- graceful-fs@4.1.11 deduped | |-- universalify@0.1.1 | +-- http-response-object@2.0.3 | | -- @types/node@7.0.56 | +-- invariant@2.2.2 | |-- loose-envify@1.3.1 | | -- js-tokens@3.0.2 | +-- json-path@0.1.3 | |-- json-ptr@0.1.1 | +-- json-schema-compatibility@1.1.0 | +-- json-stable-stringify@1.0.1 | | -- jsonify@0.0.0 | +-- loophole@1.1.0 | +-- lrucache@1.0.3 | +-- media-typer@0.3.0 | +-- mkdirp@0.5.1 deduped | +-- pluralize@7.0.0 | +-- promise-polyfill@6.0.2 | +-- q@1.5.0 | +-- raml-definition-system@0.0.79 | | +-- know-your-http-well@0.5.0 | | |-- amdefine@0.0.8 | | +-- raml-typesystem@0.0.84 | | | +-- bignumber.js@4.1.0 | | | +-- date-and-time@0.5.0 | | | +-- escape-html@1.0.3 | | | +-- json-schema-compatibility@1.1.0 deduped | | | +-- json-to-ast@2.0.0-alpha1.3 | | | +-- lrucache@1.0.3 deduped | | | +-- raml-json-validation@0.0.16 | | | | -- z-schema@3.18.4 deduped | | | +-- raml-xml-validation@0.0.14 | | | |-- xmllint-jsparser@0.0.3 | | | +-- underscore@1.8.3 deduped | | | +-- xml2js@0.4.19 | | | | +-- sax@1.2.4 | | | | -- xmlbuilder@9.0.7 | | |-- xmldom@0.1.27 deduped | | +-- ts-structure-parser@0.0.16 deduped | | -- underscore@1.8.3 deduped | +-- ts-model@0.0.17 | |-- underscore@1.8.3 deduped | +-- ts-structure-parser@0.0.16 | | +-- typescript@2.5.2 | | -- underscore@1.8.3 deduped | +-- typescript-compiler@1.4.1-2 | +-- underscore@1.8.3 deduped | +-- xhr2@0.1.4 | +-- xmldom@0.1.27 | +-- xmlhttprequest@1.8.0 | +-- yaml-ast-parser@0.0.40 |-- z-schema@3.18.4 | +-- commander@2.15.0 deduped | +-- lodash.get@4.4.2 | +-- lodash.isequal@4.5.0 | -- validator@8.2.0 +-- request@2.83.0 | +-- aws-sign2@0.7.0 | +-- aws4@1.6.0 | +-- caseless@0.12.0 | +-- combined-stream@1.0.6 | |-- delayed-stream@1.0.0 | +-- extend@3.0.1 | +-- forever-agent@0.6.1 | +-- form-data@2.3.2 | | +-- asynckit@0.4.0 | | +-- combined-stream@1.0.6 deduped | | -- mime-types@2.1.18 deduped | +-- har-validator@5.0.3 | | +-- ajv@5.5.2 | | | +-- co@4.6.0 | | | +-- fast-deep-equal@1.1.0 | | | +-- fast-json-stable-stringify@2.0.0 | | |-- json-schema-traverse@0.3.1 | | -- har-schema@2.0.0 | +-- hawk@6.0.2 | | +-- boom@4.3.1 | | |-- hoek@4.2.1 deduped | | +-- cryptiles@3.1.2 | | | -- boom@5.2.0 | | |-- hoek@4.2.1 deduped | | +-- hoek@4.2.1 | | -- sntp@2.1.0 | |-- hoek@4.2.1 deduped | +-- http-signature@1.2.0 | | +-- assert-plus@1.0.0 | | +-- jsprim@1.4.1 | | | +-- assert-plus@1.0.0 deduped | | | +-- extsprintf@1.3.0 | | | +-- json-schema@0.2.3 | | | -- verror@1.10.0 | | | +-- assert-plus@1.0.0 deduped | | | +-- core-util-is@1.0.2 | | |-- extsprintf@1.3.0 deduped | | -- sshpk@1.13.1 | | +-- asn1@0.2.3 | | +-- assert-plus@1.0.0 deduped | | +-- bcrypt-pbkdf@1.0.1 | | |-- tweetnacl@0.14.5 deduped | | +-- dashdash@1.14.1 | | | -- assert-plus@1.0.0 deduped | | +-- ecc-jsbn@0.1.1 | | |-- jsbn@0.1.1 deduped | | +-- getpass@0.1.7 | | | -- assert-plus@1.0.0 deduped | | +-- jsbn@0.1.1 | |-- tweetnacl@0.14.5 | +-- is-typedarray@1.0.0 | +-- isstream@0.1.2 | +-- json-stringify-safe@5.0.1 | +-- mime-types@2.1.18 | | -- mime-db@1.33.0 | +-- oauth-sign@0.8.2 | +-- performance-now@2.1.0 | +-- qs@6.5.1 | +-- safe-buffer@5.1.1 | +-- stringstream@0.0.5 | +-- tough-cookie@2.3.4 | |-- punycode@1.4.1 | +-- tunnel-agent@0.6.0 | | -- safe-buffer@5.1.1 deduped |-- uuid@3.2.1 +-- slug@0.9.1 | -- unicode@10.0.0 +-- swagger-parser@4.0.0-beta.2 | +-- call-me-maybe@1.0.1 | +-- debug@2.6.9 | |-- ms@2.0.0 deduped | +-- es6-promise@3.3.1 | +-- json-schema-ref-parser@3.3.1 | | +-- call-me-maybe@1.0.1 deduped | | +-- debug@3.1.0 deduped | | +-- es6-promise@4.2.4 | | +-- js-yaml@3.11.0 | | | +-- argparse@1.0.10 | | | | -- sprintf-js@1.0.3 | | |-- esprima@4.0.0 | | +-- ono@4.0.3 | | | -- format-util@1.0.3 | |-- z-schema@3.18.4 deduped | +-- ono@2.2.5 | +-- swagger-methods@1.0.4 | +-- swagger-schema-official@2.0.0-bab6bed | -- z-schema@3.18.4 deduped -- underscore@1.8.3`

4integration commented 6 years ago

Tested on another computer, connected directly to internet and it works.

How about proxy support in 3scale-cli?

4integration commented 6 years ago

I have the npm config:

c:\ > npm config list
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/5.6.0 node/v9.8.0 win32 x64"

; userconfig C:\Users\jj\.npmrc
NODE_TLS_REJECT_UNAUTHORIZED = "0"
http-proxy = "http://proxyhost.net:83"
https-proxy = "http://proxyhost.net:83/"
proxy = "http://proxyhost.net:83/"

; builtin config undefined
prefix = "C:\\Users\\jj\\AppData\\Roaming\\npm"

; node bin location = C:\Joacim\Apps\nodejs\node.exe
; cwd = C:\Users\jj
; HOME = C:\Users\jj
; "npm config ls -l" to show all defaults.
picsoung commented 6 years ago

Hi @4integration I pushed a new version 0.12.0 yesterday, it has more debug options, and more functionalities for proxy.

Let us know if you keep seeing the issue.

4integration commented 6 years ago

Hi @picsoung

I have tested it but same issue.

By proxy do you mean using a web proxy - i.e. to access web resources on internet you need to pass through a web proxy from corporate network? How do you configure/use web proxy?

4integration commented 6 years ago

Hi,

It is solved!!

Thanks to @mayorova in support case and link to https://github.com/request/request#controlling-proxy-behaviour-using-environment-variables together with revised configuration I noticed a difference between npm config above https-proxy = "http://proxyhost.net:83/"

https using http proxy (no TLS) but the environment variable had https-proxy = "https://proxyhost.net:83/"

Changed to: https-proxy = "http://proxyhost.net:83/" and now it works

mayorova commented 6 years ago

@4integration Happy to hear that you've been able to solve this :)

picsoung commented 6 years ago

awesome to hear it was resolved! sorry, @4integration I understood your issue the wrong way. I thought you were trying to use the proxy command on the CLI.