Ghost: Can't send invitation email to team member

Issue Summary

On Ubuntu Xenial, can’t send invitation email to my team. Because I get the following: screen shot 2018-10-26 at 3 57 06 pm

To Reproduce

  1. Tried sending invitation to a team member with following different mail configuration in the config file (used ghost restart after each configuration change) a.
  "mail": {
    "transport": "SMTP",
    "options": {
      "service": "Sendgrid",
      "auth": {
        "user": "MYUSERHERE",
        "pass": "MYPASSHERE"
      }
    }
  }

b.

  "mail": {
    "transport": "Direct"
    }
  }

c.

  "mail": {
    "transport": "SMTP",
    "options": {
      "service": "Sendmail"
    }
  }

ghost log brings the following:

+ sudo systemctl is-active ghost_blog-mallabee-com
[2018-10-26 12:50:35] WARN Ghost has shut down 
[2018-10-26 12:50:44] WARN Theme's file locales/en.json not found. 
[2018-10-26 12:50:45] INFO Ghost is running in production... 
[2018-10-26 12:50:45] INFO Your blog is now available on https://blog.mallabee.com/ 
[2018-10-26 12:50:45] INFO Ctrl+C to shut down 
[2018-10-26 12:50:45] INFO Ghost boot 6.3s 
[2018-10-26 12:50:45] INFO Bootstrap client was closed. 
[2018-10-26 12:50:55] INFO "GET /ghost/" 200 80ms
[2018-10-26 12:50:56] INFO "GET /ghost/assets/img/favicon.ico" 200 46ms
[2018-10-26 12:50:56] INFO "GET /ghost/api/v2/admin/users/me/?include=roles" 200 100ms
[2018-10-26 12:50:56] INFO "GET /ghost/api/v2/admin/configuration/" 200 8ms
[2018-10-26 12:50:56] INFO "GET /ghost/api/v2/admin/configuration/private/" 200 35ms
[2018-10-26 12:50:56] INFO "GET /ghost/api/v2/admin/settings/?type=blog%2Ctheme%2Cprivate" 200 78ms
[2018-10-26 12:50:56] INFO "GET /ghost/api/v2/admin/notifications/" 200 55ms
[2018-10-26 12:50:57] INFO "GET /ghost/api/v2/admin/users/?limit=all&filter=status%3Ainactive&include=roles" 200 145ms
[2018-10-26 12:50:57] INFO "GET /ghost/api/v2/admin/invites/?limit=all" 200 151ms
[2018-10-26 12:50:57] INFO "GET /ghost/api/v2/admin/users/?limit=15&page=1&modelPath=controller.activeUsers&filter=status%3A-inactive&include=roles" 200 163ms
[2018-10-26 12:50:57] INFO "GET /ghost/api/v2/admin/roles/" 200 153ms
[2018-10-26 12:50:57] INFO "GET /favicon.ico?t=1540558257094" 200 6ms
[2018-10-26 12:50:59] ERROR "POST /ghost/api/v2/admin/invites/" 500 90ms

NAME: InternalServerError
MESSAGE: The server has encountered an error.

level: normal

empty
empty
ERROR DETAILS:
    empty

InternalServerError: The server has encountered an error.
    at new GhostError (/srv/www/blog-mallabee/versions/2.3.0/core/server/lib/common/errors.js:10:26)
    at permsPromise.then.catch (/srv/www/blog-mallabee/versions/2.3.0/core/server/api/v2/utils/permissions.js:48:31)
    at tryCatcher (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)

Error: Undefined binding(s) detected when compiling SELECT query: select `roles`.* from `roles` where `roles`.`id` = ? limit ?
    at QueryCompiler_MySQL.toSQL (/srv/www/blog-mallabee/versions/2.3.0/node_modules/knex/lib/query/compiler.js:151:13)
    at Builder.toSQL (/srv/www/blog-mallabee/versions/2.3.0/node_modules/knex/lib/query/builder.js:119:44)
    at /srv/www/blog-mallabee/versions/2.3.0/node_modules/knex/lib/runner.js:52:32
    at tryCatcher (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/util.js:16:23)
    at /srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/using.js:185:26
    at tryCatcher (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:638:18)
    at PromiseArray._resolve (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise_array.js:126:19)
    at PromiseArray._promiseFulfilled (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise_array.js:144:14)
    at Promise._settlePromise (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:574:26)
    at Promise._settlePromise0 (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/srv/www/blog-mallabee/versions/2.3.0/node_modules/bluebird/js/release/promise.js:693:18)

Technical details:

  • Ghost Version: 2.3.0
  • Node Version: 8.9.0
  • Browser/OS: Chrome/Mac OSX
  • Database: mysql

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 36 (19 by maintainers)

Commits related to this issue

Most upvoted comments

Any workaround for adding new users? This seems like a CRITICAL issue.

OK. So it sounds like invites are sending correctly. I’m going to close this issue because the discussion has strayed from the initial report and bug fixes have landed for both the initial report and the associated (but different) resend issue.

If anyone still has trouble with invites please upgrade to 2.11.0 and if the problem persists please open a new issue with full reproduction steps.

@reustonium it’s only the payload that’s useful so no need for the extra screenshots 🙂 Looking at the payload you’ve provided it looks like a resend request, that won’t work unless you upgrade to the just released 2.11.0 version.

You said it was failing when creating new invites, can you show the payload for a failed request when doing that?

@kevinansfield This report looks similar to this issue. Any idea why this still appears? We have added the admin fix and a server side protection recently.

@kevinansfield Any idea how this is possible? 🤔 Is that a timing issue, because the admin client first need to fetch the roles?

Correct, it’s possible to submit the invite form before the roles have been fetched from the API. There’s some client-side validation we can add for that but I think it still needs similar validation server-side?