Re: Errors running H2O in R

1,586 views
Skip to first unread message

Tom Kraljevic

unread,
Jul 1, 2015, 4:27:50 PM7/1/15
to Matt H, h2ostream, Neeraja Madabhushi

Matt, I suggest trying to start h2o by hand rom the command line first.
Then try to connect to it from R to see if that behaves differently.

How much memory do you have on your system?
Make sure you have 64-bit java.


On Jul 1, 2015, at 12:43 PM, Matt H <matt....@outlook.com> wrote:

I am trying to run H2O within R and continue to experience errors even when following the simple guide here: http://s3.amazonaws.com/h2o-release/h2o/master/3060/index.html

I experience the problem running in either R (3.2.1) or RStudio (0.99.447) within Windows 7 x64.  Java version is 1.8

The H2O package successfully installs and loads with >library(h2o).  When running h2o.init(), the temp log dir is created in C;\Users\user\AppData\Local\Temp\RTempDir.

At this point I usually get and error about not having permissions to the .out file.  Sometime is will print the contents of the file when I run the h2o.jar from a command window.  Regardless of the error, I am able to go to localhost:54321 and the H2O Flow page loads.  But when running any of the Demo examples demo(h2o.kmeans) or demo(h2o.deeplearning) I will get an error like below, even though the site is up and running.

Error in h2o.init(ip = "localhost", port = 54321, startH2O = FALSE) : 
  Cannot connect to H2O server. Please check that H2O is running at http://localhost:54321/

Why will the R examples not work correctly?

Also, it appears that when running a R demo, it will try to run h2o.init again even though all examples show this needing to be run first.

Any help would be appreciated.

Matt

ke...@0xdata.com

unread,
Jul 2, 2015, 4:05:34 AM7/2/15
to h2os...@googlegroups.com, matt....@outlook.com, nee...@h2o.ai
Matt
I've not checked with Flow, but earlier versions of h2o couldn't work with the IE 8,9,10 browsers, because microsoft put in some additional protections in the browser to safeguard against malware going to the local machine. (localhost or 127.0.0.1)

I would additionally suggest trying another browser (Firefox or Chrome).

I should check for myself whether IE works with h2o 3.0, but I know there were issues with h2o before 3.0.

-kevin

ke...@0xdata.com

unread,
Jul 2, 2015, 4:06:53 AM7/2/15
to h2os...@googlegroups.com, matt....@outlook.com, nee...@h2o.ai, ke...@0xdata.com
h2o.init() should be legal to do at any time.
If you're already connected, I believe it does nothing

-kevin

Matt H

unread,
Jul 2, 2015, 8:55:05 AM7/2/15
to ke...@0xdata.com, h2os...@googlegroups.com, nee...@h2o.ai
Kevin - 

Thanks for the responses.  I am running this on a machine with 8 GB memory.  I can start H2O just fine through a console with (java -Xmx1g -jar h2o.jar) but when running h2o.init() in R after it is running in the console I get a couple errors.  In the R console there is  FATAL message (FATAL: On /127.0.0.1 some of the required ports 54321, 54322 are not available, change -port PORT and try again. )

Error in h2o.init() : H2O failed to start, stopping execution.
In addition: Warning message:
running command 'curl 'http://localhost:54321'' had status 1 

I wonder if part of this has to do with Windows and Curl not liking single ticks and needs quotes?

Even though these messages show up, I can open http://localhost:54321 in Chrome and get to the H2O FLow UI.  

When trying to run one of the demo functions, it shows (localH2O = h2o.init(ip = "localhost", port = 54321, startH2O = TRUE)).  Shouldn't startH2O be FALSE since it is running in the console already?

When trying to run (localH2O = h2o.init(ip = "localhost", port = 54321, startH2O = TRUE)) manually, this error shows up, even though the console version is still running:

Error in h2o.init(ip = "localhost", port = 54321, startH2O = FALSE) : 
  Cannot connect to H2O server. Please check that H2O is running at http://localhost:54321/

Could this all have to do with curl not being able to connect since it is called with ticks and not quotes?

I'm also running 64 bit Java.

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)


Matt



> Date: Thu, 2 Jul 2015 01:06:53 -0700
> From: ke...@0xdata.com
> To: h2os...@googlegroups.com
> CC: matt....@outlook.com; nee...@h2o.ai; ke...@0xdata.com
> Subject: Re: Errors running H2O in R

Matt H

unread,
Jul 2, 2015, 12:35:50 PM7/2/15
to ke...@0xdata.com, h2os...@googlegroups.com, nee...@h2o.ai

Kevin -

It appears that the issue was due to improperly calling CURL from within a Windows environment.  In the R h2o.init() function, there is the line:

print(system("curl 'http://localhost:54321'"))

There should be a check to see if this is running on a Windows host; if so it should be:

print(system("curl \"http://localhost:54321\""))

Changing the function to this worked for me and R was able to connect into H2o running via a console window.  I'm guessing that there are other CURL commands that need to be updated with this change too.

There was also one other issues with missing functions in the 3.2.0.3060 release:

Error in h2o.init() : could not find function ".h2o.getTmpFile"     when running h2o.init()

Error in cat("Successfully connected to", h2o.getBaseURL(conn), "\n\n") : 
  could not find function "h2o.getBaseURL"         When running localH2O = h2o.init(ip = "localhost", port = 54321, startH2O = FALSE)

Matt

Tom Kraljevic

unread,
Jul 2, 2015, 12:45:51 PM7/2/15
to Matt H, ke...@0xdata.com, h2os...@googlegroups.com, nee...@h2o.ai

Hmm, that’s weird, we run on windows successfully all the time.

This last system(“curl…”) only runs as a last gasp if the normal path fails…
So this is an effect, not a cause.

What is your version of RCurl package?  Maybe that could be updated.


Tom


-- 
You received this message because you are subscribed to the Google Groups "H2O Open Source Scalable Machine Learning - h2ostream" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2ostream+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt H

unread,
Jul 2, 2015, 12:54:38 PM7/2/15
to Tom Kraljevic, ke...@0xdata.com, h2os...@googlegroups.com, nee...@h2o.ai
RCurl version was 1.95-4.6, updating to 1.95-4.7 seemed to help, but still has the missing functions (h2o.getBaseURL and .h2o.getTmpFile)


Subject: Re: [h2ostream] RE: Errors running H2O in R
From: to...@h2o.ai
Date: Thu, 2 Jul 2015 09:45:46 -0700
CC: ke...@0xdata.com; h2os...@googlegroups.com; nee...@h2o.ai
To: matt....@outlook.com

Tom Kraljevic

unread,
Jul 2, 2015, 12:58:14 PM7/2/15
to Matt H, ke...@0xdata.com, h2os...@googlegroups.com, nee...@h2o.ai

Ok...
Can you also please try this build?


This is the stable build that went through testing.
The other number you referred to was a bleeding edge nightly build.


Tom

Matt H

unread,
Jul 2, 2015, 1:07:04 PM7/2/15
to Tom Kraljevic, ke...@0xdata.com, h2os...@googlegroups.com, nee...@h2o.ai
Tom - 

That build worked.  Thanks for the help.

Matt


Subject: Re: [h2ostream] Errors running H2O in R
From: to...@h2o.ai
Date: Thu, 2 Jul 2015 09:58:10 -0700

lukas.schwa...@gmail.com

unread,
Jan 6, 2016, 12:56:57 PM1/6/16
to H2O Open Source Scalable Machine Learning - h2ostream, matt....@outlook.com, nee...@h2o.ai
Hi,

even though this has been a while ago, I have the same problem and the same error message ("FATAL: On /127.0.0.1 some of the required ports 54321, 54322 are not available, change -port PORT and try again."), when calling h2o.init()from RStudio.

H2O version:
INFO: Build git describe: jenkins-rel-tibshirani-8
INFO: Build project version: 3.6.0.8

Java:
JAVA_VERSION="1.8.0_66"
OS_NAME="Windows"
OS_VERSION="5.2"
OS_ARCH="amd64"

Operating System:
Windows 2012R2

Any ideas, what I could try to do?

Best regards,
Lukas



Tom Kraljevic

unread,
Jan 6, 2016, 1:29:52 PM1/6/16
to lukas.schwa...@gmail.com, H2O Open Source Scalable Machine Learning - h2ostream, Matt H

Hi,

even though this has been a while ago, I have the same problem and the same error message ("FATAL: On /127.0.0.1 some of the required ports 54321, 54322 are not available, change -port PORT and try again."), when calling h2o.init()from RStudio.

H2O version:
INFO: Build git describe: jenkins-rel-tibshirani-8
INFO: Build project version: 3.6.0.8

Java:
JAVA_VERSION="1.8.0_66"
OS_NAME="Windows"
OS_VERSION="5.2"
OS_ARCH="amd64"

Operating System:
Windows 2012R2

Any ideas, what I could try to do?

Best regards,
Lukas


This is probably because an H2O is already running.
Go to task manager and look for running java processes.

Note that h2o.init() from R will only start H2O itself on ip localhost and port 54321 to avoid letting the user accidentally creating many instances of H2O and not realizing it.

Tom

Reply all
Reply to author
Forward
0 new messages