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

Build failed with an exception #559

Closed
RainCatalyst opened this issue Jul 13, 2021 · 5 comments
Closed

Build failed with an exception #559

RainCatalyst opened this issue Jul 13, 2021 · 5 comments
Labels
question Issue is a question

Comments

@RainCatalyst
Copy link

I was trying to run this example script, but it returns an error.

import minerl
import gym
import logging

logging.basicConfig(level=logging.DEBUG)

env = gym.make('MineRLTreechop-v0')
obs  = env.reset()

Here are the error messages (from the logger):

ERROR:minerl.env.malmo.instance.e929e1:FAILURE: Build failed with an exception.
ERROR:minerl.env.malmo.instance.e929e1:
ERROR:minerl.env.malmo.instance.e929e1:* What went wrong:
ERROR:minerl.env.malmo.instance.e929e1:Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
ERROR:minerl.env.malmo.instance.e929e1:> Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().
ERROR:minerl.env.malmo.instance.e929e1:
ERROR:minerl.env.malmo.instance.e929e1:* Try:
ERROR:minerl.env.malmo.instance.e929e1:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
ERROR:minerl.env.malmo.instance.e929e1:
ERROR:minerl.env.malmo.instance.e929e1:* Get more help at https://help.gradle.org
ERROR:minerl.env.malmo.instance.e929e1:
ERROR:minerl.env.malmo.instance.e929e1:BUILD FAILED in 0s

The errors say that I should run the build with --stacktrace option to get more information, but I'm not sure how to do it...

I have both JDK and JRE installed, both are version 8.
Python 3.9.6

@Miffyli Miffyli added the question Issue is a question label Jul 13, 2021
@Miffyli
Copy link
Contributor

Miffyli commented Jul 13, 2021

The information should be visible in the logs as. Can you paste/share the complete log that is printed once you run the code?

Also check the jdk/jre versions you are running with java -version. Only newer version of JDK 8 work, like jdk-8u291 or 153.

@RainCatalyst
Copy link
Author

Full log looks like this

C:\Program Files\Python39\lib\site-packages\gym\logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
INFO:minerl.env.malmo.instance.c63792:Starting Minecraft process: ['C:\Users\freee\AppData\Local\Temp\tmprmfhjytf\Minecraft\launchClient.bat', '-port', '9396', '-env', '-runDir', 'C:\Users\freee\AppData\Local\Temp\tmprmfhjytf\Minecraft\run']
INFO:process_watcher:Launhing process watcher daemonizer.
C:\Program Files\Python39\lib\site-packages\gym\logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
C:\Program Files\Python39\lib\runpy.py:127: 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))
C:\Program Files\Python39\lib\runpy.py:127: RuntimeWarning: 'daemoniker._daemonize_windows' found in sys.modules after import of package 'daemoniker', but prior to execution of 'daemoniker._daemonize_windows'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
INFO:process_watcher:Process watcher daemonizer launched successfully.
DEBUG:minerl.env.malmo.instance.c63792:Access is denied.
DEBUG:minerl.env.malmo.instance.c63792:
DEBUG:minerl.env.malmo.instance.c63792:FAILURE: Build failed with an exception.
DEBUG:minerl.env.malmo.instance.c63792:
DEBUG:minerl.env.malmo.instance.c63792:* What went wrong:
DEBUG:minerl.env.malmo.instance.c63792:Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
DEBUG:minerl.env.malmo.instance.c63792:> Could not create service of type CrossBuildFileHashCache using BuildSessionScopeServices.createCrossBuildFileHashCache().
DEBUG:minerl.env.malmo.instance.c63792:
DEBUG:minerl.env.malmo.instance.c63792:* Try:
DEBUG:minerl.env.malmo.instance.c63792:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
DEBUG:minerl.env.malmo.instance.c63792:
DEBUG:minerl.env.malmo.instance.c63792:* Get more help at https://help.gradle.org
DEBUG:minerl.env.malmo.instance.c63792:
DEBUG:minerl.env.malmo.instance.c63792:BUILD FAILED in 1s
The last few lines (starting from build failed) repeat as it tries to run the build again.

java -version returns

java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) Client VM (build 25.291-b10, mixed mode, sharing)

@Miffyli
Copy link
Contributor

Miffyli commented Jul 13, 2021

Quick googling suggests that it might be using newer Java version by accident: https://stackoverflow.com/questions/53272230/could-not-create-service-of-type-scriptpluginfactory-using-buildscopeservices-cr

Can you check javac -version?

If those fail, here are the java versions I use successfully:
Windows 10: 1.8.0_121
Ubuntu 20.04: openjdk version "1.8.0_292"

@RainCatalyst
Copy link
Author

I'm not sure what I did, but now it actually seems to start minecraft. It goes through the whole process of setting up the client (which takes around 2-3 minutes) each time I run it though and the minecraft window appears frozen (the agent seems to be running).

@Miffyli
Copy link
Contributor

Miffyli commented Jul 13, 2021

Yup that is correct! The window appears frozen, but as long things look good on Python side it is all good :).

(and yeah, "have you tried restarting it?" works many times with MineRL ^^).

Closing as solved.

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

No branches or pull requests

2 participants