I checked out v1.16.2 of the forum and was running node version 15.12 when I encountered the same error.
I downgraded to node version 14.6.0 and now this error is not coming up.
I hope this info can help anyone.
I have this forum: http://howardmann.us:4567 on a Digital Ocean droplet.
I'm going to create a new Droplet, install NodeBB on it, and then simply re-create the forum.
I have a backup (a dump.rdb) of the Redis database on my laptop, and guidance for restoring this.
I presume I'll have to restore/replace the contents of other, certain directories— X, Y, Z, etc. — from the contents of the same saved directories on my laptop in order to achieve this.
Which directories do I need to save and replace ?
Or, is there a better method (before I ultimately destroy my current Droplet), or guidance, for achieving this ?
You will need the
public/uploads folder for uploaded files. If you installed plugins into node_modules without adding them to package.json you will have to reinstall those as well.
I don't recall "adding" the plugins (Imgur; and Sendmail) to package.json. I don't know what that process is. If you tell me what I should see in package.json that would clarify this, I'll look at it.
I do, of course, have the API key , ClientID and secret for the plugins I do want: Imgur and Sendmail.
Any guidance is appreciated
You don't have to worry if you installed them through the ACP page, just copy your files to the new server and it should work. I was referring to plugins that might be sysmlinked into the node_modules folder. Your keys and secrets are stored in the database for the plugins so copying the plugin will bring those back as well.
Yes, I installed them via the Administrator page.
I presume you mean the two plugin-related folders in: "node_modules."
If not, let me know. Otherwise, I'll do that and report back later this weekend.
@howardm if they're installed from the ACP you're fine. Don't worry about copying anything. If you check the "dependencies" list in package.json for the two plugins, you can double check they're there.
It doesn't really matter if they're there, though. You can always reinstall them from the ACP.
I installed nodebb in my home folder. (It's in /var/www on my current server. I'm not sure why I put it there. I presume it doesn't matter where it is.)
I first renamed the present dump.rdb file to "dump.rdb.old." I then copied the saved dump.rdb file to redis on my new server. This proceeded without an error. I changed the permissions of /var/lib/redis and the dump.rdb file appropriately. I then restarted redis and nodebb.
I didn't try to move over the plugins (Imgur; and Sendmail) I mentioned above.
Unfortunately, the result looks like this: http://18.104.22.168:4567
Instead of like this: http://howardmann.us:4567
How do I begin to troubleshoot the result ? Does the appearance of the page suggestive of some particular issue ?
Here is the contents of config.json:
I don't see the "type": "literal" in config.json on my current server. I don't know what this is.
./nodebb build and restarting.
Thanks. I did this. Here is the output:
$ ./nodebb build
2018-02-25T23:55:01.182Z  - info: [build] Building in parallel mode
2018-02-25T23:55:01.185Z  - info: [build] plugin static dirs build started
2018-02-25T23:55:01.190Z  - info: [build] requirejs modules build started
2018-02-25T23:55:01.192Z  - info: [build] client js bundle build started
2018-02-25T23:55:01.194Z  - info: [build] admin js bundle build started
2018-02-25T23:55:01.197Z  - info: [build] client side styles build started
2018-02-25T23:55:01.199Z  - info: [build] admin control panel styles build started
2018-02-25T23:55:01.217Z  - info: [build] templates build started
2018-02-25T23:55:01.218Z  - info: [build] languages build started
2018-02-25T23:55:01.219Z  - info: [build] sounds build started
2018-02-25T23:55:01.225Z  - info: [build] plugin static dirs build completed in 0.04sec
2018-02-25T23:55:07.666Z  - info: [build] client js bundle build completed in 6.474sec
2018-02-25T23:55:07.666Z  - info: [build] admin js bundle build completed in 6.472sec
2018-02-25T23:55:07.800Z  - info: [build] sounds build completed in 6.581sec
from option PostCSS could generate wrong source map or do not find Browserslist config. Set it to CSS file path or to
undefined to prevent this warning
2018-02-25T23:55:14.231Z  - info: [build] client side styles build completed in 13.034sec
2018-02-25T23:55:17.727Z  - info: [build] admin control panel styles build completed in 16.529sec
2018-02-25T23:55:17.848Z  - info: [build] requirejs modules build completed in 16.658sec
2018-02-25T23:55:19.498Z  - info: [build] languages build completed in 18.28sec
2018-02-25T23:55:19.519Z  - info: [build] templates build completed in 18.302sec
2018-02-25T23:55:19.521Z  - info: [build] Asset compilation successful. Completed in 18.336sec.
howardm@UbuntuFebruary2018:~/nodebb$ ./nodebb restart
Unfortunately, the result is the same: http://22.214.171.124:4567
@howardm It looks like your database didn't copy over correctly.
Thanks for responding. I used scp to copy it (dump.rdb) directly from server 1 to the home directory of server 2, and then (using cp) from the home directory to /var/lib/redis.
It's a small file (small database) and I didn't see any errors.
Could this method have introduced "corruption" ?
What method would you use ?
@howardm If I were you, I'd check that the redis database is correct using redis-cli. By viewing the contents of keys like
plugins:active you can make sure you have the right database settings. You also might want to check that
"database": 1 is what you want, as the default is
0 for redis.
Well, that was it!
I changed the config.json to read: "database": "0" and it works.
When I installed nodebb,the setup (I think) said I could choose any database number, and I arbitrarily chose "1" without thinking that the redis database I was going to restore was (presumably) associated with "0". Or, stated differently, there is only one redis database involved in this situation.
Thanks, again, for the observation!
Glad to hear you're up and running @howardm