Errors on Update to 1.7.1
-
So during the upgrade, you were prompted to upgrade nodebb-plugin-emoji-one to the lastest version and did. Got it. I was referring to that not being done automatically by the upgrade utility.
-
@pitaj said in Errors on Update to 1.7.1:
So during the upgrade, you were prompted to upgrade nodebb-plugin-emoji-one to the lastest version and did. Got it. I was referring to that not being done automatically by the upgrade utility.
Not prompted, per se. AFAIK, and I know people use different processes, the upgrades are only reliable if a full npm update is run during the process. If we try to start NodeBB without doing that, we often get breaks and it can't start. We always update automatically as it is all scripted, so if this changed at some point, we'd not know. We've used the same upgrade script for a few years and, like I said, all I know is that it was required when it was first made and I was unaware of any changes to that requirement.
-
Meaning our upgrade script runs nodebb upgrade and then npm i, all as part of the script. We can't restart nodebb till that is done. So it is part of the upgrade process not part of the upgrade command.
-
@scottalanmiller all that should be necessary to upgrade NodeBB these days:
- For major upgrades (1.6.x -> 1.7.x)
git fetch git checkout v1.7.x git pull ./nodebb upgrade
- For minor upgrades (1.7.0 -> 1.7.1)
git pull ./nodebb upgrade
Would you mind sharing your script? If there are other steps they might be causing these issues.
Edit: this doesn't include restarting nodebb
-
Not much of a script but here it is...
git fetch; git pull; ./nodebb stop; npm i; ./nodebb upgrade; npm i; ./nodebb start; ./nodebb log
And for the 1.7.0 to 1.7.1 release we had to switch to this...
git fetch; git pull; ./nodebb stop; npm i; rm -rf ./node_modules/eslint* ; npm i commander; ./nodebb upgrade; npm i; ./nodebb start; ./nodebb log
Obviously our backups are not in that script, we do that manually (not sure why, actually.) Probably because we backup up to ten minutes ahead of doing the actual update as we can do that without impact and ensure we are at a lull before going down for a few seconds. So we keep it manual. We don't have a copy of the main database that we use for testing, but we have a series of separate sites that run the same code that range from pure test (their own data, but no live users) to insanely low use (users less than once a week) to moderate use but non-business before getting to the big main site. So we use that as our testing profile.
-
And like you pointed out, we do are git checkout independently rather than in the script. So that we have control and don't jump versions without realizing that we didn't mean to do it.
-
I don't know why the eslint issue occurred, it seems to have happened for a couple people. There are a few issues I can see with your script:
git fetch; git pull
is redundant,git pull
is just shorthand forgit fetch && git merge origin/[current branch]
- Using semicolons instead of
&&
will ignore errors in previous steps - The first
npm i
may have errored out when you upgraded tov1.7.0
where we changed how plugins get installed
In that release we deleted thepackage.json
in our repository, instead using a defaultpackage.json
which is used to update the locally heldpackage.json
. This allows fornpm@5
andyarn
default install behaviors to be compatible - You shouldn't need the eslint removal or commander install in there
./nodebb upgrade
runsnpm i
anyways, so you don't neednpm i
anymore- You can use
./nodebb start -l
or./nodebb slog
instead of start then log