Ghost: Validation.js Error: This library (validator.js) validates strings only

Created on 11 Jun 2016  路  3Comments  路  Source: TryGhost/Ghost

Issue Summary

The Ghost Aborted With Validation.js Error.

root@wangqiliang:/home/yjsw[root@wangqiliang yjsw]# npm start
[email protected] start /home/yjsw
node index
ERROR: This library (validator.js) validates strings only
TypeError: This library (validator.js) validates strings only
at assertString (/home/yjsw/node_modules/validator/lib/util/assertString.js:9:11)
at Object.isURL (/home/yjsw/node_modules/validator/lib/isURL.js:37:30)
at ConfigManager.validate (/home/yjsw/core/server/config/index.js:341:20)
at /home/yjsw/core/server/config/index.js:256:29
at tryCatcher (/home/yjsw/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/yjsw/node_modules/bluebird/js/release/promise.js:5
02:31)
at Promise._settlePromise (/home/yjsw/node_modules/bluebird/js/release/promise.js:559:18)
at Promise._settlePromiseCtx (/home/yjsw/node_modules/bluebird/js/release/promise.js:596:10)
at Async._drainQueue (/home/yjsw/node_modules/bluebird/js/release/async.js:143:12)
at Async._drainQueues (/home/yjsw/node_modules/bluebird/js/release/async.js:148:10)
at Immediate.Async.drainQueues as _onImmediate
at processImmediate as _immediateCallback`

Steps to Reproduce

  1. npm install --production
  2. node index or npm start --production

    Technical details:

  • Ghost Version: 0.8.0 or 0.9.0 beta 1
  • Node Version: Nodejs 4.4.3 LTS
  • Browser/OS: CentOS 7
  • Database: MySQL (MariaDB)

Most helpful comment

Just in case anyone else stumbles across this:

I had this same problem when trying to deploy to Heroku. I fixed it by adding HEROKU_URL to process.env (Config Variables) in Heroku. You will also need to add S3_ACCESS_KEY and S3_ACCESS_KEY_ID along with some other variables. Look at config.js for which variables you will need to provide in the Heroku console.

All 3 comments

This problem is solved?

Just in case anyone else stumbles across this:

I had this same problem when trying to deploy to Heroku. I fixed it by adding HEROKU_URL to process.env (Config Variables) in Heroku. You will also need to add S3_ACCESS_KEY and S3_ACCESS_KEY_ID along with some other variables. Look at config.js for which variables you will need to provide in the Heroku console.

Just in case anyone stumbles across this:

I got this error when I tried using Labs > Test email configuration while configured for Mailgun.
image

It turns out that I had some typos. For example, I had "from:": "My Name <[email protected]>" instead of "from":.

Here's my mail setup if you want the full format. I used port 587 because that's what Mailgun recommends.

"mail": {
    "from": "My Name <[email protected]>",
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "smtp.mailgun.org",
      "port": 587,
      "auth": {
        "user": "[email protected]",
        "pass": "password"
      }
    }
  },

If you turn secureConnections on, you'll get this error: Failed to send email. Reason: 140536545072960:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332: .
image

I also found this to work, as suggested on the config instructions.

"mail": {
    "from": "My Name <[email protected]>",
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "smtp.mailgun.org",
      "port": 465,
      "secureConnection": true,
      "auth": {
        "user": "[email protected]",
        "pass": "password"
      }
    }
  },
Was this page helpful?
0 / 5 - 0 ratings