IBM-Cloud / openwhisk-slackapp

A serverless Slack app built with Slack Events API and IBM Cloud Functions
Other
27 stars 28 forks source link

Activation failed with error description Error team not found #13

Closed nddao closed 3 years ago

nddao commented 5 years ago

Following the steps, I am able to deploy a slack app, and there is a document in the database registrations->_design/bots as { "_id": "_design/bots", "_rev": "3-55382d5d47149be82319e8c7730a1d2d", "views": { "by_team_id": { "map": "function (doc) {\n if (doc.type == \"bot-registration\") {\n emit(doc._id, 1);\n }\n}" } }, "language": "javascript" }

But it always return "Error team not found" Is there anything in the registration database that I should change?

Here is the log

Activation: 'slackapp-event' (17c8dad1151845a588dad1151885a5fd) [ "2019-02-26T22:41:55.43472832Z stdout: Processing new bot event from Slack { ow_headers:", "2019-02-26T22:41:55.434810537Z stdout: { accept: '/',", "2019-02-26T22:41:55.434817478Z stdout: 'accept-encoding': 'gzip',", "2019-02-26T22:41:55.43482215Z stdout: 'cdn-loop': 'cloudflare',", "2019-02-26T22:41:55.434826601Z stdout: 'cf-connecting-ip': '3.89.65.30',", "2019-02-26T22:41:55.434831127Z stdout: 'cf-ipcountry': 'US',", "2019-02-26T22:41:55.434835414Z stdout: 'cf-ray': '4af5ebff38849f3c-IAD',", "2019-02-26T22:41:55.434839717Z stdout: 'cf-visitor': '{\"scheme\":\"https\"}',", "2019-02-26T22:41:55.434844414Z stdout: 'content-type': 'application/json',", "2019-02-26T22:41:55.434848786Z stdout: host: 'openwhisk.ng.bluemix.net',", "2019-02-26T22:41:55.434853986Z stdout: 'user-agent': 'Slackbot 1.0 (+https://api.slack.com/robots)',", "2019-02-26T22:41:55.434858483Z stdout: 'x-forwarded-for': '3.89.65.30, 172.68.65.86',", "2019-02-26T22:41:55.434862794Z stdout: 'x-forwarded-host': 'openwhisk.ng.bluemix.net',", "2019-02-26T22:41:55.434867232Z stdout: 'x-forwarded-port': '443',", "2019-02-26T22:41:55.434871508Z stdout: 'x-forwarded-proto': 'https',", "2019-02-26T22:41:55.434875877Z stdout: 'x-global-k8fdic-transaction-id': '3584c7454327364077d9050ad2535111',", "2019-02-26T22:41:55.434884933Z stdout: 'x-real-ip': '172.68.65.86',", "2019-02-26T22:41:55.434889363Z stdout: 'x-request-id': '3584c7454327364077d9050ad2535111',", "2019-02-26T22:41:55.434893757Z stdout: 'x-slack-request-timestamp': '1551220915',", "2019-02-26T22:41:55.434898151Z stdout: 'x-slack-signature': 'v0=2341af05c2e342e66a3783ac58f8bbb83be53b8a4d9d332b9376b45d8fe1f7bf' },", "2019-02-26T22:41:55.434903006Z stdout: __ow_method: 'post',", "2019-02-26T22:41:55.434907307Z stdout: ow_path: '',", "2019-02-26T22:41:55.434928786Z stdout: api_app_id: 'ACC4UMYG1',", "2019-02-26T22:41:55.434933929Z stdout: authed_teams: [ 'T08LVDR7Y' ],", "2019-02-26T22:41:55.434938302Z stdout: authed_users: [ 'WCHTQEZND' ],", "2019-02-26T22:41:55.43494266Z stdout: cloudantDb: 'registrations',", "2019-02-26T22:41:55.434947235Z stdout: cloudantUrl: 'https://86107998-b2e1-45cc-b98d-42f20cdcdfec-bluemix:5b11aa19dacdf145dc96316765e0fb756b3bf42e3ced0faa2d05d991a1c5109e@86107998-b2e1-45cc-b98d-42f20cdcdfec-bluemix.cloudantnosqldb.appdomain.cloud',", "2019-02-26T22:41:55.434952094Z stdout: enterprise_id: 'E27SFGS2W',", "2019-02-26T22:41:55.434956374Z stdout: event:", "2019-02-26T22:41:55.434960696Z stdout: { channel: 'DCJ8YCUJY',", "2019-02-26T22:41:55.434964921Z stdout: channel_type: 'im',", "2019-02-26T22:41:55.434969274Z stdout: client_msg_id: '60e0566e-d407-46cb-b6be-2cde42d1285c',", "2019-02-26T22:41:55.434973727Z stdout: event_ts: '1551220914.001700',", "2019-02-26T22:41:55.434978178Z stdout: team: 'T08LVDR7Y',", "2019-02-26T22:41:55.434982631Z stdout: text: 'hello_direct v11',", "2019-02-26T22:41:55.43498697Z stdout: ts: '1551220914.001700',", "2019-02-26T22:41:55.434991191Z stdout: type: 'message',", "2019-02-26T22:41:55.435000115Z stdout: user: 'W4V5HF57Y' },", "2019-02-26T22:41:55.435004595Z stdout: event_id: 'EvGJ248C3F',", "2019-02-26T22:41:55.435008831Z stdout: event_time: 1551220914,", "2019-02-26T22:41:55.435013202Z stdout: slackClientId: 8709467270.420164,", "2019-02-26T22:41:55.435017578Z stdout: slackClientSecret: '6d696fa649fcbef2774821133b5b4829',", "2019-02-26T22:41:55.435022043Z stdout: slackVerificationToken: 'QDfaWXhVbrgWvELHf1qAVzWx',", "2019-02-26T22:41:55.435026441Z stdout: team_id: 'T08LVDR7Y',", "2019-02-26T22:41:55.435030828Z stdout: token: 'QDfaWXhVbrgWvELHf1qAVzWx',", "2019-02-26T22:41:55.435035201Z stdout: type: 'event_callback' }", "2019-02-26T22:41:55.57468391Z stdout: Looking up bot info for team T08LVDR7Y", "2019-02-26T22:41:55.65639819Z stdout: Error team not found" ]

ktsuench commented 4 years ago

You just need to register the app by going to Settings > Basic Information > Managing Distribution section clicking on the Distribute App button which should show the next section with the Add to Slack button. Once you click that button you should see a blank screen with the message:

Registration was successful. You can try the command in Slack or send a direct message to the bot.