Closed thatCode-Psy closed 4 years ago
Hm, it looks like an issue trying to open a Unix socket for the server-side REPL.
I believe my latest commit fixes your problem. Can you try it and report back?
(Also, master's project? That sounds really cool! Can you send me your results when you're done?)
That did not appear to fix the problem. I am still getting identical errors. (Would you rather I email or just use this thread for discussion of my master's project?)
Could you paste the most recent error? If the error is literally identical (down to the line number), it sounds like you didn't successfully update to the latest version in master.
(This thread isn't a bad place for discussion of your master's project, I think.)
It appears that the locations of the errors errors being spit out by the console are different than the errors in the errors.txt file. I copied a large snippet of the errors as they are coming from different places seemingly at random. The cut errors were put into output.txt. They all seem to be CRASH: Error: listen ENOTSUP: operation not supported on socket coming from the locations repl/verifier, repl/app, repl/team-validator-379, and repl/sim-358. errors.txt output.txt
(My master's project is attempting to make a transfer learning agent in random battle. The idea is that by learning how to perform well in one generation, it should then take less time to train in a different generation. Since Pokemon generations are fairly similar domains, I will also be using this project to test some conclusions made in other transfer learning papers on the best form of transfer between similar domains. The project is still in its early stages so I don't have much in the way of results at the moment. It was only today that I got my first instance of very rudimentary transfer. The transfer was from training in generation 1 to using the model in generation 2 and it seems to work. I still need to figure out exactly what state information I plan on storing, the exact makeup of the dqn, and how to reinitialize specific layers between transfers.)
It's very very weird to me that the try-block isn't catching the error in the crash report.
I pushed a change which might work; I'll reboot into Windows 10 and try to see the errors in for myself if it continues to fail.
(Your master's project sounds really cool! Please send me the paper when you're done!)
I pulled the commit, but it doesn't seem to fix the problem. The errors seem to be pretty much the same besides the changed line numbers from the commit but I'll post them anyway in case I missed something. output.txt
As a stopgap, you should set the repl
setting in config/config.js
to false
, which I believe will fix this.
The stopgap does work. What does setting repl to false disable?
The repl
feature allows you to use Unix sockets to connect to a REPL for directly executing code in a PS process. It was crashing WSL2 because WSL2 apparently doesn't support Unix sockets in whatever virtual filesystem Docker is using (I don't understand how the errors are bypassing the try
-block, though). It's documented here:
https://github.com/smogon/pokemon-showdown/tree/master/logs/repl
I've personally only used it once, five years ago. Normally, /eval
and /evalbattle
are good enough for tinkering with live code, on the rare occasions it's necessary at all.
I haven't used repl
since the streams refactor which made it really difficult to locate the Battle object for a given battle (streams used to be indexed by room id but now they're just autonumbered).
@urkerab
Still simpler for me to use >>> battle
directly, though.
I don't know how WSL factors into the equation, but unix socket issues with Docker can be worked around by writing the socket to /dev/shm
edit: (linux only) can also use the "abstract namespace" to avoid binding the socket to the filesystem at all, an abstract address looks something like "\0arbitrarystringhere"
After three reboots, Windows deigns to tell me that my computer doesn't support version 2004 which is required for WSL2. I had no clue it could possibly be this bad, but unfortunately this means I have no way of testing this for myself.
I notably do not have Docker installed on the computer that I am running the showdown server from anymore. I uninstalled when I first was having problems which helped lead to the conclusion that wsl2 is likely the source (also that by switching back to wsl1 fixes it).
Im running arch linux WSL2:
root@MUTHR /m/g/c/pokemon-showdown (master) [SIGINT]# n latest
installing : node-v20.1.0
mkdir : /usr/local/n/versions/node/20.1.0
fetch : https://nodejs.org/dist/v20.1.0/node-v20.1.0-linux-x64.tar.xz
copying : node/20.1.0
installed : v20.1.0 (with npm 9.6.4)
root@MUTHR /m/g/c/pokemon-showdown (master)# node pokemon-showdown
^[[B
CRASH: Error: listen ENOTSUP: operation not supported on socket /mnt/g/code/pokemon-showdown/logs/repl/team-validator-12860
at Server.setupListenHandle [as _listen2] (node:net:1806:21)
at listenInCluster (node:net:1871:12)
at Server.listen (node:net:1970:5)
at Object.start (/mnt/g/code/pokemon-showdown/dist/lib/repl.js:143:14)
at Object.<anonymous> (/mnt/g/code/pokemon-showdown/dist/server/team-validator-async.js:95:31)
at Module._compile (node:internal/modules/cjs/loader:1267:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1321:10)
at Module.load (node:internal/modules/cjs/loader:1125:32)
at Module._load (node:internal/modules/cjs/loader:965:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
RESTORE CHATROOM: lobby
RESTORE CHATROOM: staff
Worker 1 now listening on 0.0.0.0:8000
Test your server at http://localhost:8000
i changed exports.repl = false;
in config.js
and it still wont load. what am i doing wrong?
I switched to WSL2 (Windows Subsystem for Linux) to run Docker Desktop for Windows which caused me to be unable to run the server locally without it erroring. I switched back to WSL1 and it worked. I am running the Ubuntu 18.04 LTS distro. The error file is included.
errors.txt