0

I want to deploy NodeBB on Bluemix using Compose for Redis service. I follow the setup instructions at https://docs.nodebb.org/en/latest/installing/os/osx-mavericks.html

But when I push the app to Bluemix the application fails to start. I get an error. Please refer to link below.

Error on pushing nodeBB on Bluemix

However the nodeBB application runs fine on my local macbook.

How to resolve this error.Please let me know how to deploy nodeBB on Bluemix successfully?

Mustansir Ali
  • 305
  • 1
  • 2
  • 9

2 Answers2

1

The error indicates the public/uploads/sounds folder is not found on the staged application. It is not getting pushed along with the other application files.

This folder is used by the nodeBB application to copy sound files at runtime. To make sure that the empty public folder is pushed to Bluemix create a .cfignore file. Add the following line to it

!/public

Mustansir Ali
  • 305
  • 1
  • 2
  • 9
1

The following errors can prevent the nodeBB application to run on Bluemix.

1) If the credential to Compose for Redis is not setup correctly OR the Compose of Redis is unavailable in Bluemix

For the Redis connection to setup properly create a Compose for Redis service in Bluemix. Then Copy the Redis credentials from the service credentials as shown below.

{
  "db_type": "redis",
  "name": "bmix_dal_yp_94747ceb_7c86_4319_b7be_88c2e9c829eb",
  "uri_cli": "redis-cli -h sl-us-dal-9-portal.0.dblayer.com -p PORT -a PASSWORD”,
  "deployment_id": "583e1bea52de460017000124",
  "uri": "redis://admin: PASSWORD@sl-us-dal-9-portal.0.dblayer.com:PORT”
}

PORT represents Redis port number and PASSWORD represents Redis password

Use the credentials to update the config.json correctly when you run command ./nodebb setup [ on Unix or Mac]

Make sure Compose for Redis service is up and running. Otherwise you will get connection errors from the nodebb application when you start it.

2) If the port that the nodebb application can listen on Bluemix is not updated to app.js before pushing the application to Bluemix then it will cause the application to fail to start on Bluemix.

Update

nconf.set('port', urlObject.port || nconf.get('port') || nconf.get('PORT') || (nconf.get('PORT_ENV_VAR') ? nconf.get(nconf.get('PORT_ENV_VAR')) : false) || 4567);

TO

nconf.set('port', process.env.VCAP_APP_PORT || urlObject.port || nconf.get('port') || nconf.get('PORT') || (nconf.get('PORT_ENV_VAR') ? nconf.get(nconf.get('PORT_ENV_VAR')) : false) || 4567);

3) Make sure that the application runs on the local machine without any errors before pushing it to the Bluemix. Command : ./nodebb start OR node app.js

The instruction to setup and run nodeBB on local can be found here ttps://docs.nodebb.org/en/latest/installing/os/osx-mavericks.html

Mustansir Ali
  • 305
  • 1
  • 2
  • 9