Then again, I believe I made an error in dspace-ui.json, because I had trouble stopping and starting pm2 after I posted the previous message. When I would issue
sudo pm2 stop dspace-ui.json, it would show me dspace-ui status as "stopped" and I couldn't access the frontend in the browser. However, I couldn't start pm2 again, seeing the following error as part of pm2 logs:
0|dspace-u | code: 'EADDRINUSE',
0|dspace-u | errno: -98,
0|dspace-u | syscall: 'listen',
0|dspace-u | address: '127.0.0.1',
0|dspace-u | port: 4000
and when I ran sudo lsof -i tcp:4000, I would see dozens of processes, looking like this:
node\x20/ 520790 root 19u IPv4 3040271 0t0 TCP localhost:4000->localhost:44452 (ESTABLISHED)
node\x20/ 520790 root 20u IPv4 3040252 0t0 TCP localhost:4000 (LISTEN)
node\x20/ 520790 root 19u IPv4 3040274 0t0 TCP localhost:44454->localhost:4000 (ESTABLISHED)
node\x20/ 520790 root 19u IPv4 3040275 0t0 TCP localhost:4000->localhost:44454 (ESTABLISHED)
node\x20/ 520790 root 19u IPv4 3040278 0t0 TCP localhost:44456->localhost:4000 (ESTABLISHED)
node\x20/ 520790 root 19u IPv4 3040279 0t0 TCP localhost:4000->localhost:44456 (ESTABLISHED)
<...>
Then, by happenstance, I compared the entries in my config.prod.yml and dspace-ui.json and noticed that I had in dspace-ui.json:
"DSPACE_REST_PORT": "4000",
while it should be 8080. Changed it to 8080 and now starting and stopping dspace-ui.json goes well, no new errors in pm2 logs and the UI works well.