Trying to pinpoint a problem potentially related to caching

Technical Support
  • Hi!

    I am having a problem with my NodeBB database which I believe is related to caching based on what I have managed to determine so far. I have it set up on Heroku with Redis and myself and my users are seeing that some aspects are shown incorrectly.

    To refer to a clear example is the unread list. When this is shown then the order of posts is correct, however the one being previewed is not the latest one and the time stamp for it also indicates that it is not the latest one either. What is odd is that this can vary from machine to machine too, I can be connected from the same location (i.e. I can have two machines side by side and get different results).

    There are other issues as well, such as the vote count not being correct and so on which lead me to believe that this is connected to the caching in some way but I am unable to figure out what could be the trigger in that regard or how to best go about fixing it. Has anyone come across this before at all? All ideas are welcome and if more information is needed then I am happy to provide it. I am fully updated as far as NodeBB is concerned, and to add this was not a problem until after I started doing the updates (it was on 1.6 for a long time and it was only after I started the process of upgrading to 1.12 that this became apparent).

  • Can you share more about your setup? Is it a single heroku instance running off a single database backend? All-in-one server?

    This could be an issue if you are using multiple NodeBB instances...


Suggested Topics


  • 1 Votes
    1 Posts
    140 Views

    When users sign up using Facebook SSO , Facebook creates a random-numbered email address for them such as [email protected]

    I think a similar problem was already reported here: https://community.nodebb.org/topic/5985/facebook-sso-plugin-email-issue

    However, all emails sent to these kinds of addresses are returning back to us. This was already happening, but it was not bothering us so far 😄 unfortunately, recently we started to have a lot of "Delivery Status Notification (Failure)" emails... so, we would like to solve this.

    Address not found
    Your message wasn't delivered to [email protected] because the domain facebook.com couldn't be found. Check for typos or unnecessary spaces and try again.

    And on the Facebook postmaster page, we can confirm the problem as "RCP-P1 The attempted recipient address does not exist."

    Since the forum sees these accounts as valid and activated, it keeps trying to send an email at any action that causes email delivery. And of course, all emails are being failed to be delivered and returned back to us.

    Any suggestion?

  • 0 Votes
    1 Posts
    559 Views

    I've recently been trying to setup NodeBB on my server, but whenever i try to login or register the POST request returns a 403 forbidden response and NodeBB logs an "invalid csrf token" error.

    The following software packages are used:

    NodeBB 1.10.1 MongoDB 3.2.11 Node.js 8.11.4 Debian 9.3

    NodeBB itself is a subfolder installation in https://endless-endeavors.theswc.net/forum/. The node server is multi-tenant and works with express.js as a router/reverse proxy. All external http requests are redirected to https, but requests to the nodeBB server are proxied internally over http. Essentially this is the flow for an incoming forum request:

    main server app -> enforce https, direct request to endless-endeavors.theswc.net directory host/domain app -> Check url, if /forum, proxy to port 4567 over http (or wss if websocket) let nodeBB do its thing.

    I've been googling and have found quite a few threads, but none of the suggested solutions have worked. things i have tried so far:

    Check url in config.json: 'https://endless-endeavors.theswc.net/forum/' Make sure cookieDomain is '' in MongoDB Including header 'X-Forwarded-Proto: https' Including header 'X-Forwarded-SSL: on' Including header 'X-Url-Scheme: https'
    I've also found that in the GET request for the login form, no X-CSRF-Token header is received. The form itself however is populated with a token.

    Lastly, here are the relevant code snippets:

    main server app

    #!/usr/bin/env nodejs // filename: app.js const http = require('http'); const https = require('https'); const fs = require('fs'); const express = require('express'); const vhost = require('vhost'); const app = express(); const sslOptions = { cert: fs.readFileSync('./.sslcert/fullchain.pem'), key: fs.readFileSync('./.sslcert/privkey.pem') } http.createServer(function(req, res) { res.writeHead(301, { "Location": "https://" + req.headers['host'] + req.url }); res.end(); }).listen(80); app .use(require('helmet')()) .use(express.static(__dirname + '/static')) <redacted, other domains> .use(vhost('endless-endeavors.theswc.net', require('./apps/EndlessEndeavors').app)) app.get('/', function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end(''); });

    domain app

    const express = require('express') const app = express(); const http = require('http'); const httpProxy = require('http-proxy'); const proxy = httpProxy.createProxyServer(); app.use('/static',express.static(__dirname + '/static')); app.use('', express.static(__dirname + '/dist/EndlessEndeavors')); app.all('/forum[/]+*', function(req, res){ if(req.url.substr(0,18).indexOf('socket.io')>-1){ console.log('got socket request'); proxy.web(req, res, {target: 'wss://endless-endeavors.theswc.net:4567', ws: true}); } else { res.header('X-Forwarded-Proto','https'); res.header('X-Forwarded-Ssl','on'); res.header('X-Url-Scheme','https'); res.header('Access-Control-Allow-Origin','endless-endeavors.theswc.net'); proxy.web(req, res, {target: 'http://endless-endeavors.theswc.net:4567'}); } }); app.all('/forum$', function(req, res) { res.writeHead(301, { "Location": "https://" + req.headers['host'] + '/forum/' }); res.end(); } ) exports.app = app;

    nodeBB config.json

    { "url": "https://endless-endeavors.theswc.net/forum/", "secret": "<redacted>", "database": "mongo", "port": 4567, "mongo": { "host": "127.0.0.1", "port": 27017, "username": "<redacted>", "password": "<redacted>", "database": "<redacted>", "uri": "<redacted>" } }

    Hopefully this is enough into to help find the cause of the invalid csrf token issue... i have no idea what else could be wrong at this point.

  • 0 Votes
    3 Posts
    2k Views

    Wasn't lwip used in 0.7.x/0.8.x?

  • resize problem

    Technical Support
    2
    0 Votes
    2 Posts
    806 Views
  • Mo time mo problems

    Technical Support
    3
    0 Votes
    3 Posts
    1k Views

    @BDHarrington7 No idea, and wouldn't know how to check it. Anyway, I already destroyed the Droplet so I can't answer that question. In a bit I will rebuild a new CentOS droplet and start from scratch.

    I think my biggest issue is simply not understanding file and directory paths. I am likely in the wrong folder running commands that expect me to be in another folder, etc.

    If I had hair on my head it would be gone by now.