Site not accessible after a "./nodebb upgrade"

Bug Reports
  • After a forever stop, git pull, ./nodebb upgrade and restarting, I can no longer access the site.

    Here's the console output after running ./nodebb upgrade:

    npm WARN package.json [email protected] No repository field.
    npm WARN package.json [email protected] No repository field.
    npm WARN package.json [email protected] No repository field.
    npm WARN package.json [email protected] No repository field.
    npm http GET https://registry.npmjs.org/bcryptjs
    npm http 200 https://registry.npmjs.org/bcryptjs
    npm http GET https://registry.npmjs.org/bcryptjs/-/bcryptjs-0.7.10.tgz
    npm http 200 https://registry.npmjs.org/bcryptjs/-/bcryptjs-0.7.10.tgz
    
    > [email protected] install /var/www/public_html/forum/node_modules/bcrypt
    > node-gyp rebuild
    
    gyp ERR! clean error 
    gyp ERR! stack Error: EACCES, unlink 'build'
    gyp ERR! System Linux 3.11.0-15-generic
    gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /var/www/public_html/forum/node_modules/bcrypt
    gyp ERR! node -v v0.10.25
    gyp ERR! node-gyp -v v0.12.2
    gyp ERR! not ok 
    
    npm ERR! [email protected] install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the [email protected] install script.
    npm ERR! This is most likely a problem with the bcrypt package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     node-gyp rebuild
    npm ERR! You can get their info via:
    npm ERR!     npm owner ls bcrypt
    npm ERR! There is likely additional logging output above.
    npm ERR! System Linux 3.11.0-15-generic
    npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
    npm ERR! cwd /var/www/public_html/forum
    npm ERR! node -v v0.10.25
    npm ERR! npm -v 1.3.24
    npm ERR! code ELIFECYCLE
    npm ERR! 
    npm ERR! Additional logging details can be found in:
    npm ERR!     /var/www/public_html/forum/npm-debug.log
    npm ERR! not ok code 0
    

    Any clues?

  • @baris recommends deleting your node_modules and running npm install again...

  • @julian

    What did I do wrong then?

  • Assuming that resolved the problem?

    Your system doesn't seem to like bcrypt 😄 (We've already removed that package in favour of bcryptjs, so it shouldn't cause any more issues... I hope)

  • @julian

    About to give it a try, but that means losing modifications made to the theme. I know I'll have to back it up, but...

  • Yeah, back up your changes and see what happens if you re-generate node_modules. Good first step is to restore everything back to vanilla NodeBB

  • @julian

    Does it end with npm install or do I have to run another command after that?

  • npm install should be enough... all you're doing is restoring the dependencies... npm install your various other plugins as well, of course.

  • @julian

    Ok, so I did not lose any data except for modifications to footer.tpl and header.tpl of the Lavender theme

  • @planner Glad it worked out okay 🙂


Suggested Topics


  • 0 Votes
    2 Posts
    1k Views
  • 0 Votes
    5 Posts
    3k Views
  • 0 Votes
    10 Posts
    4k Views

    You've disabled the search feature of your forum. The search plugin works.

    You don't need to run nodebb upgrade when installing plugins. Nor do you need to disable it either. Nodebb reset plugins switches off all of your plugins.

    Go into your ACP and switch your installed plugins back to Active, restarting NodeBB each time until it crashes, post here the full crash log (looking for the name of the plugin), chances are their will be an update for it. To update a plugin

    npm i plugin-name@latest

    That's all you need to do, you don't need to upgrade or update. Go into your ACP and reload your forum.

    Only do nodebb upgrade when you pull the latest files. And don't reset plugins unless you're having an issue with plugins and you don't know which one. to disable a specific plugin, ./nodebb reset plugin="nodebb-plugin-name"

  • 0 Votes
    25 Posts
    7k Views

    That's great to hear, we really put a lot of work into 0.5.1 in terms of optimizations. Let us know if the freezing issue happens again.

  • 0 Votes
    5 Posts
    2k Views

    Here is the full log :

    Notif Obj function (cutoff) { if (process.env.NODE_ENV === 'development') { winston.info('[notifications.prune] Removing expired notifications from the database.'); } var today = new Date(), numPruned = 0; if (!cutoff) { cutoff = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 7); } var cutoffTime = cutoff.getTime(); async.parallel({ "inboxes": function(next) { db.getSortedSetRange('users:joindate', 0, -1, function(err, uids) { if(err) { return next(err); } uids = uids.map(function(uid) { return 'uid:' + uid + ':notifications:unread'; }); next(null, uids); }); }, "expiredNids": function(next) { db.getSetMembers('notifications', function(err,nids) { async.filter(nids, function(nid, next) { db.getObjectField('notifications:' + nid, 'datetime', function(err, datetime) { if (parseInt(datetime, 10) < cutoffTime) { next(true); } else { next(false); } }); }, function(expiredNids) { next(null, expiredNids); }); }); } }, function(err, results) { if(err) { if (process.env.NODE_ENV === 'development') { winston.error('[notifications.prune] Ran into trouble pruning expired notifications. Stack trace to follow.'); winston.error(err.stack); } return; } async.eachSeries(results.expiredNids, function(nid, next) { db.sortedSetsScore(results.inboxes, nid, function(err, results) { if(err) { return next(err); } // If the notification is not present in any inbox, delete it altogether var expired = results.every(function(present) { return present === null; }); if (expired) { destroy(nid); numPruned++; } next(); }); }, function(err) { if (process.env.NODE_ENV === 'development') { winston.info('[notifications.prune] Notification pruning completed. ' + numPruned + ' expired notification' + (numPruned !== 1 ? 's' : '') + ' removed.'); } }); }); } D:\nuitInfo2013\forum\node_modules\mongodb\lib\mongodb\connection\base.js:242 throw message; ^ TypeError: undefined is not a function at Object.Notifications.init (D:\nuitInfo2013\forum\src\notifications.js:16:38) at D:\nuitInfo2013\forum\app.js:126:21 at D:\nuitInfo2013\forum\src\upgrade.js:26:4 at D:\nuitInfo2013\forum\src\database\mongo.js:309:4 at D:\nuitInfo2013\forum\src\database\mongo.js:342:4 at D:\nuitInfo2013\forum\node_modules\mongodb\lib\mongodb\collection\query.js:147:5 at Cursor.nextObject (D:\nuitInfo2013\forum\node_modules\mongodb\lib\mongodb\cursor.js:733:5) at commandHandler (D:\nuitInfo2013\forum\node_modules\mongodb\lib\mongodb\cursor.js:713:14) at D:\nuitInfo2013\forum\node_modules\mongodb\lib\mongodb\db.js:1806:9 at Server.Base._callHandler (D:\nuitInfo2013\forum\node_modules\mongodb\lib\ mongodb\connection\base.js:442:41)