When I used the prismarine-viewer to save the bot-view video, I got the problem.
OrilinZ opened this issue · 1 comments
OrilinZ commented
I changed the env/mineflayer/index.js
like:
try { require('node-canvas-webgl') } catch (e) { throw Error('node-canvas-webgl is not installed, you can install it with `npm install PrismarineJS/node-canvas-webgl`') }
const fs = require("fs");
const mineflayerViewer = require('prismarine-viewer').headless
In the bot.once("spawn", async () => {
part, I added the mineflayerViewer(bot, { output: '/data/zhz_data/Voyager/videos/output.mp4', frames: 200, width: 512, height: 512 });
to save the bot-view video.
When I ran the script, I got the problem:
Loading Skill Manager from ./skill_library/trial1/skill
Mineflayer process has exited, restarting
Subprocess mineflayer started with PID 1530107.
/data/zhz_data/Voyager/voyager/env/process_monitor.py:65: UserWarning: Subprocess mineflayer failed to start.
warnings.warn(f"Subprocess {self.name} failed to start.")
None
Traceback (most recent call last):
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/urllib3/connection.py", line 200, in _new_conn
sock = connection.create_connection(
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/urllib3/util/connection.py", line 85, in create_connection
raise err
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/urllib3/util/connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/urllib3/connectionpool.py", line 496, in _make_request
conn.request(
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/urllib3/connection.py", line 388, in request
self.endheaders()
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/http/client.py", line 980, in send
self.connect()
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/urllib3/connection.py", line 236, in connect
self.sock = self._new_conn()
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/urllib3/connection.py", line 215, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f80a2cc4bb0>: Failed to establish a new connection: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/urllib3/connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/urllib3/util/retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=3000): Max retries exceeded with url: /start (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f80a2cc4bb0>: Failed to establish a new connection: [Errno 111] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/zhz_data/Voyager/run_skill.py", line 27, in <module>
sub_goals = voyager.decompose_task(task=task)
File "/data/zhz_data/Voyager/voyager/voyager.py", line 377, in decompose_task
self.last_events = self.env.reset(
File "/data/zhz_data/Voyager/voyager/env/bridge.py", line 156, in reset
returned_data = self.check_process()
File "/data/zhz_data/Voyager/voyager/env/bridge.py", line 93, in check_process
res = requests.post(
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/data/zhz_data/anaconda3/envs/mc/lib/python3.9/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=3000): Max retries exceeded with url: /start (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f80a2cc4bb0>: Failed to establish a new connection: [Errno 111] Connection refused'))
In the log/mineflyaer:
2023-07-17 17:35:24,717 - mineflayer - INFO - Stopping subprocess.
2023-07-17 17:35:25,718 - mineflayer - INFO - Starting subprocess with commands: ['node', '/data/zhz_data/Voyager/voyager/env/mineflayer/index.js', '3000']
2023-07-17 17:35:26,572 - mineflayer - INFO - node:internal/modules/cjs/loader:1080
2023-07-17 17:35:26,573 - mineflayer - INFO - throw err;
2023-07-17 17:35:26,573 - mineflayer - INFO - ^
2023-07-17 17:35:26,573 - mineflayer - INFO -
2023-07-17 17:35:26,573 - mineflayer - INFO - Error: Cannot find module '../../public/supportedVersions.json'
2023-07-17 17:35:26,573 - mineflayer - INFO - Require stack:
2023-07-17 17:35:26,573 - mineflayer - INFO - - /data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/viewer/lib/version.js
2023-07-17 17:35:26,573 - mineflayer - INFO - - /data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/viewer/lib/viewer.js
2023-07-17 17:35:26,573 - mineflayer - INFO - - /data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/viewer/index.js
2023-07-17 17:35:26,573 - mineflayer - INFO - - /data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/lib/mineflayer.js
2023-07-17 17:35:26,573 - mineflayer - INFO - - /data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/index.js
2023-07-17 17:35:26,573 - mineflayer - INFO - - /data/zhz_data/Voyager/voyager/env/mineflayer/index.js
2023-07-17 17:35:26,573 - mineflayer - INFO - at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
2023-07-17 17:35:26,573 - mineflayer - INFO - at Module._load (node:internal/modules/cjs/loader:922:27)
2023-07-17 17:35:26,573 - mineflayer - INFO - at Module.require (node:internal/modules/cjs/loader:1143:19)
2023-07-17 17:35:26,573 - mineflayer - INFO - at require (node:internal/modules/cjs/helpers:110:18)
2023-07-17 17:35:26,573 - mineflayer - INFO - at Object.<anonymous> (/data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/viewer/lib/version.js:1:27)
2023-07-17 17:35:26,573 - mineflayer - INFO - at Module._compile (node:internal/modules/cjs/loader:1256:14)
2023-07-17 17:35:26,573 - mineflayer - INFO - at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
2023-07-17 17:35:26,573 - mineflayer - INFO - at Module.load (node:internal/modules/cjs/loader:1119:32)
2023-07-17 17:35:26,573 - mineflayer - INFO - at Module._load (node:internal/modules/cjs/loader:960:12)
2023-07-17 17:35:26,573 - mineflayer - INFO - at Module.require (node:internal/modules/cjs/loader:1143:19) {
2023-07-17 17:35:26,573 - mineflayer - INFO - code: 'MODULE_NOT_FOUND',
2023-07-17 17:35:26,573 - mineflayer - INFO - requireStack: [
2023-07-17 17:35:26,573 - mineflayer - INFO - '/data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/viewer/lib/version.js',
2023-07-17 17:35:26,573 - mineflayer - INFO - '/data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/viewer/lib/viewer.js',
2023-07-17 17:35:26,573 - mineflayer - INFO - '/data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/viewer/index.js',
2023-07-17 17:35:26,573 - mineflayer - INFO - '/data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/lib/mineflayer.js',
2023-07-17 17:35:26,573 - mineflayer - INFO - '/data/zhz_data/Voyager/voyager/env/mineflayer/node_modules/prismarine-viewer/index.js',
2023-07-17 17:35:26,573 - mineflayer - INFO - '/data/zhz_data/Voyager/voyager/env/mineflayer/index.js'
2023-07-17 17:35:26,573 - mineflayer - INFO - ]
2023-07-17 17:35:26,573 - mineflayer - INFO - }
2023-07-17 17:35:26,574 - mineflayer - INFO -
2023-07-17 17:35:26,574 - mineflayer - INFO - Node.js v18.16.1
What can I do ?