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

Callback function "uploadDocumentAsync" timed out. #43

Closed dhudsmith closed 6 years ago

dhudsmith commented 6 years ago

I have followed the steps in the readme up to npm run train.

When executing the train command, the step of uploading documents to Watson Discovery is not working for me. I get the error Error: Callback function "uploadDocumentAsync" timed out. See attached full console output.

npm_run_train.log

The script does successfully create the Discovery container "demoCollection", but none of the documents are uploaded into it.

Any ideas why the upload would be timing out? I don't know where to start. Let me know if you need more info. Thanks!

germanattanasio commented 6 years ago

Did you try running it again? It should reuse the already created assets and upload the documents.

dhudsmith commented 6 years ago

I have tried several times - same result. The app does reuse the previously created "demoCollection" but, each time, the documents failed to upload with the timeout error.

dhudsmith commented 6 years ago

Drilling down into the code, the async call (line 129 in train-discovery.js) in is timing out:

var uploadDocumentAsync = function(params, cb) {
  return async.retry(retryOptions, discoveryV1.addDocument.bind(discoveryV1, {
    environment_id: `${params.env_id}`,
    collection_id: `${params.collection_id}`,
    file: params.file,
    configuration_id: `${params.config_id}`,
  }), cb);
};

I have confirmed that env_id, collection_id, and config_id being passed to discovery addDocument match those that I can find in the Watson Discovery console for the already created "demoCollection".

Any thoughts about why this might be timing out?

mamoonraja commented 6 years ago

Looks like a network issue, can you still re-generate the error?

byrne-greg commented 6 years ago

I encountered the same issue as above today. (snippet below is using asterisks to mask the path to the repo on local machine)

Workspace exists
Creating environment
Environment already exists, Using Environment demoEnvironment
Creating configuration
Configuration already exists, Using configuration Default Configuration
Creating a collection
Collection already exists, Using collection demoCollection
Uploading documents
manualdocs/manual_0.json { Error: Callback function "uploadDocumentAsync" timed out.
    at Timeout.timeoutCallback [as _onTimeout] (/**/*/WatsonAssistantWithDiscoveryOpenWhisk/node_modules/async/dist/async.js:4916:26)
    at ontimeout (timers.js:458:11)
    at tryOnTimeout (timers.js:296:5)
    at Timer.listOnTimeout (timers.js:259:5) code: 'ETIMEDOUT' }

Update: Uploading the files manually and received the following image

byrne-greg commented 6 years ago

This should now be resolved

dhudsmith commented 6 years ago

Thanks @byrne-greg!