Cannot Mount Bot - Request failed with status code 400

Hello everyone,

Can anyone help?

After I configured the bot’s channel-messenger, defining the scheme, appSecret and accessToken, I received an error when mount the bot:

** BotService Cannot mount bot “zordon” [Error, while mounting bot in module channel-messenger: Error: Request failed with status code 400]**

My /home/douglas.guerreiro/botpress-v12_9_3-linux-x64/data/bots//config/channel-messenger.json

{
“$schema”: “…/…/…/assets/modules/channel-messenger/config.schema.json”,
“enabled”: true,
“appSecret”: “”",
“verifyToken”: “”",
“accessToken”: “”,
“persistentMenu”: [],
“chatUserAuthDuration”: “24h”
}

My /home/douglas.guerreiro/botpress-v12_9_3-linux-x64/data/global/config/channel-messenger.json

{
“$schema”: “…/…/assets/modules/channel-messenger/config.schema.json”,
“enabled”: true,
“appSecret”: “”,
“verifyToken”: “”,
“persistentMenu”: [],
“chatUserAuthDuration”: “24h”
}

Montagem do bot:

lete (fs.js:185:5)
07/27/2020 13:04:37.778 Launcher ========================================
Botpress Server
Version 12.9.3
OS linux ubuntu
========================================
07/27/2020 13:04:37.779 Launcher App Data Dir: “/home/douglas.guerreiro/botpress”
07/27/2020 13:04:37.780 Launcher Using 15 modules
⦿ analytics
⦿ basic-skills
⦿ builtin
⦿ channel-messenger
⦿ channel-web
⦿ code-editor
⦿ examples
⦿ extensions
⦿ hitl
⦿ misunderstood
⦿ nlu-extras
⦿ nlu
⦿ qna
⦿ testing
⦿ uipath
⊝ bot-improvement (disabled)
⊝ channel-slack (disabled)
⊝ channel-smooch (disabled)
⊝ channel-teams (disabled)
⊝ channel-telegram (disabled)
⊝ ndu (disabled)
⊝ nlu-testing (disabled)
07/27/2020 13:04:37.781 Server Running in DEVELOPMENT MODE
07/27/2020 13:04:39.697 Server Loaded 15 modules
07/27/2020 13:04:39.735 CMS Loaded 7 content types
07/27/2020 13:04:40.042 Server Discovered 1 bot, mounting it…
07/27/2020 13:04:40.044 Mod[channel-messenger] Messenger Webhook URL is https://b279b28347ab.ngrok.io/api/v1/bots/___/mod/channel-messenger/webhook
07/27/2020 13:04:40.286 BotService Cannot mount bot “zordon” [Error, while mounting bot in module channel-messenger: Error: Request failed with status code 400]
STACK TRACE
Error: while mounting bot in module channel-messenger: Error: Request failed with status code 400
at ModuleLoader. (/snapshot/build-linux/out/bp/core/module-loader.js:0:0)
at Generator.throw ()
at rejected (/snapshot/build-linux/out/bp/core/module-loader.js:0:0)
at tryCatcher (/home/douglas.guerreiro/botpress-v12_9_3-linux-x64/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/douglas.guerreiro/botpress-v12_9_3-linux-x64/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/home/douglas.guerreiro/botpress-v12_9_3-linux-x64/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/home/douglas.guerreiro/botpress-v12_9_3-linux-x64/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/home/douglas.guerreiro/botpress-v12_9_3-linux-x64/node_modules/bluebird/js/release/promise.js:725:18)
at _drainQueueStep (/home/douglas.guerreiro/botpress-v12_9_3-linux-x64/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/home/douglas.guerreiro/botpress-v12_9_3-linux-x64/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/home/douglas.guerreiro/botpress-v12_9_3-linux-x64/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/home/douglas.guerreiro/botpress-v12_9_3-linux-x64/node_modules/bluebird/js/release/async.js:15:14)
at runCallback (timers.js:696:18)
at tryOnImmediate (timers.js:667:5)
at processImmediate (timers.js:649:5)
at process.topLevelDomainCallback (domain.js:121:23)
07/27/2020 13:04:40.287 Server Local Action Server will only run in experimental mode
07/27/2020 13:04:40.297 Server Started in 2516ms
07/27/2020 13:04:40.297 Launcher Botpress is listening at: http://localhost:3000
07/27/2020 13:04:40.298 Launcher Botpress is exposed at: https://.ngrok.io/

Hi @Douglas_Guerreiro,

Did you add a third dot there between all slashes on purpose?

There should only be two, as these are accessing parent folders. This may be why you are getting a 400 bad request error?

Hi @Douglas_Guerreiro,

Did you resolve this issue with Messenger?
Something you could try is to unpublish your bot (disable), restart the server with the Messenger channel enabled, then once Botpress is started, re-enable your bot.

Let me know if that works for you.

Hello guys,
I redid the setup and it worked perfectly.
The problem was in the schema path! :grin:

Thanks a lot!

1 Like