Error when using h2o.init in R
This error message:
> h2o.init()
Error in dirname(path) : path too long
In addition: There were 12 warnings (use warnings() to see them)
This is one of the warning messages (others are similar):
> warnings()
Warning messages:
1: In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="\\FILE-EM1-06/USERDATA2$/john134/My Documents/./../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../..": The filename or extension is too long
Any idea how to get around this error?
thank
source to share
When h2o.init () is called, the R environment signal starts the h2o application (actually the web server) in the backend that was installed when the H2O package was installed in R. The local runtime uses the full path of the location where the H2O flags file is located. Since the packages are installed deep inside subfolders in your filesystem, it crosses the OS's allowed 256 character length limit and does not start the H2O back-back server, and you see this error. In your case, you are using an external path to add more characters to the path to make the problem worse.
For example h2o.jar is located on my OSX machine as shown below:
/Library/Frameworks/R.framework/Resources/library/h2o <- H2O package Path /Library/Frameworks/R.framework/Resources/library/h2o/java/h2o.jar <- Jar Path
As you use Windows you need to find ways to reduce this path to the OS limit and it will work.
Another solution is to run h2o.jar separately and then just use R to connect to the H2O cluster. The steps are as follows:
- Download H2O 3.10.4.2 and unzip the folder close to the root so you don't hit the 265 char anymore. Also install the 3.10.4.2 R package (Try to keep the same version)
- Run H2O> java -jar h2o.jar
- From RStudio console try> h2o.init ()
So, if an H2O cluster already exists, h2o.init () will connect to a running H2O cluster instead to start it up and you will get over the problem.
If you encounter any problem, write here and we will help you.
source to share
I have struggled a lot with this issue including updating.
Most people assume that you've literally just set an incredibly long path. I don’t think this is the case (it was not for me, at least). This means that PATH can be set on a network drive or other device where more complex paths appear more complex.
Related thread here on the H2O forum:
The main problem is that the user had a Windows drive that was out of order, ie "C: //" etc. Instead, the user had a network drive (
DTCHYB-AZPX015/)
). This caused problems when looking up the configuration file, since there was no "root" (in which case "root" reaches your Win drive). Since there was no "root", the search path continued to expand until it raised an R error with the above exception.The fix is to NOT look for configuration when called
h2o.init()
. Most likely only searching for the config if the user asks for it. My suggestion is to add a new field toh2o.init()
calledignore_config
. This will be set to TRUE by default.
source to share