watson-developer-cloud / assistant-with-discovery-openwhisk

DEPRECATED: this repo is no longer actively maintained
Apache License 2.0
21 stars 43 forks source link

APIKey vs UserName / Paswword #58

Closed alessandrovignazia closed 6 years ago

alessandrovignazia commented 6 years ago

I am trying to run "npm run train" as per the guide but I am getting the following error message....does it have to do that I only have username and password for both the assistant and discovery services and replaced the "ApiKey" and "ApiKeyName" with "username" and "password" in the "credentials.json"....IBM cloud does not appear to automatically provide API keys....

Creating environment { Error: {"context":{"requestId":"90799aceff134319b5f363d559f7698a","requestType":"incoming.Identity_Token","userAgent":"watson-developer-cloud-nodejs-3.7.0;","clientIp":"105.227.108.57","url":"https://iam.bluemix.net","instanceId":"iamid-9955f7b67-zlkqv","threadId":"230185","host":"iamid-9955f7b67-zlkqv","startTime":"22.10.2018 15:06:32:158 UTC","endTime":"22.10.2018 15:06:32:236 UTC","elapsedTime":"78","locale":"en_US","clusterName":"iam-id-prfra04-h7e1"},"errorCode":"BXNIM0415E","errorMessage":"Provided API key could not be found"}

alessandrovignazia commented 6 years ago

so I tried to run "npm run train" from within CYGWIN (I am running windows 10) and I got the following error message:

alexv@LAPTOP-FHN7KDT7 /cygdrive/c/Users/alexv/assistant-with-discovery-openwhisk-master $ npm run train

@ibm-watson/assistant-with-discovery-openwhisk@0.1.0 train C:\Users\alexv\assistant-with-discovery-openwhisk-master cp .env.example .env && node ./train-conversation.js && node ./train-discovery.js

C:\Users\alexv\assistant-with-discovery-openwhisk-master\node_modules\watson-developer-cloud\lib\base_service.js:215 throw new Error(errorMessage); ^

Error: Insufficient credentials provided in constructor argument. Refer to the documentation for the required parameters. Common examples are username/password, api_key, and iam_access_token. at DiscoveryV1.BaseService.initCredentials (C:\Users\alexv\assistant-with-discovery-openwhisk-master\node_modules\watson-developer-cloud\lib\base_service.js:215:23) at DiscoveryV1.BaseService (C:\Users\alexv\assistant-with-discovery-openwhisk-master\node_modules\watson-developer-cloud\lib\base_service.js:61:29) at DiscoveryV1 [as constructor] (C:\Users\alexv\assistant-with-discovery-openwhisk-master\node_modules\watson-developer-cloud\discovery\v1-generated.js:54:28) at new DiscoveryV1 (C:\Users\alexv\assistant-with-discovery-openwhisk-master\node_modules\watson-developer-cloud\discovery\v1.js:37:24) at Object. (C:\Users\alexv\assistant-with-discovery-openwhisk-master\train-discovery.js:15:21) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ibm-watson/assistant-with-discovery-openwhisk@0.1.0 train: cp .env.example .env && node ./train-conversation.js && node ./train-discovery.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ibm-watson/assistant-with-discovery-openwhisk@0.1.0 train script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\alexv\AppData\Roaming\npm-cache_logs\2018-10-22T15_36_01_335Z-debug.log

alessandrovignazia commented 6 years ago

I finally managed to resolve using username / password for apikey and apikename! :-)

brajeshyadav84 commented 5 years ago

Could you help me to pass env.sample ? i am still getting this Issue

MatheusDeAquino commented 5 years ago

Can you share the resolution?