• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
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
v3.5.2 Latest
Buy Hosting

Systemctl fails to restart nodebb, except as root

Scheduled Pinned Locked Moved Unsolved Technical Support
8 Posts 5 Posters 273 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.
  • S Offline
    S Offline
    Selroth
    wrote on last edited by
    #1

    I think I'm running out of oxygen in this rabbit-hole, and starting to think I passed the carrot a LONG time ago...

    Basically, since trying to get nodebb to auto-restart on Centos, using systemctl, I've been having issues. Strangely, it restarts just fine when I do it as root, but I don't want to run NodeBB as root for obvious security reasons (multiple websites on my VPS). When I try to start it as a normal user, however, I get this:

    c848a2a7-6f67-4f3b-a5cc-b1dfff7cd69b-image.png

    I got PLENTY of RAM available:

    595898cc-c917-4680-9942-49ab8497dfec-image.png

    But the issue seems to be WebAssembly's memory container, which seems to be running out because of the benchpressjs framework. Why, at this front-end, it's successful when I run as a different OS user, is completely foreign to me as I'd think it'd be pretty freekin' transparent at this point. But... I'm not a front-end developer, so... Help?

    When I start it as root: 25c9247a-6cd0-46ac-9ab3-4548d9bfce06-image.png

    Systemctl .service file (page1):
    f6d63a03-3329-4e36-b9ff-c99a286f9d18-image.png
    (page2):
    1e3dbe3e-3d81-4abc-8173-9e008fd85881-image.png

    S 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    wrote on last edited by
    #2

    What version of Node are you on?

    S 1 Reply Last reply
    0
  • S Offline
    S Offline
    sdetweil
    replied to Selroth on last edited by
    #3

    @Selroth this is why I use PM2 (node process manager) for process mgmt

    start at boot.
    restart if fails
    can run as specific user
    can run anything

    can start/stop/restart via command

    works the same on every platform
    setup provides a system specific command to install for boot time support.

    can run multiple processes concurrently

    S 1 Reply Last reply
    0
  • S Offline
    S Offline
    Selroth
    replied to PitaJ on last edited by
    #4

    @PitaJ
    Looks like 16.17.0

    4f186b5b-42a7-44ff-a7ec-7dbdb2290534-image.png

    1 Reply Last reply
    0
  • S Offline
    S Offline
    Selroth
    replied to sdetweil on last edited by
    #5

    @sdetweil Hmm... This sounds like a great plan B! I prefer native tools, but... if I can't get it to work then I'm glad there's alternatives 🙂

    (Also, looking at it, wow - that's quite neat! Maybe I'll install it anyway, though I think it's currently overkill for my current situation =P)

    Thanks for the suggestion!

    gotwfG 1 Reply Last reply
    0
  • gotwfG Offline
    gotwfG Offline
    gotwf Community Rep
    replied to Selroth on last edited by gotwf
    #6

    @Selroth said in Systemctl fails to restart nodebb, except as root:

    I prefer native tools

    +1 for native tooling. No need to reinvent everything under the sun.

    Now, as fer' this issue... w/o even digging into it... whenever I run into such symptoms they just scream "Permissions Issue!!" 😱

    Which I presume you have already ruled out, but I also note no note of it one way or the other up thread. You DID install/setup NodeBB as your nodebb-user, correct? If not, then please try chown/chmod the dirs and files to your nodebb user as appropriate and see if this helps.

    Good luck! 🐕

    1 Reply Last reply
    0
  • oplik0O Online
    oplik0O Online
    oplik0 Plugin & Theme Dev Community Rep
    wrote on last edited by oplik0
    #7

    You can try checking if just increasing the node memory limit (this is technically not the full limit of what Node can use, but most cases it can be considered that; Also it governs gc, so even if it's not reaching it, who knows, perhaps the issue is caused by aggressive gc) would work: add --max-old-space-size=<value in MB> in cli parameters to node or via a NODE_OPTIONS=--max-old-space-size=<value in MB> env var.
    I think the default for 64-bit systems is 2GB, but I'm not sure...

    This obviously isn't a real fix even if it works, but would at least clarify if it needs more memory when running as a non-root user for some reason or if it's purely a permission problem and it'll run out as a user no matter what when it doesn't have proper access to something...

    1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    wrote on last edited by
    #8

    Can you try upgrading to Node 18?

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development