cocacola-lab / MineLand

Simulating Large-Scale Multi-Agent Interactions with Limited Multimodal Senses and Physical Needs
MIT License
54 stars 9 forks source link

urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)) #14

Closed Raven-July closed 3 months ago

Raven-July commented 3 months ago

I installed the code on my windows 10. The versions of python,nodejs and java are correct. everything went well entil i ran validate-install-simulator.py. I got ConnectionResetError.

The output is as followed:

E:\Python_Projects\MineLand\venv\Scripts\python.exe E:\Python_Projects\MineLand\scripts\validate_install_simulator.py [Tasks] task mode has been modified as cooperative [Tasks] Agent(s) need to survive for 0.01 days (240.0 ticks) [MineLand] MineLand Simulator is initializing... [MineLand] Starting server... [Server] Start to listen outputs. [Server] Starting net.fabricmc.loader.impl.game.minecraft.BundlerClassPathCapture [Server] [00:25:53] [main/INFO]: Loading Minecraft 1.19 with Fabric Loader 0.14.18 [Server] [00:25:53] [main/INFO]: Loading 46 mods: [Server] - better_respawn 1.19-2.0.0 [Server] - completeconfig 2.0.0 [Server] |-- coat 1.0.0-beta.17+mc22w17a [Server] |-- completeconfig-base 2.0.0 [Server] |-- completeconfig-gui-cloth 2.0.0 [Server] -- completeconfig-gui-coat 2.0.0 [Server] - fabric 0.58.0+1.19 [Server] |-- fabric-api-base 0.4.9+e62f51a3a9 [Server] |-- fabric-api-lookup-api-v1 1.6.7+9ff28f40a9 [Server] |-- fabric-biome-api-v1 9.0.14+b2a4a624a9 [Server] |-- fabric-blockrenderlayer-v1 1.1.18+9ff28f40a9 [Server] |-- fabric-command-api-v1 1.2.6+f71b366fa9 [Server] |-- fabric-command-api-v2 2.1.2+0d55f585a9 [Server] |-- fabric-commands-v0 0.2.23+df3654b3a9 [Server] |-- fabric-containers-v0 0.1.28+df3654b3a9 [Server] |-- fabric-content-registries-v0 3.2.1+07df213ea9 [Server] |-- fabric-convention-tags-v1 1.0.8+37622d24a9 [Server] |-- fabric-crash-report-info-v1 0.2.3+bd0a0d4aa9 [Server] |-- fabric-data-generation-api-v1 5.1.2+a680b9b4a9 [Server] |-- fabric-dimensions-v1 2.1.28+a6d2f785a9 [Server] |-- fabric-entity-events-v1 1.4.16+9ff28f40a9 [Server] |-- fabric-events-interaction-v0 0.4.26+9ff28f40a9 [Server] |-- fabric-events-lifecycle-v0 0.2.26+df3654b3a9 [Server] |-- fabric-game-rule-api-v1 1.0.19+18990361a9 [Server] |-- fabric-item-api-v1 1.5.5+35a03c43a9 [Server] |-- fabric-item-groups-v0 0.3.26+9ff28f40a9 [Server] |-- fabric-key-binding-api-v1 1.0.18+9ff28f40a9 [Server] |-- fabric-keybindings-v0 0.2.16+df3654b3a9 [Server] |-- fabric-lifecycle-events-v1 2.1.0+33fbc738a9 [Server] |-- fabric-loot-api-v2 1.1.1+03a4e568a9 [Server] |-- fabric-loot-tables-v1 1.1.4+9e7660c6a9 [Server] |-- fabric-message-api-v1 1.0.1+513f4a59a9 [Server] |-- fabric-mining-level-api-v1 2.1.11+33fbc738a9 [Server] |-- fabric-models-v0 0.3.15+9ff28f40a9 [Server] |-- fabric-networking-api-v1 1.1.0+442de8b8a9 [Server] |-- fabric-networking-v0 0.3.15+df3654b3a9 [Server] |-- fabric-object-builder-api-v1 4.0.8+9ff28f40a9 [Server] |-- fabric-particles-v1 1.0.8+dc39553aa9 [Server] |-- fabric-registry-sync-v0 0.9.18+23c4cfefa9 [Server] |-- fabric-renderer-api-v1 1.0.8+9ff28f40a9 [Server] |-- fabric-renderer-indigo 0.6.10+5187d39fa9 [Server] |-- fabric-renderer-registries-v1 3.2.18+df3654b3a9 [Server] |-- fabric-rendering-data-attachment-v1 0.3.12+9ff28f40a9 [Server] |-- fabric-rendering-fluids-v1 3.0.5+9ff28f40a9 [Server] |-- fabric-rendering-v0 1.1.20+df3654b3a9 [Server] |-- fabric-rendering-v1 1.10.14+9ff28f40a9 [Server] |-- fabric-resource-conditions-api-v1 2.0.9+e62f51a3a9 [Server] |-- fabric-resource-loader-v0 0.5.6+5f1a85e0a9 [Server] |-- fabric-screen-api-v1 1.0.24+f05effafa9 [Server] |-- fabric-screen-handler-api-v1 1.2.7+9ff28f40a9 [Server] |-- fabric-textures-v0 1.0.18+9ff28f40a9 [Server] |-- fabric-transfer-api-v1 2.0.9+e62f51a3a9 [Server] -- fabric-transitive-access-wideners-v1 1.1.1+9e7660c6a9 [Server] - fabricloader 0.14.18 [Server] - java 17 [Server] - minecraft 1.19 [Server] - multiworld 1.5 [Server] -- fantasy 0.4.5+1.19 [Server] - serverpause 1.1.0 [Server] - testmod 1.0 [Server] [00:25:53] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/E:/Python_Projects/MineLand/mineland/sim/server/libraries/net/fabricmc/sponge-mixin/0.12.4+mixin.0.8.5/sponge-mixin-0.12.4+mixin.0.8.5.jar Service=Knot/Fabric Env=SERVER [Server] [00:25:54] [main/INFO]: Compatibility level set to JAVA_17 [Server] [00:25:54] [main/WARN]: Reference map 'runtick-refmap.json' for tutorial_mod1.mixins.json could not be read. If this is a development environment you can ignore this message [Server] [00:25:59] [main/INFO]: Building unoptimized datafixer [Server] [00:26:01] [main/INFO]: [STDOUT]: Multiworld init [Server] [00:26:02] [main/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD' [Server] [00:26:04] [main/INFO]: Loaded 7 recipes [Server] [00:26:04] [main/INFO]: Loaded 1179 advancements [Server] [00:26:05] [main/INFO]: Applied 0 biome modifications to 0 of 63 new biomes in 3.166 ms [Server] [00:26:05] [Server thread/INFO]: Starting minecraft server version 1.19 [Server] [00:26:05] [Server thread/INFO]: Loading properties [Server] [00:26:05] [Server thread/INFO]: Default game type: SURVIVAL [Server] [00:26:05] [Server thread/INFO]: Generating keypair [Server] [00:26:05] [Server thread/INFO]: Starting Minecraft server on *:25565 [Server] [00:26:05] [Server thread/INFO]: Using default channel type [Server] [00:26:05] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE! [Server] [00:26:05] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware. [Server] [00:26:05] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose. [Server] [00:26:05] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file. [Server] [00:26:05] [Server thread/INFO]: Preparing level "world" [Server] [00:26:06] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld [Server] [00:26:08] [Worker-Main-8/INFO]: Preparing spawn area: 0% [Server] [00:26:08] [Worker-Main-1/INFO]: Preparing spawn area: 0% [Server] [00:26:08] [Worker-Main-8/INFO]: Preparing spawn area: 0% [Server] [00:26:08] [Worker-Main-11/INFO]: Preparing spawn area: 0% [Server] [00:26:08] [Worker-Main-11/INFO]: Preparing spawn area: 0% [Server] [00:26:08] [Worker-Main-7/INFO]: Preparing spawn area: 0% [Server] [00:26:09] [Worker-Main-10/INFO]: Preparing spawn area: 49% [Server] [00:26:09] [Server thread/INFO]: Time elapsed: 3401 ms

[MineLand] Server started. [MineLand] Pause is disabled! [MineLand] Mineflayer is starting. [Mineflayer] Start to listen stdout. [Mineflayer] JS side listener started on port 21301 [MineLand] Mineflayer started. [MineLand] MineLand Simulator is initialized. [MineLand] Starting reset... This may take a few seconds. [Mineflayer] 0 : MineflayerBot0 [Mineflayer] node:internal/process/promises:288 [Mineflayer] triggerUncaughtException(err, true / fromPromise /); [Mineflayer] ^ [Mineflayer] AssertionError [ERR_ASSERTION]: plugin needs to be a function [Mineflayer] at EventEmitter.loadPlugin (E:\Python_Projects\MineLand\mineland\sim\mineflayer\node_modules\mineflayer\lib\plugin_loader.js:16:12) [Mineflayer] at BotManager.createBot (E:\Python_Projects\MineLand\mineland\sim\mineflayer\bot_manager.js:68:9) [Mineflayer] at E:\Python_Projects\MineLand\mineland\sim\mineflayer\index.js:39:21 { [Mineflayer] generatedMessage: false, [Mineflayer] code: 'ERR_ASSERTION', [Mineflayer] actual: false, [Mineflayer] expected: true, [Mineflayer] operator: '==' [Mineflayer] } [Mineflayer] Node.js v18.18.0 Traceback (most recent call last): File "E:\Python_Projects\MineLand\venv\Lib\site-packages\urllib3\connectionpool.py", line 789, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\urllib3\connectionpool.py", line 536, in _make_request response = conn.getresponse() ^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\urllib3\connection.py", line 464, in getresponse httplib_response = super().getresponse() ^^^^^^^^^^^^^^^^^^^^^ File "D:\NEWNEWNEW\python3.11\Lib\http\client.py", line 1390, in getresponse response.begin() File "D:\NEWNEWNEW\python3.11\Lib\http\client.py", line 325, in begin version, status, reason = self._read_status() ^^^^^^^^^^^^^^^^^^^ File "D:\NEWNEWNEW\python3.11\Lib\http\client.py", line 286, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\NEWNEWNEW\python3.11\Lib\socket.py", line 706, in readinto return self._sock.recv_into(b) ^^^^^^^^^^^^^^^^^^^^^^^ ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:\Python_Projects\MineLand\venv\Lib\site-packages\requests\adapters.py", line 667, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\urllib3\connectionpool.py", line 843, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\urllib3\util\retry.py", line 474, in increment raise reraise(type(error), error, _stacktrace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\urllib3\util\util.py", line 38, in reraise raise value.with_traceback(tb) File "E:\Python_Projects\MineLand\venv\Lib\site-packages\urllib3\connectionpool.py", line 789, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\urllib3\connectionpool.py", line 536, in _make_request response = conn.getresponse() ^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\urllib3\connection.py", line 464, in getresponse httplib_response = super().getresponse() ^^^^^^^^^^^^^^^^^^^^^ File "D:\NEWNEWNEW\python3.11\Lib\http\client.py", line 1390, in getresponse response.begin() File "D:\NEWNEWNEW\python3.11\Lib\http\client.py", line 325, in begin version, status, reason = self._read_status() ^^^^^^^^^^^^^^^^^^^ File "D:\NEWNEWNEW\python3.11\Lib\http\client.py", line 286, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\NEWNEWNEW\python3.11\Lib\socket.py", line 706, in readinto return self._sock.recv_into(b) ^^^^^^^^^^^^^^^^^^^^^^^ urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:\Python_Projects\MineLand\scripts\validate_install_simulator.py", line 10, in obs = mland.reset() ^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\mineland\tasks\survival_task.py", line 28, in reset obs = self.env.reset() ^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\mineland\sim\sim.py", line 147, in reset obs = self.bridge.reset() ^^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\mineland\sim\bridge.py", line 65, in reset res = requests.post( ^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\requests\api.py", line 115, in post return request("post", url, data=data, json=json, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Python_Projects\MineLand\venv\Lib\site-packages\requests\adapters.py", line 682, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))

I‘ve encountered similar problems while playing with Voyager. But this time the reason seems to be different, and i haven't figured out why.

YXHXianYu commented 3 months ago

According to this log:

[Mineflayer] AssertionError [ERR_ASSERTION]: plugin needs to be a function [Mineflayer] at EventEmitter.loadPlugin (E:\Python_Projects\MineLand\mineland\sim\mineflayer\node_modules\mineflayer\lib\plugin_loader.js:16:12) [Mineflayer] at BotManager.createBot (E: \Python_Projects\MineLand\mineland\sim\mineflayer\bot_manager.js:68:9) [Mineflayer] at E:\Python_Projects\MineLand\mineland\sim\mineflayer\index.js:39:21 {

The exception occurs in MineLand\mineland\sim\mineflayer\bot_manager.js:68:9: bot.loadPlugin(minecraftHawkEye).

And according to this issue, this exception may be caused by out-of-date node.js package.

The correct 'minecrafthawkeye` version is 1.3.6 or newer.

Could you check your minecrafthawkeye version?

Also, you can use package-lock.json to make sure your node.js packages versions are correct.

Raven-July commented 3 months ago

it seems to be the problem with packages, it did not help even i updated minecrafthawkeye by the way,i forgot to say that on windows10 i failed to run "npm ci",it sayed

Cannot read properties of undefined (reading 'abort-controller')

so instead i ran npm instasll,which might cause a series of version stuff problems.

after all that, i moved on to install the code on a docker i created, and finally successed! (problem on windows 10 unsolved yet)

YXHXianYu commented 3 months ago

Nice! I'm glad to see that you have succeed on a docker.

And according to your description, I guess the problem may be caused by npm version or npm registry?

I tried the latest version of npm (10.8.2) and the official npm registry (https://registry.npmjs.org/), and succeed.

Raven-July commented 3 months ago

thanks! I solved all the problems by updating to the latest version of npm. Now everything goes well.

YXHXianYu commented 3 months ago

Nice