Highlighted
Super Contributor.
Super Contributor.
428 views

Error starting the SMAX-ChatOps-bot service

Hello,

I'm trying to set up the SMAX ChatOps bot on a CentOS server, when I start the service I get the following error message and the service fails. The log output and Slack environment configuration are appended to this post.

Any insight on what the line "Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: 2019-03-13T13:32:56.404Z - error: AssertionError: Expected 1 elements matching "#oauth_authorizify", found 0" from the log means?

Thank you,
Gard

 

Slack environment configuration:

HUBOT_ADAPTER=unified_slack
HUBOT_NAME=SmaxBot
HUBOT_REST_API_USERNAME=smaxbot
HUBOT_REST_API_PASSWORD=<base64 client secret>
OPTION_OF_CERTIFICATE=1
CERTIFICATE_PATH=/etc/opt/microfocus/SMAX-ChatOps-bot/certs/cert.pem
PRIVATE_KEY_PATH=/etc/opt/microfocus/SMAX-ChatOps-bot/certs/key.pem
HUBOT_UNIFIED_SERVER_PORT=3000
HUBOT_LOGIN_SERVER_ENDPOINT=https://n-p-gw-02.meno.lokal:3100
HUBOT_SLACK_APP_CLIENT_ID=<app client id>
HUBOT_SLACK_APP_SECRET=<client secret>
HUBOT_SLACK_OAUTH2_WEBSERVER_HOSTNAME=n-p-gw-02.meno.lokal
HUBOT_SLACK_OAUTH2_WEBSERVER_PORT=1098
HUBOT_SLACK_APP_TEAM_NAME=manag-e.slack.com
HUBOT_SLACK_APP_TEAM_USERNAME=smaxbot
HUBOT_SLACK_OAUTH2_DELAY=1000
HUBOT_SLACK_OAUTH2_AUTOMATION_TIMEOUT=300000
HUBOT_SLACK_APP_TEAM_USERPASS=<base64 client secret>

Log output:

Mar 13 14:32:44 n-p-gw-02.meno.lokal systemd[1]: Started ChatOpts bot service.
Mar 13 14:32:44 n-p-gw-02.meno.lokal run.sh[19564]: -----------------------------------------------------------
Mar 13 14:32:44 n-p-gw-02.meno.lokal run.sh[19564]: ChatOps run script
Mar 13 14:32:44 n-p-gw-02.meno.lokal run.sh[19564]: -----------------------------------------------------------
Mar 13 14:32:44 n-p-gw-02.meno.lokal run.sh[19564]: Set Node env ...
Mar 13 14:32:44 n-p-gw-02.meno.lokal run.sh[19564]: CHAT_PLATFORM_OPTION: slack
Mar 13 14:32:44 n-p-gw-02.meno.lokal run.sh[19564]: Set proxy ...
Mar 13 14:32:44 n-p-gw-02.meno.lokal run.sh[19564]: Set npm proxy ...
Mar 13 14:32:44 n-p-gw-02.meno.lokal run.sh[19564]: Set configuration for production ...
Mar 13 14:32:44 n-p-gw-02.meno.lokal run.sh[19564]: Verify user ...
Mar 13 14:32:47 n-p-gw-02.meno.lokal run.sh[19564]: 2019-03-13T13:32:47.073Z - info: Start installing Slack APP....
Mar 13 14:32:47 n-p-gw-02.meno.lokal run.sh[19564]: info: ** Using simple storage. Saving data to /etc/opt/microfocus/SMAX-ChatOps-bot/config/slack_app_db/
Mar 13 14:32:47 n-p-gw-02.meno.lokal run.sh[19564]: info: ** Setting up custom handlers for processing Slack messages
Mar 13 14:32:47 n-p-gw-02.meno.lokal run.sh[19564]: info: ** Configuring app as a Slack App!
Mar 13 14:32:47 n-p-gw-02.meno.lokal run.sh[19564]: info: ** Starting webserver on port 1098
Mar 13 14:32:47 n-p-gw-02.meno.lokal run.sh[19564]: info: ** Serving login URL: http://0.0.0.0:1098/login
Mar 13 14:32:47 n-p-gw-02.meno.lokal run.sh[19564]: info: ** Serving oauth return endpoint: http://0.0.0.0:1098/oauth
Mar 13 14:32:47 n-p-gw-02.meno.lokal run.sh[19564]: 2019-03-13T13:32:47.128Z - info: Authorizing app SmaxBot with user smaxbot to team manag-e.slack.com.
Mar 13 14:32:47 n-p-gw-02.meno.lokal run.sh[19564]: 2019-03-13T13:32:47.128Z - info: Running automated oauth flow. Please wait, this could take a while...
Mar 13 14:32:50 n-p-gw-02.meno.lokal run.sh[19564]: 2019-03-13T13:32:50.704Z - info: Successfully redirected to slack oauth flow.
Mar 13 14:32:53 n-p-gw-02.meno.lokal run.sh[19564]: 2019-03-13T13:32:53.467Z - info: Successfully entered team domain manag-e.slack.com
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: 2019-03-13T13:32:56.385Z - error: Sign in to http://n-p-gw-02.meno.lokal:1098 was not successful.
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: 2019-03-13T13:32:56.403Z - error: Could not authorize permissions to app SmaxBot on behalf of user smaxbot of team manag-e.slack.com
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: 2019-03-13T13:32:56.404Z - error: AssertionError: Expected 1 elements matching "#oauth_authorizify", found 0
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at Assert.elements (/opt/microfocus/SMAX-ChatOps-bot/node_modules/zombie/lib/assert.js:154:54)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at Assert.element (/opt/microfocus/SMAX-ChatOps-bot/node_modules/zombie/lib/assert.js:138:12)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at browser.visit.then.then.then.then.then.e (/opt/microfocus/SMAX-ChatOps-bot/lib/adapters/slack/slack_oauth_flow.js:106:26)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at tryCatcher (/opt/microfocus/SMAX-ChatOps-bot/node_modules/bluebird/js/release/util.js:16:23)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at Promise._settlePromiseFromHandler (/opt/microfocus/SMAX-ChatOps-bot/node_modules/bluebird/js/release/promise.js:512:31)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at Promise._settlePromise (/opt/microfocus/SMAX-ChatOps-bot/node_modules/bluebird/js/release/promise.js:569:18)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at Promise._settlePromise0 (/opt/microfocus/SMAX-ChatOps-bot/node_modules/bluebird/js/release/promise.js:614:10)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at Promise._settlePromises (/opt/microfocus/SMAX-ChatOps-bot/node_modules/bluebird/js/release/promise.js:693:18)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at Async._drainQueue (/opt/microfocus/SMAX-ChatOps-bot/node_modules/bluebird/js/release/async.js:133:16)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at Async._drainQueues (/opt/microfocus/SMAX-ChatOps-bot/node_modules/bluebird/js/release/async.js:143:10)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at Immediate.Async.drainQueues (/opt/microfocus/SMAX-ChatOps-bot/node_modules/bluebird/js/release/async.js:17:14)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at runCallback (timers.js:672:20)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at tryOnImmediate (timers.js:645:5)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: at processImmediate [as _immediateCallback] (timers.js:617:5)
Mar 13 14:32:56 n-p-gw-02.meno.lokal run.sh[19564]: 2019-03-13T13:32:56.405Z - error: An error occurred retrieving slack app tokens. Exiting...
Mar 13 14:32:56 n-p-gw-02.meno.lokal systemd[1]: SMAX-ChatOps-bot.service: main process exited, code=exited, status=1/FAILURE
Mar 13 14:32:56 n-p-gw-02.meno.lokal systemd[1]: Unit SMAX-ChatOps-bot.service entered failed state.
Mar 13 14:32:56 n-p-gw-02.meno.lokal systemd[1]: SMAX-ChatOps-bot.service failed.

0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.