Botpress unexpectedly looking for welcome-bot and failing

Hello,

I am facing this wierd issue (probably my mistake somewhere), and I am stuck and I dont know how to fix this. Botpress version v11.8. Node version 10.15.3

I had a working bot, and I was experimenting with embedding it on a webpage following the instructions here: https://botpress.io/docs/tutorials/

My bot is successfully embedded on the page. The issue is that it keeps on throwing an Unhandled rejection by the launcher. While debugging the logs here is the sketchy part:

bp:api:request /api/v1/bots/firstbot/mod/channel-web/conversations/mlGVR0CQqFy425KEYLj9U { method: ‘GET’, ip: ‘::1’, originalUrl: ‘/api/v1/bots/firstbot/mod/channel-web/conversations/mlGVR0CQqFy425KEYLj9U’ } +502ms

bp:api:request /api/v1/bots/firstbot/mod/channel-web/conversations/mlGVR0CQqFy425KEYLj9U/4 { method: ‘GET’, ip: ‘::1’, originalUrl: ‘/api/v1/bots/firstbot/mod/channel-web/conversations/mlGVR0CQqFy425KEYLj9U/4’ } +9ms

bp:api:request /api/v1/bots/welcome-bot/mod/channel-web/conversations/mlGVR0CQqFy425KEYLj9U { method: ‘GET’, ip: ‘::1’, originalUrl: ‘/api/v1/bots/welcome-bot/mod/channel-web/conversations/mlGVR0CQqFy425KEYLj9U’ } +6s

16:15:32.149 Launcher Unhandled Rejection [VError, Error reading configuration file “bot.config.json”: ENOENT: no such file or directory, open ‘/Documents/Work/botpress/data/bots/welcome-bot/bot.config.json’]

I have no idea why its looking for welcome-bot. There is no such bot, and its bound to fail. This request keeps throwing an exception, and eventually my bot becomes unresponsive. This issue can be reproduced on the webpage as well as emulator from the studio, so my guess is that it has nothing to do with the webpage.

Looking for some help,

Thanks & regards,
Nishant

EDIT: here is the stacktrace:

2:28:03.237 Launcher Unhandled Rejection [VError, Error reading configuration file “bot.config.json”: ENOENT: no such file or directory, open ‘/Users/nishant/Documents/Work/botpress/data/bots/welcome-bot/bot.config.json’]
STACK TRACE
VError: Error reading configuration file “bot.config.json”: ENOENT: no such file or directory, open ‘/Users/nishant/Documents/Work/botpress/data/bots/welcome-bot/bot.config.json’
at ConfigProvider. (/snapshot/build-mac/out/bp/core/config/config-loader.js:0:0)
at Generator.throw ()
at rejected (/snapshot/build-mac/out/bp/core/config/config-loader.js:0:0)
at tryCatcher (/Users/nishant/Documents/Work/botpress/modules/.cache/module__6816bc6542284a05877cbc1d9f9a2e31b39e0d0ba3e6cce4bd0d01d4e72e0e46/node_production_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/nishant/Documents/Work/botpress/modules/.cache/module__6816bc6542284a05877cbc1d9f9a2e31b39e0d0ba3e6cce4bd0d01d4e72e0e46/node_production_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Users/nishant/Documents/Work/botpress/modules/.cache/module__6816bc6542284a05877cbc1d9f9a2e31b39e0d0ba3e6cce4bd0d01d4e72e0e46/node_production_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Users/nishant/Documents/Work/botpress/modules/.cache/module__6816bc6542284a05877cbc1d9f9a2e31b39e0d0ba3e6cce4bd0d01d4e72e0e46/node_production_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Users/nishant/Documents/Work/botpress/modules/.cache/module__6816bc6542284a05877cbc1d9f9a2e31b39e0d0ba3e6cce4bd0d01d4e72e0e46/node_production_modules/bluebird/js/release/promise.js:690:18)
at _drainQueueStep (/Users/nishant/Documents/Work/botpress/modules/.cache/module__6816bc6542284a05877cbc1d9f9a2e31b39e0d0ba3e6cce4bd0d01d4e72e0e46/node_production_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/Users/nishant/Documents/Work/botpress/modules/.cache/module__6816bc6542284a05877cbc1d9f9a2e31b39e0d0ba3e6cce4bd0d01d4e72e0e46/node_production_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/Users/nishant/Documents/Work/botpress/modules/.cache/module__6816bc6542284a05877cbc1d9f9a2e31b39e0d0ba3e6cce4bd0d01d4e72e0e46/node_production_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/nishant/Documents/Work/botpress/modules/.cache/module__6816bc6542284a05877cbc1d9f9a2e31b39e0d0ba3e6cce4bd0d01d4e72e0e46/node_production_modules/bluebird/js/release/async.js:17: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)

I have also tried a fresh installation of botpress binary. Still the same issue, irrespective of whether I am using the emulator, or embedding my bot on a webpage.

why is botpress looking for welcome-bot directory?

How do I debug botpress core?

Looks like it was a caching problem. Clearing my cache seems to have worked for now. Thanks.

I was about to ask if welcome-bot was present in /data/global/workspaces.json. Please let us know if you experience this again. Caching should not cause problem.

No welcome-bot reference in workspaces.json.

I have the same issue, except that clearing the cache did not fix it. In my case, I added an externalUrl property to the botpress.config.json, and that broke my bot.

Hi everybody,

I had a similar issue, which occurred always as soon as I opened any chat, i.e. emulator and embedded web chat. It started to occur after I migrated and renamed the bot between versions using the migration tool in the admin panel.
The issue was, that the paths within bot.config.json were not updated to the new bot name. Doing so manually resolved the issue. If this turns out to be a general issue, this might be worth addressing in an update.

It is not exactly the same problem as in the title, but as google search brought me here - I feel this might be right place to leave my solution.

Hope this helps someone!

@friedrich thanks a lot for your feedback.

If you could provide steps of how to reproduce this path issue of bot.json.json, it would be appreciated, as a fix could be implemented.

In other words, from which Botpress version to which version did you upgrade your bot?

Sure:

  1. I upgraded from 12.2.0 to 12.3.0 and used the zipping function to migrate my bot.
  2. When unpacking I renamed the file differently than it was called before.
  3. The bot was no longer able to show the avatar picture in my case and gave me the following error:

Launcher: Unhandled Rejection [VError, Error reading configuration file “bot.config.json”: ENOENT: no such file or directory, open ‘/Users/williamfriedrichjoseph/Desktop/Botpress/botpress-v12_3_0-darwin-x64/data/bots/test/bot.config.json’]

STACK TRACE

VError: Error reading configuration file “bot.config.json”: ENOENT: no such file or directory, open ‘/Users/williamfriedrichjoseph/Desktop/Botpress/botpress-v12_3_0-darwin-x64/data/bots/test/bot.config.json’

  1. Eventually, it turned out that the path for the pictures in bot.config.json was not updated to the new name:


“details”: {
“avatarUrl”: “/api/v1/bots/oldBotID/media/…”,

  1. After manually correcting this, the bot works fine again.

Hope this is helpful and can be fixed

Hi @friedrich,

I tried but couldn’t reproduce the issue, could you explain what is meant by “when unpacking I rename to file”?

I tried the following steps:

  • Use 12.2.0 to create a bot (named abc from 12.2.0 with id abc-from-1220) with avatar and cover picture
  • Export the bot
  • Exported file has name of bot_abc-from-1220_1579510691117.tgz
  • Rename the file by adding x after the version to e.g. bot_abc-from-1220x_1579510691117.tgz
  • Import the bot in 12.3.0
  • Check the bot avatar and picture, they are shown

@asashour
Sorry I was not precise enough:
I renamed not the zipped file itself, but chose a different BotID only in the import user interface, while uploading the unchanged file with the existing BotID. Like this:

Bot ID: newBotID
Bot Archive: oldBotID.tgz

Let me know if this happens for you as well.

@friedrich

Well, it is fine with me when also changing the Bot ID in the UI.

@asashour
Strange, I just again replicated the problem locally like this:

@friedrich

The issue would be more valuable if it happens against the latest version.

I would suggest you try it with 12.4.0, and provide your OS/Browser/Node version, so we can take it further.

Preferably in a new thread, so we don’t hijack the thread for long time.

Also, why it is .zip, not tgz?

hello , how to clear caching in botpress . i aslo face like this . Help me pls.