Botpress on heroku

hi all
i deploy botpress on heroku app with database postgresql after while server sleep i cause this issue
i have to reset the database and restart the server to work agian
botpress v 12.1.6

Hey @mahmoudeldawy !

Can you send server logs? This would help diagnose the issue.

2019-10-31T13:05:07.794366+00:00 heroku[web.1]: State changed from up to starting
2019-10-31T13:05:09.282613+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2019-10-31T13:05:09.483622+00:00 heroku[web.1]: Process exited with status 143
2019-10-31T13:05:24.241648+00:00 heroku[web.1]: Starting process with command `./bp`
2019-10-31T13:05:31.789667+00:00 heroku[web.1]: State changed from starting to up
2019-10-31T13:05:31.275023+00:00 app[web.1]: 09:05:31.274 CMS Loaded 7 content types
2019-10-31T13:05:28.660082+00:00 app[web.1]: 09:05:28.657 Launcher ========================================
2019-10-31T13:05:28.660104+00:00 app[web.1]:                                   Botpress Server            
2019-10-31T13:05:28.660107+00:00 app[web.1]:                                    Version 12.1.6             
2019-10-31T13:05:28.660109+00:00 app[web.1]:                                OS linux ubuntu_18_04         
2019-10-31T13:05:28.660111+00:00 app[web.1]:                       ========================================
2019-10-31T13:05:28.661389+00:00 app[web.1]: 09:05:28.660 Launcher App Data Dir: "/botpress/botpress"
2019-10-31T13:05:30.288815+00:00 app[web.1]: 09:05:30.287 Launcher Using 10 modules
2019-10-31T13:05:30.288852+00:00 app[web.1]:                       ⦿ MODULES_ROOT/analytics
2019-10-31T13:05:30.288853+00:00 app[web.1]:                       ⦿ MODULES_ROOT/basic-skills
2019-10-31T13:05:30.288855+00:00 app[web.1]:                       ⦿ MODULES_ROOT/builtin
2019-10-31T13:05:30.288857+00:00 app[web.1]:                       ⊝ MODULES_ROOT/channel-messenger (disabled)
2019-10-31T13:05:30.288859+00:00 app[web.1]:                       ⊝ MODULES_ROOT/channel-slack (disabled)
2019-10-31T13:05:30.28886+00:00 app[web.1]:                       ⊝ MODULES_ROOT/channel-teams (disabled)
2019-10-31T13:05:30.288865+00:00 app[web.1]:                       ⊝ MODULES_ROOT/channel-telegram (disabled)
2019-10-31T13:05:30.288866+00:00 app[web.1]:                       ⦿ MODULES_ROOT/channel-web
2019-10-31T13:05:30.288868+00:00 app[web.1]:                       ⦿ MODULES_ROOT/code-editor
2019-10-31T13:05:30.28887+00:00 app[web.1]:                       ⦿ MODULES_ROOT/examples
2019-10-31T13:05:30.288871+00:00 app[web.1]:                       ⦿ MODULES_ROOT/extensions
2019-10-31T13:05:30.288873+00:00 app[web.1]:                       ⊝ MODULES_ROOT/hitl (disabled)
2019-10-31T13:05:30.288874+00:00 app[web.1]:                       ⦿ MODULES_ROOT/nlu
2019-10-31T13:05:30.288876+00:00 app[web.1]:                       ⦿ MODULES_ROOT/qna
2019-10-31T13:05:30.288877+00:00 app[web.1]:                       ⦿ MODULES_ROOT/testing
2019-10-31T13:05:30.331053+00:00 app[web.1]: 09:05:30.330 Server JWT Secret isn't defined. Generating a random key...
2019-10-31T13:05:30.3495+00:00 app[web.1]: 09:05:30.349 ModuleLoader Added missing "analytics.json" configuration file
2019-10-31T13:05:30.35459+00:00 app[web.1]: 09:05:30.354 ModuleLoader Added missing "basic-skills.json" configuration file
2019-10-31T13:05:30.356832+00:00 app[web.1]: 09:05:30.356 ModuleLoader Added missing "builtin.json" configuration file
2019-10-31T13:05:30.35911+00:00 app[web.1]: 09:05:30.358 ModuleLoader Added missing "channel-web.json" configuration file
2019-10-31T13:05:30.361163+00:00 app[web.1]: 09:05:30.360 ModuleLoader Added missing "code-editor.json" configuration file
2019-10-31T13:05:30.363321+00:00 app[web.1]: 09:05:30.363 ModuleLoader Added missing "examples.json" configuration file
2019-10-31T13:05:30.365637+00:00 app[web.1]: 09:05:30.365 ModuleLoader Added missing "extensions.json" configuration file
2019-10-31T13:05:30.368456+00:00 app[web.1]: 09:05:30.368 ModuleLoader Added missing "nlu.json" configuration file
2019-10-31T13:05:30.370822+00:00 app[web.1]: 09:05:30.370 ModuleLoader Added missing "qna.json" configuration file
2019-10-31T13:05:30.373062+00:00 app[web.1]: 09:05:30.372 ModuleLoader Added missing "testing.json" configuration file
2019-10-31T13:05:31.001731+00:00 app[web.1]: 09:05:31.000 Mod[nlu] Couldn't reach the Duckling server , so it will be disabled.
2019-10-31T13:05:31.001755+00:00 app[web.1]:                       For more informations (or if you want to self-host it), please check the docs at
2019-10-31T13:05:31.001757+00:00 app[web.1]:                       https://botpress.io/docs/build/nlu/#system-entities
2019-10-31T13:05:31.001759+00:00 app[web.1]:                        [Error, connect ECONNREFUSED 127.0.0.1:8000]
2019-10-31T13:05:31.001761+00:00 app[web.1]: STACK TRACE
2019-10-31T13:05:31.001763+00:00 app[web.1]: Error: connect ECONNREFUSED 127.0.0.1:8000
2019-10-31T13:05:31.001765+00:00 app[web.1]:     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1158:14)
2019-10-31T13:05:31.193414+00:00 app[web.1]: 09:05:31.193 Server Loaded 10 modules
2019-10-31T13:05:31.246354+00:00 app[web.1]: 09:05:31.245 WorkspaceService Created workspace
2019-10-31T13:05:31.539498+00:00 app[web.1]: 09:05:31.539 HTTP External URL is not configured. Using default value of http://localhost:28409. Some features may not work properly
2019-10-31T13:05:31.546128+00:00 app[web.1]: 09:05:31.545 Server Started in 1257ms
2019-10-31T13:05:31.546688+00:00 app[web.1]: 09:05:31.546 Launcher Botpress is ready at http://localhost:28409
2019-10-31T13:05:33.348848+00:00 heroku[router]: at=info method=GET path="/admin/static/css/2.ad0782f0.chunk.css" host=mighty-dawn-15611.herokuapp.com request_id=b9b6d7a3-0ab8-4573-a6ee-69c81ab2a769 fwd="156.204.110.108" dyno=web.1 connect=1ms service=15ms status=200 bytes=270721 protocol=https
2019-10-31T13:05:34.233846+00:00 heroku[router]: at=info method=GET path="/admin/static/js/main.aaa327be.chunk.js" host=mighty-dawn-15611.herokuapp.com request_id=6423c33d-af21-4484-914b-b5f49ebe7c71 fwd="156.204.110.108" dyno=web.1 connect=0ms service=8ms status=200 bytes=177902 protocol=https
2019-10-31T13:05:33.133562+00:00 heroku[router]: at=info method=GET path="/admin/" host=mighty-dawn-15611.herokuapp.com request_id=07013596-aec1-46a7-92e1-87efc4600758 fwd="156.204.110.108" dyno=web.1 connect=5ms service=3ms status=304 bytes=206 protocol=https
2019-10-31T13:05:32.529305+00:00 heroku[router]: at=info method=GET path="/" host=mighty-dawn-15611.herokuapp.com request_id=025db0b9-1164-46bd-a196-2c62c6779e15 fwd="156.204.110.108" dyno=web.1 connect=1ms service=8ms status=302 bytes=304 protocol=https
2019-10-31T13:05:34.722789+00:00 heroku[router]: at=info method=GET path="/admin/workspace/bots" host=mighty-dawn-15611.herokuapp.com request_id=d394dc38-bbd1-4469-997a-c5f73222bb40 fwd="156.204.110.108" dyno=web.1 connect=5000ms service=3ms status=304 bytes=206 protocol=https
2019-10-31T13:05:34.173436+00:00 heroku[router]: at=info method=GET path="/admin/static/css/main.20087f6d.chunk.css" host=mighty-dawn-15611.herokuapp.com request_id=c8c4b2b3-f2e0-41bf-9cfe-2451bc7f808b fwd="156.204.110.108" dyno=web.1 connect=1ms service=7ms status=200 bytes=159035 protocol=https
2019-10-31T13:05:32.812326+00:00 heroku[router]: at=info method=GET path="/" host=mighty-dawn-15611.herokuapp.com request_id=2d2f7f20-bad4-400a-ac43-f85e0ea7b8f1 fwd="156.204.110.108" dyno=web.1 connect=0ms service=3ms status=302 bytes=304 protocol=https
2019-10-31T13:05:42.363904+00:00 heroku[router]: at=info method=GET path="/admin/static/media/loading-circle.eb332664.svg" host=mighty-dawn-15611.herokuapp.com request_id=cc228ddc-e65b-4d0f-ae47-c03befc9875c fwd="156.204.110.108" dyno=web.1 connect=0ms service=2ms status=200 bytes=1460 protocol=https
2019-10-31T13:05:33.905843+00:00 heroku[router]: at=info method=GET path="/admin/static/js/2.e5ac7fa1.chunk.js" host=mighty-dawn-15611.herokuapp.com request_id=ec32d462-3d9b-41d5-b94f-9f3e74f29eea fwd="156.204.110.108" dyno=web.1 connect=0ms service=90ms status=200 bytes=2657983 protocol=https
2019-10-31T13:05:42.501515+00:00 heroku[router]: at=info method=GET path="/api/v1/auth/me/profile" host=mighty-dawn-15611.herokuapp.com request_id=72f06317-8b8e-4705-b1de-698b9af7017f fwd="156.204.110.108" dyno=web.1 connect=0ms service=6ms status=401 bytes=2470 protocol=https
2019-10-31T13:05:42.351281+00:00 heroku[router]: at=info method=GET path="/version" host=mighty-dawn-15611.herokuapp.com request_id=f0a08f51-5fff-40e1-b236-64617f80bb76 fwd="156.204.110.108" dyno=web.1 connect=0ms service=2ms status=304 bytes=204 protocol=https
2019-10-31T13:05:42.527258+00:00 heroku[router]: at=info method=GET path="/api/v1/admin/bots" host=mighty-dawn-15611.herokuapp.com request_id=95a243f2-566e-4bda-bb0b-32c2736ff831 fwd="156.204.110.108" dyno=web.1 connect=0ms service=3ms status=401 bytes=2470 protocol=https
2019-10-31T13:05:42.831996+00:00 heroku[router]: at=info method=GET path="/admin/favicon.ico" host=mighty-dawn-15611.herokuapp.com request_id=935131ad-8b08-4f6a-b73e-d522f5906c1a fwd="156.204.110.108" dyno=web.1 connect=1ms service=4ms status=200 bytes=5763 protocol=https
2019-10-31T13:05:42.836764+00:00 heroku[router]: at=info method=GET path="/api/v1/admin/license/status" host=mighty-dawn-15611.herokuapp.com request_id=80e31785-eac5-4baf-8b99-cfe2b4a120c1 fwd="156.204.110.108" dyno=web.1 connect=0ms service=2ms status=401 bytes=2470 protocol=https
2019-10-31T13:05:42.617932+00:00 heroku[router]: at=info method=GET path="/api/v1/auth/me/permissions" host=mighty-dawn-15611.herokuapp.com request_id=f7630beb-9566-4f7c-ace8-fd4d6f0031a3 fwd="156.204.110.108" dyno=web.1 connect=0ms service=3ms status=401 bytes=2470 protocol=https
2019-10-31T13:05:43.724844+00:00 heroku[router]: at=info method=GET path="/admin/favicon.ico" host=mighty-dawn-15611.herokuapp.com request_id=e700ee73-ad25-48a8-8069-dbc183678739 fwd="156.204.110.108" dyno=web.1 connect=2ms service=2ms status=200 bytes=5763 protocol=https
2019-10-31T13:05:43.323408+00:00 heroku[router]: at=info method=GET path="/admin/static/js/2.e5ac7fa1.chunk.js" host=mighty-dawn-15611.herokuapp.com request_id=8be0b35e-ad76-4b45-8cdf-128691887d74 fwd="156.204.110.108" dyno=web.1 connect=0ms service=2ms status=304 bytes=295 protocol=https
2019-10-31T13:05:43.73194+00:00 heroku[router]: at=info method=GET path="/admin/manifest.json" host=mighty-dawn-15611.herokuapp.com request_id=5bb33334-c1ab-4787-b0da-48595055e6da fwd="156.204.110.108" dyno=web.1 connect=0ms service=1ms status=200 bytes=684 protocol=https
2019-10-31T13:05:43.021317+00:00 heroku[router]: at=info method=GET path="/assets/custom-theme.css" host=mighty-dawn-15611.herokuapp.com request_id=756e8dc3-e987-4881-ae7b-f8c75b3a2bbf fwd="156.204.110.108" dyno=web.1 connect=0ms service=1ms status=404 bytes=270 protocol=https
2019-10-31T13:05:43.360257+00:00 heroku[router]: at=info method=GET path="/admin/static/js/main.aaa327be.chunk.js" host=mighty-dawn-15611.herokuapp.com request_id=f240caec-ebed-43c5-bc67-9583f49d5ff2 fwd="156.204.110.108" dyno=web.1 connect=0ms service=2ms status=304 bytes=294 protocol=https
2019-10-31T13:05:42.841631+00:00 heroku[router]: at=info method=GET path="/api/v1/auth/config" host=mighty-dawn-15611.herokuapp.com request_id=4cf9d6b5-b8bc-4d58-8f50-fb223de540dc fwd="156.204.110.108" dyno=web.1 connect=0ms service=8ms status=304 bytes=205 protocol=https
2019-10-31T13:05:43.727412+00:00 heroku[router]: at=info method=GET path="/api/v1/auth/config" host=mighty-dawn-15611.herokuapp.com request_id=b181f67b-e338-4820-ba7c-87b0a2eaf53f fwd="156.204.110.108" dyno=web.1 connect=0ms service=9ms status=200 bytes=476 protocol=https
2019-10-31T13:05:42.800268+00:00 heroku[router]: at=info method=GET path="/admin/login" host=mighty-dawn-15611.herokuapp.com request_id=fd017b82-4e6d-4168-9c75-922a46c76ba0 fwd="156.204.110.108" dyno=web.1 connect=0ms service=2ms status=200 bytes=2637 protocol=https
2019-10-31T13:05:42.823828+00:00 heroku[router]: at=info method=GET path="/admin/login" host=mighty-dawn-15611.herokuapp.com request_id=d3be91a1-e3e3-450c-9e1f-d84f95c45322 fwd="156.204.110.108" dyno=web.1 connect=0ms service=2ms status=200 bytes=2637 protocol=https
2019-10-31T13:05:43.192433+00:00 heroku[router]: at=info method=GET path="/admin/static/css/main.20087f6d.chunk.css" host=mighty-dawn-15611.herokuapp.com request_id=9e5256cc-d66a-4d44-9a1b-fa59c9711a76 fwd="156.204.110.108" dyno=web.1 connect=0ms service=2ms status=304 bytes=294 protocol=https
2019-10-31T13:05:43.192742+00:00 heroku[router]: at=info method=GET path="/admin/static/css/2.ad0782f0.chunk.css" host=mighty-dawn-15611.herokuapp.com request_id=925dd334-c312-4696-b762-64a12f58dedf fwd="156.204.110.108" dyno=web.1 connect=1ms service=3ms status=304 bytes=294 protocol=https
2019-10-31T13:05:50.805407+00:00 heroku[router]: at=info method=GET path="/api/v1/admin/bots" host=mighty-dawn-15611.herokuapp.com request_id=b64cae89-2ea3-4d36-a594-06774d501250 fwd="156.204.110.108" dyno=web.1 connect=1ms service=8ms status=403 bytes=2731 protocol=https
2019-10-31T13:05:50.572676+00:00 heroku[router]: at=info method=GET path="/api/v1/auth/me/workspaces" host=mighty-dawn-15611.herokuapp.com request_id=eb677d00-f7cd-4171-82b5-72cc79260087 fwd="156.204.110.108" dyno=web.1 connect=1ms service=7ms status=304 bytes=204 protocol=https
2019-10-31T13:05:50.809402+00:00 heroku[router]: at=info method=GET path="/version" host=mighty-dawn-15611.herokuapp.com request_id=43c9a24e-22f6-435f-8fcb-7d6ad5037061 fwd="156.204.110.108" dyno=web.1 connect=0ms service=1ms status=304 bytes=204 protocol=https
2019-10-31T13:05:50.393151+00:00 heroku[router]: at=info method=POST path="/api/v1/auth/login/basic/default" host=mighty-dawn-15611.herokuapp.com request_id=17e0f47a-029a-4245-8fd2-56764b8edb03 fwd="156.204.110.108" dyno=web.1 connect=1ms service=22ms status=200 bytes=572 protocol=https
2019-10-31T13:05:50.956389+00:00 heroku[router]: at=info method=GET path="/api/v1/admin/license/status" host=mighty-dawn-15611.herokuapp.com request_id=b881a84d-747c-434e-ab0c-e07110c2004b fwd="156.204.110.108" dyno=web.1 connect=0ms service=2ms status=304 bytes=205 protocol=https
2019-10-31T13:05:51.126353+00:00 heroku[router]: at=info method=GET path="/api/v1/admin/license/status" host=mighty-dawn-15611.herokuapp.com request_id=461b9cd9-d90f-40fd-a9da-4719c78c414a fwd="156.204.110.108" dyno=web.1 connect=1ms service=3ms status=304 bytes=205 protocol=https
2019-10-31T13:05:42.995784+00:00 heroku[router]: at=info method=GET path="/api/v1/auth/me/permissions" host=mighty-dawn-15611.herokuapp.com request_id=f5571976-bebe-4c39-8e42-3338ad0d92b1 fwd="156.204.110.108" dyno=web.1 connect=1ms service=3ms status=401 bytes=2470 protocol=https
2019-10-31T13:05:50.974639+00:00 heroku[router]: at=info method=GET path="/api/v1/auth/me/permissions" host=mighty-dawn-15611.herokuapp.com request_id=58ac1c5a-b360-4593-a50d-07305fb1c35c fwd="156.204.110.108" dyno=web.1 connect=0ms service=5ms status=404 bytes=2677 protocol=https
2019-10-31T13:05:50.781045+00:00 heroku[router]: at=info method=GET path="/api/v1/admin/license/status" host=mighty-dawn-15611.herokuapp.com request_id=67ad1030-4516-45a0-866d-1d1ef63aa380 fwd="156.204.110.108" dyno=web.1 connect=0ms service=6ms status=200 bytes=431 protocol=https
2019-10-31T13:05:50.781042+00:00 heroku[router]: at=info method=GET path="/api/v1/auth/me/profile" host=mighty-dawn-15611.herokuapp.com request_id=e3cdb36f-e030-4a0f-a188-7a47aacff5d6 fwd="156.204.110.108" dyno=web.1 connect=0ms service=11ms status=304 bytes=206 protocol=https
2019-10-31T13:05:50.798895+00:00 heroku[router]: at=info method=GET path="/api/v1/auth/me/permissions" host=mighty-dawn-15611.herokuapp.com request_id=ae0afe94-4b42-4351-9e26-75034462b521 fwd="156.204.110.108" dyno=web.1 connect=0ms service=6ms status=404 bytes=2677 protocol=https
2019-10-31T13:05:50.813583+00:00 heroku[router]: at=info method=GET path="/admin/static/media/loading-circle.eb332664.svg" host=mighty-dawn-15611.herokuapp.com request_id=134faa71-c8c9-423d-a503-9ea750af4504 fwd="156.204.110.108" dyno=web.1 connect=1ms service=2ms status=304 bytes=292 protocol=https

The problem is probably that you have not set the BPFS_STORAGE=database environment variable.
Setting this variable will use your Postgres instance instead of the local disk as the storage backend for configuration files.

In order to fix this problem, you will need to proceed in 2 steps:

  1. clear the strategy_default table in your Postgres database using the following SQL command: truncate strategy_default
  2. set the BPFS_STORAGE=database environment variable and restart your Botpress server

The first time you start the server, you will be asked to create a new super user.

Hope this helps!

@spgin
thanks it`s work

Could anybody help me?
I’m having problems deploying on heroku.
I have a github repository with this structure:
my-new-bot
├── Dockerfile
├── data
└── heroku.yml
…├── bots
…└── global
and after the deploy the bot doesn’t exists.
what can i look for?

Thanks in advance!

Hey @rt3norio !

The data folder is probably not pushed to your GitHub repository. This has the effect that when deploying on Heroku, the data folder will be absent.

Hope this helps!