watson-developer-cloud / botkit-middleware

A middleware to connect Watson Conversation Service to different chat channels using Botkit
https://www.npmjs.com/package/botkit-middleware-watson
Apache License 2.0
206 stars 255 forks source link

How to deploy it to w3ibm.bluemix.net? #148

Closed luizj-ibm closed 5 years ago

luizj-ibm commented 6 years ago

Hello, I have a basic chatbot working fine with Watson Assistant so I have tested this botkit-middleware by modifying simple-bot/.env file using my credentials.

It worked fine and I was able to communicate with bot through Slack tool.

However, in order to keep the bot available on slack I will need to keep my machine up since it remains running locally. How can I have it running on w3ibm.bluemix.net instead?

Thank you!

mitchmason commented 6 years ago

I believe that is the internal instance of Bluemix, which you would have to get your specific documentation for the internal version. Here are the docs for pushing an app to the public version of Bluemix, I assume internal will be quite similar with possibly different endpoints. https://console.bluemix.net/docs/starters/upload_app.html

luizj-ibm commented 6 years ago

Hello Mitchell, tks for helping!

I followed the steps to deploy it using "ibmcloud app push" command according to the docs, I just had to change the API addresses to redirect to private bluemix. However the process fails when "Waiting for app to start".

-----> Installing App Management Checking for Dynatrace credentials No Dynatrace Service Found (service with substring dynatrace not found in VCAP_SERVICES) -----> Caching build Clearing previous node cache Saving 2 cacheDirectories (default):

  • node_modules
  • bower_components (nothing to cache) -----> Build succeeded! ├── @types/bluebird@3.5.24 ├── bluebird@3.5.2 ├── debug@3.2.6 ├── deepmerge@2.2.1 └── watson-developer-cloud@3.13.0

    Exit status 0 Staging complete Uploading droplet, build artifacts cache... Uploading build artifacts cache... Uploading droplet...

Waiting for app to start... Start unsuccessful

Tried this via CLI as a workaround since I had deployed it previously via "SDK for Node.js" service on bluemix but I'm still getting exactly the same error:

Process has crashed with type: "web"

App instance exited with guid dea2cbc6-e3f3-4c77-b071-0b93bdc2dcd9 payload: {"instance"=>"bf22c490-bf33-42f1-7c64-4973", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n 2 error(s) occurred:\n\n Codependent step exited\n cancelled\n cancelled", "crash_count"=>6, "crash_timestamp"=>1540939291458945292, "version"=>"d9422809-b666-4355-af9e-2f4f15ecee57"}

Do you know how to fix this?

mitchmason commented 6 years ago

It’s hard to say those errors aren’t super clear... When you go to your bluemix dashboard you should now see an app, it will just say it’s offline. If you click from there to start it you may get a more clear reason why it couldn’t start

luizj-ibm commented 5 years ago

Hello Mitchell, I appreciate your help.

Even when starting the app through dashboard I was receiving exactly the same error. I guess the key words were "Codependent step exited".

Just figured out it's mandatory to specify the startup command when deploying to bluemix. It's working as expected now.

Thank you.