#[Discord bot] mongodb error code=1

7 messages · Page 1 of 1 (latest)

maiden jolt
#

<@&493060586326982674> is down and I don't want to spend hours troubleshooting MongoDB again, so I might replace it with some more reliable / easy to use data store. But maybe troubleshooting error code=1 isn't as hard as I imagine it to be?

maiden jolt
#

Apparently this was the solution:

root@vps178028:~# mkdir /var/run/mongodb
root@vps178028:~# chown mongodb:mongodb /var/run/mongodb
root@vps178028:~# view /var/log/mongodb/mongod.log
root@vps178028:~# service mongod restart
root@vps178028:~# service mongod status
● mongod.service - MongoDB Database Server
     Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-10-12 14:01:17 CDT; 3s ago
#

I guess I'll update my statbot service file to only start if mongod is running:

[Unit]
Description=Lichess Discord
After=mongod.target network.target remote-fs.target nss-lookup.target

[Service]
Restart=always
RestartSec=30
WorkingDirectory=/home/lichess/lichess-discord
ExecStart=/usr/bin/npm start

[Install]
WantedBy=default.target
honest surge
#

Yeah I never liked db to store discord related data, in past I had users request a lot of data stored info for my other bot, but I guess it does provide easy convenience

#

PostgreSql is my choice

maiden jolt
#

Ah... right, I forgot probably most of my commands could be made fault-tolerant as I'm storing minimal information (username and rating category preference).

honest surge
#

Yeah with my previous bot I used to store string quotes in a db and it just took too long to pull out data and people hated that, also didn’t suit well with recent jda update like 3 to 4 months ago. So I changed to temporarily cache storage. Since it was fast people liked it more