v1.6.0 permission problems after upgrade/update


  • yup... updating to v1.6.0 causes the same issues... ownership is changed to root, changing it back to the rightful owner starts it back up (internal server error is gone):

    Sep 17 19:28:58 [HOSTNAME] [ACCOUNT][4048]: Error: EACCES: permission denied, open '/opt/nodebb/build/public/templates/footer.jst' Sep 17 19:28:58 [HOSTNAME] [ACCOUNT][4048]: at Error (native) Sep 17 19:28:59 [HOSTNAME] [ACCOUNT][4048]: Error: EACCES: permission denied, open '/opt/nodebb/build/public/templates/footer.jst' Sep 17 19:28:59 [HOSTNAME] [ACCOUNT][4048]: at Error (native) Sep 17 19:28:59 [HOSTNAME] [ACCOUNT][4048]: 17/9 19:28:59 [4058] - error: / Sep 17 19:28:59 [HOSTNAME] [ACCOUNT][4048]: Error: EACCES: permission denied, open '/opt/nodebb/build/public/templates/categories.jst' Sep 17 19:28:59 [HOSTNAME] [ACCOUNT][4048]: at Error (native) Sep 17 19:28:59 [HOSTNAME] [ACCOUNT][4048]: Error: EACCES: permission denied, open '/opt/nodebb/build/public/templates/500.jst' Sep 17 19:28:59 [HOSTNAME] [ACCOUNT][4048]: at Error (native)

    Bummer... reverting back to my snapshot 😞 yeah... I will have to wait for the next patch.

    For anyone having the same issues... reinstalling it with v1.6.0 is the best option... unless I am the unlucky one XD

  • Global Moderator Plugin & Theme Dev

    Are you using sudo at all during the upgrade?

    Edit: sudo or root


  • yes, is that a problem? with previous version, I did the same thing and worked perfectly

  • Global Moderator Plugin & Theme Dev

    Yes, it's the source of the problem. Either use root/sudo for everything, or use it for nothing.

  • GNU/Linux Admin

    Ideally, do it without, there should be no reason to use sudo


  • @pitaj but why with this particular version? from v1.4.x to v1.5.x was perfectly fine... now I should be doing it with my nodebb account? That should be added to the docs, I think. My nodebb account is literally just a service account [nologin account with selinux limiting it too, and correct policies are applied to it too]...

  • GNU/Linux Admin

    1.6.0 uses compiled template files, which if owned by root... Are not so accessible 😛


  • @julian is that one of the changes?

    the 2 lines I ran was literally this (as root):
    systemctl stop nodebb; git fetch; git checkout v1.5.x; git merge origin/v1.5.x; ./nodebb upgrade; systemctl start nodebb

    wait a minute and the forum works, without an issue (upgrading from v1.4.6 to v1.5.3)

    next (as root):
    systemctl stop nodebb; git fetch; git checkout v1.6.x; git merge origin/v1.6.x; ./nodebb upgrade; systemctl start nodebb
    File ownership is not correct (might be due to extra files not being there, due to older release) and once ownership is corrected, pages get stuck until it is refreshed.

    Should I try a different branch, maybe?

  • Global Moderator Plugin & Theme Dev

    @adam-poniatowski what is your service file? My guess is that it starts nodebb under the nodebb user. Running ./nodebb upgrade as root is going to mess stuff up because it will change the ownership of certain files and directories during the build step.


  • @pitaj but it doesn't explain why when I do this from v1.4 to 1.5 it works fine, but v1.5 to v1.6 it doesn't work. If that was one of the changes in the upgrade parameter, then I will try it with my nodebb account (which my service file is using nodebb.service)

  • Global Moderator Plugin & Theme Dev

    @adam-poniatowski because templates are done differently in v1.6.0, because it uses Benchpress.


  • @pitaj aaah ok... so what step should I change to update it properly then? let my nodebb account run ./nodebb upgrade or should I let my account fetch/checkout/merge as well (which I will have to modify some policies for that)?

  • Global Moderator Plugin & Theme Dev

    Ideally you should run everything without root, and under the nodebb account. Everything besides systemctl commands, that is. @julian pointed out above how best to run bash under a different user: su - nodebb


  • @pitaj that part I already know. I am a sysadmin as well... freebsd habits, when it comes to starting services (I am not really in the mood to explain admin tasks for spinning up services in any OS with an admin/root account, too tired for that now).

    short answer could've been:

    due to changes to v1.6.0, it is mandatory to use the account that you use for nodebb for upgrading, to avoid extra admin work and/or issues.

    off to bed with me ;(


  • as a last ditch effort... I did it again, but upgrading with the nodebb account...

    v1.4 ---> v1.5 = perfect

    v1.5 ---> v1.6 = now I don't get internal server error, but pages get stuck ~75% and when I manually refresh, it works (*edit to add: for every page I go to, besides login and admin).

    I'm sticking to v1.5 until I can find the time and strength to reinstall it to v1.6


  • I have same problem
    after this

    git fetch
    git checkout v1.6.0
    ./nodebb upgrade
    

    first time i found nodebb-plugin-category-sort-by-title will make nodebb crash, i disable it
    then i found

    Error: EACCES: permission denied, open '/home/nodebb/build/public/templates/recent.jst'
    

    then

    chown -R nodebb /home/nodebb
    

    problem solved


  • It Works!

    sudo chown -R $USER:$GROUPS NodeBB/

    sudo chmod -R 770 build/

  • Gamers

    I think I'm having the same issue here, folks. I installed everything and have always done upgrades as root. Now, when trying to upgrade from 1.5.3 to 1.6.1 I get permission denied errors.

    I have never used my NodeBB login to do anything with NodeBB as far as installation or upgrading, and so I'm kind of lost on how to fix all this. ☹

  • Global Moderator Plugin & Theme Dev

    @michael-pfaff You shouldn't be using root to do anything with ./nodebb. You should always do such things as the nodebb user or whatever user you use to run it.

    The easiest way to fix this is to delete the build directory, and then su - nodebb and run ./nodebb build as that user.

  • Gamers

    @pitaj said in v1.6.0 permission problems after upgrade/update:

    @michael-pfaff You shouldn't be using root to do anything with ./nodebb. You should always do such things as the nodebb user or whatever user you use to run it.

    The easiest way to fix this is to delete the build directory, and then su - nodebb and run ./nodebb build as that user.

    Thanks, @PitaJ. I didn't realize that was the case. I'll try this out and see if it works.

    To clarify:

    What does the su - nodebb command do exactly?

    Appreciate all the help.


Suggested Topics

| | |

© 2014 – 2022 NodeBB, Inc. — Made in Canada.