Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running into an issue with env.reset() #783

Open
vinal-gadhiya opened this issue Aug 30, 2024 · 1 comment
Open

Running into an issue with env.reset() #783

vinal-gadhiya opened this issue Aug 30, 2024 · 1 comment

Comments

@vinal-gadhiya
Copy link

minerl version: 1.0.2
Running into an issue when running it in docker container using:
docker run -it --gpus all -v $PWD:/workspace -u $(id -u):$(id -g) vinal/rl-minerl:minerl-flags sh xvfb_run.sh python3 minecraft_env.py

Error message:
INFO:minerl.env.malmo.instance.e7826b:Starting Minecraft process: ['/opt/conda/lib/python3.10/site-packages/minerl/env/../MCP-Reborn/launchClient.sh', '-port', '9358', '-env', '-runDir', '/opt/conda/lib/python3.10/site-packages/minerl/env/../MCP-Reborn/run']
INFO:process_watcher:Launching process watcher daemonizer.
/opt/conda/lib/python3.10/runpy.py:126: RuntimeWarning: 'minerl.utils.process_watcher' found in sys.modules after import of package 'minerl.utils', but prior to execution of 'minerl.utils.process_watcher'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
Unable to acquire PID file.
Traceback (most recent call last):
File "/workspace/minecraft_env.py", line 11, in
obs = env.reset()
File "/opt/conda/lib/python3.10/site-packages/gym/wrappers/time_limit.py", line 26, in reset
return self.env.reset(**kwargs)
File "/opt/conda/lib/python3.10/site-packages/gym/wrappers/order_enforcing.py", line 18, in reset
return self.env.reset(**kwargs)
File "/opt/conda/lib/python3.10/site-packages/minerl/herobraine/env_specs/obtain_specs.py", line 60, in reset
obs = super().reset()
File "/opt/conda/lib/python3.10/site-packages/gym/core.py", line 283, in reset
return self.env.reset(**kwargs)
File "/opt/conda/lib/python3.10/site-packages/minerl/env/_singleagent.py", line 22, in reset
multi_obs = super().reset()
File "/opt/conda/lib/python3.10/site-packages/minerl/env/_multiagent.py", line 436, in reset
self._setup_instances()
File "/opt/conda/lib/python3.10/site-packages/minerl/env/_multiagent.py", line 539, in _setup_instances
self.instances.extend([f.result() for f in instance_futures])
File "/opt/conda/lib/python3.10/site-packages/minerl/env/_multiagent.py", line 539, in
self.instances.extend([f.result() for f in instance_futures])
File "/opt/conda/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/opt/conda/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/opt/conda/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/opt/conda/lib/python3.10/site-packages/minerl/env/_multiagent.py", line 805, in _get_new_instance
instance.launch(replaceable=self._is_fault_tolerant)
File "/opt/conda/lib/python3.10/site-packages/minerl/env/malmo.py", line 427, in launch
self.watcher_process = minerl.utils.process_watcher.launch(
File "/opt/conda/lib/python3.10/site-packages/minerl/utils/process_watcher.py", line 51, in launch
subprocess.check_call([
File "/opt/conda/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/conda/bin/python3', '-m', 'minerl.utils.process_watcher', '21', '30', '--child-dirs', '/opt/conda/lib/python3.10/site-packages/minerl/env/../MCP-Reborn/..']' returned non-zero exit status 1.

@Miffyli
Copy link
Contributor

Miffyli commented Aug 31, 2024

Heya. Unfortunately this escapes a little bit outside our knowledge zone, as you run MineRL inside the docker and we have not shared official docker images / worked on making sure that works well. What is happening here is that Minecraft is failing to run, and Python then fails to connect, and fails as well.

This seems to be the error:

Unable to acquire PID file.

Enable higher level logging to see more information about the MineRL process itself with

import logging
logging.basicConfig(level=logging.DEBUG)

Also try dropping into the shell in docker image instead of running the command directly for easier debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants