smogon / pokemon-showdown

Pokémon battle simulator.
https://pokemonshowdown.com
MIT License
4.77k stars 2.79k forks source link

Showdown server crash on start #8469

Closed hsahovic closed 3 years ago

hsahovic commented 3 years ago

Hello,

I have a CI script that has been relying on showdown for more than a year that has started breaking unexpectedly in the last few days. It runs on an ubuntu server distro.

The relevant steps are:

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

git clone https://github.com/smogon/pokemon-showdown.git

cd pokemon-showdown
npm install
cp config/config-example.js config/config.js

node pokemon-showdown start --no-security

The complete circle ci config file can be found here.

Running the above leads to:

Could not start REPL server "friends-1787": Your filesystem doesn't support Unix sockets (everything else will still work)
RESTORE CHATROOM: lobby
RESTORE CHATROOM: staff

CRASH: Error: ENOENT: no such file or directory, scandir '/home/circleci/repo/pokemon-showdown/logs/repl'
    at Object.readdirSync (fs.js:1043:3)
    at _class.start (/home/circleci/repo/pokemon-showdown/lib/repl.ts:76:26)
    at Object.<anonymous> (/home/circleci/repo/pokemon-showdown/server/index.ts:178:6)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Module.m._compile (/home/circleci/repo/pokemon-showdown/node_modules/ts-node/src/index.ts:1310:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Object.require.extensions.<computed> [as .ts] (/home/circleci/repo/pokemon-showdown/node_modules/ts-node/src/index.ts:1313:12)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Object.<anonymous> (/home/circleci/repo/pokemon-showdown/pokemon-showdown:134:22)

SUBCRASH: Error: ENOENT: no such file or directory, open '/home/circleci/repo/pokemon-showdown/logs/errors.txt'

Could not start REPL server "verifier": Your filesystem doesn't support Unix sockets (everything else will still work)
Could not start REPL server "sockets-1-1964": Your filesystem doesn't support Unix sockets (everything else will still work)
Worker 1 now listening on 0.0.0.0:8000
Test your server at http://localhost:8000
Could not start REPL server "sim-1932": Your filesystem doesn't support Unix sockets (everything else will still work)
Could not start REPL server "friends-2037": Your filesystem doesn't support Unix sockets (everything else will still work)
Could not start REPL server "chat-db": Your filesystem doesn't support Unix sockets (everything else will still work)
Could not start REPL server "team-validator-1762": Your filesystem doesn't support Unix sockets (everything else will still work)
Could not start REPL server "battlesearch": Your filesystem doesn't support Unix sockets (everything else will still work)
listening for hook events on 0.0.0.0:3420

CRASH: Error: ENOENT: no such file or directory, open '/home/circleci/repo/pokemon-showdown/logs/chatlog-access.txt'

CRASH: Error: ENOENT: no such file or directory, open '/home/circleci/repo/pokemon-showdown/logs/responder.jsonl'

SUBCRASH: Error: ENOENT: no such file or directory, open '/home/circleci/repo/pokemon-showdown/logs/errors.txt'

SUBCRASH: Error: ENOENT: no such file or directory, open '/home/circleci/repo/pokemon-showdown/logs/errors.txt'

Could not start REPL server "chatlog": Your filesystem doesn't support Unix sockets (everything else will still work)

CRASH: Error: ENOENT: no such file or directory, open '/home/circleci/repo/pokemon-showdown/logs/chatlog-access.txt'

SUBCRASH: Error: ENOENT: no such file or directory, open '/home/circleci/repo/pokemon-showdown/logs/errors.txt'

Could not start REPL server "netfilters": Your filesystem doesn't support Unix sockets (everything else will still work)
Could not start REPL server "friends-2194": Your filesystem doesn't support Unix sockets (everything else will still work)
Could not start REPL server "dexsearch": Your filesystem doesn't support Unix sockets (everything else will still work)

Additionally, it seems like a similar issue arose for @godpow both on linux and windows as they mentioned in this issue.

Any idea what may be causing this, and how to fix it?

mia-pi-git commented 3 years ago

Do you maybe not have a logs/ directory? That seems like the issue here..?

hsahovic commented 3 years ago

The very same CI script was working three weeks ago, and it seems to be affecting @godpow on a regular desktop version of ubuntu and windows, as well as on WSL.

Edit: it was three weeks ago, not last week

mia-pi-git commented 3 years ago

It seems like the issue is you don't have a logs directory. We haven't changed anything in Repl lately so I'm not sure it's on our end.

mia-pi-git commented 3 years ago

Oh, the issue is literally that we've stopped shipping logs/ in the repo. Making the directory should fix it for now. @Zarel, why remove the READMEs that anchored it? Or even just logs/logging.md? (https://github.com/smogon/pokemon-showdown/commit/7811795344da5d5dbc8b84b480ec819e652bdcb9#diff-3352d5f3892c9cc9cceda0cd4ad648baf3385bcd7b75659f4a37706bd2a8b4a4)

godpow commented 3 years ago

When you make the logs folder on windows it'll make the errors.txt appear but still an issue with CRASH: Error: ENOENT: no such file or directory, scandir 'C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\logs\repl' at Object.readdirSync (node:fs:1390:3) at _class.start (C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\lib\repl.ts:12:16) at Object. (C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\server\index.ts:173:11) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Module.m._compile (C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\node_modules\ts-node\src\index.ts:1310:23) at Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Object.require.extensions. [as .ts] (C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\node_modules\ts-node\src\index.ts:1313:12) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Object. (C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\pokemon-showdown:134:22)

mia-pi-git commented 3 years ago

When you make the logs folder on windows it'll make the errors.txt appear but still an issue with CRASH: Error: ENOENT: no such file or directory, scandir 'C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\logs\repl' at Object.readdirSync (node:fs:1390:3) at _class.start (C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\lib\repl.ts:12:16) at Object. (C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\server\index.ts:173:11) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Module.m._compile (C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\node_modules\ts-node\src\index.ts:1310:23) at Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Object.require.extensions. [as .ts] (C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\node_modules\ts-node\src\index.ts:1313:12) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Object. (C:\Users\CyberKira\Documents\pokemon showdown\pokemon-showdown\pokemon-showdown:134:22)

You need to make a logs/repl dir as well. This i'll push a fix for right now, since it's easier.

mia-pi-git commented 3 years ago

https://github.com/smogon/pokemon-showdown/commit/e08e1a9cf08545f4f85afb959e51b9c071e0c0df should fix the logs/repl errors.

hsahovic commented 3 years ago

Thanks a lot @mia-pi-git! Much appreciated :)

mia-pi-git commented 3 years ago

Hm. It looks like when rooms are created, it creates the roomlog dir, and any parent directories needed. That should fix that part?

Zarel commented 3 years ago

Should be fixed by 66a0497a8bbd5f3c if whatever stuff in here wasn't enough.