Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Technical Support
  3. NodeBB Email Settings Page Causing Cloudflare 520 Error

NodeBB Email Settings Page Causing Cloudflare 520 Error

Scheduled Pinned Locked Moved Technical Support
5 Posts 2 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • boyle-taylor@community.nodebb.orgB This user is from outside of this forum
    boyle-taylor@community.nodebb.orgB This user is from outside of this forum
    [email protected]
    wrote last edited by
    #1

    I'm experiencing an issue with my NodeBB v4.4.6 installation where accessing the Email Settings page in the Admin Control Panel results in a Cloudflare 520 error ("Web server is returning an unknown error").

    Details:

    NodeBB version: 4.4.6 (recently upgraded from 3.12.7)
    Database: MongoDB (no authentication) ( i plan to do it later)
    Web server: Running behind Cloudflare (nginx)
    Error occurs only on the email settings page (/api/admin/settings/email)
    Other admin pages work fine
    What I've tried:

    Installed nodebb-plugin-emailer-smtp
    Disabled HTTP/2 to Origin in Cloudflare
    Rebuilt and restarted NodeBB
    Checked for errors in NodeBB logs (none visible)
    I'm using Resend for email (have proper DNS records set up in cloudfare when I was testing Flarum forum) and need to configure NodeBB to use it. Any suggestions on how to fix this specific 520 error when accessing the email settings page?

    baris@community.nodebb.orgB 1 Reply Last reply
    0
    • boyle-taylor@community.nodebb.orgB [email protected]

      I'm experiencing an issue with my NodeBB v4.4.6 installation where accessing the Email Settings page in the Admin Control Panel results in a Cloudflare 520 error ("Web server is returning an unknown error").

      Details:

      NodeBB version: 4.4.6 (recently upgraded from 3.12.7)
      Database: MongoDB (no authentication) ( i plan to do it later)
      Web server: Running behind Cloudflare (nginx)
      Error occurs only on the email settings page (/api/admin/settings/email)
      Other admin pages work fine
      What I've tried:

      Installed nodebb-plugin-emailer-smtp
      Disabled HTTP/2 to Origin in Cloudflare
      Rebuilt and restarted NodeBB
      Checked for errors in NodeBB logs (none visible)
      I'm using Resend for email (have proper DNS records set up in cloudfare when I was testing Flarum forum) and need to configure NodeBB to use it. Any suggestions on how to fix this specific 520 error when accessing the email settings page?

      baris@community.nodebb.orgB This user is from outside of this forum
      baris@community.nodebb.orgB This user is from outside of this forum
      [email protected]
      wrote last edited by
      #2

      Put some console.logs and see if the /admin/settings/email route is being called. https://github.com/NodeBB/NodeBB/blob/master/src/controllers/admin/settings.js#L116 this is the controller that gets called when you load that page.

      Start nodebb with node app.js to see the logs and see what happens you load the page.

      1 Reply Last reply
      0
      • boyle-taylor@community.nodebb.orgB This user is from outside of this forum
        boyle-taylor@community.nodebb.orgB This user is from outside of this forum
        [email protected]
        wrote last edited by
        #3

        Thanks baris for the debugging guidance. Here's what we've discovered through systematic testing:

        What we tried:

        Added console.log debugging to settings.js as suggested
        Started NodeBB with node app.js to monitor logs
        Key finding: Debug logs never appeared when accessing email settings
        Infrastructure testing revealed:

        ✅ Admin API endpoints work correctly: All /api/admin/* routes return proper 401 (auth required) responses
        ✅ Email API specifically works: /api/admin/settings/email returns 401, not 520
        ❌ JavaScript template fails: /assets/templates/admin/settings/email.js returns 520 error
        Current plugin status:

        2025-08-23T02:28:21.248Z [4567/298549] - error: [plugins/emailer-sendgrid] API key not set!
        Infrastructure fixes attempted:

        ✅ Disabled HTTP/2 to Origin in Cloudflare
        ✅ Added extended timeouts (120s) and larger buffers (512k) for admin routes in Nginx
        ✅ Added specific location blocks for /community/api/admin/ routes
        ❌ Issue persists
        Current assessment: The issue is NOT with the admin route itself (it returns proper 401) but with NodeBB's dynamic JavaScript template generation for /assets/templates/admin/settings/email.js. This suggests the email settings page template processing is failing during compilation, possibly due to the emailer plugin error.

        Key question: Should the email settings page load even with a misconfigured emailer plugin, or is it expected that template generation would fail if the plugin has errors?

        The admin API works fine - it's specifically the client-side template JavaScript that's failing with 520.

        1 Reply Last reply
        0
        • baris@community.nodebb.orgB This user is from outside of this forum
          baris@community.nodebb.orgB This user is from outside of this forum
          [email protected]
          wrote last edited by [email protected]
          #4

          If the javascript template is failing to load you might need to run ./nodebb build so it is generated in the build folder. Check if it's in the folder build/public/templates/admin/settings

          1 Reply Last reply
          0
          • boyle-taylor@community.nodebb.orgB This user is from outside of this forum
            boyle-taylor@community.nodebb.orgB This user is from outside of this forum
            [email protected]
            wrote last edited by
            #5

            I did that too before I posted the reply here. I think maybe it was a rule in nginx to disallow paths which had /email, that was the main culprit.

            It was a fresh installation and I thought of installing the forum again. So I did it and its working now.

            Thanks for your replies though. I understand as the co founder of this software, you must be a busy guy.

            Love the software.

            1 Reply Last reply
            1
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups