Error in .h2o.doSafeREST(conn = conn, h2oRestApiVersion = h2oRestApiVersion, :

2,734 views
Skip to first unread message

tomkozl...@gmail.com

unread,
Nov 6, 2015, 10:29:13 AM11/6/15
to H2O Open Source Scalable Machine Learning - h2ostream
Not sure why I'm getting this error. I'm working with H2o R package and when I just start H2o with localH2O = h2o.init() I have no issues running anything and all the commands work perfect. See the output 1 below. The moment I use localH2O = h2o.init(nthreads = -1) the cluster starts fine Output 2 below but when I try to train the model I get the error that I pasted on the bottom. Everything works when I don't specify the nthreds and only use 2 cores out of 80 but when I try to use more cores when starting up h2o I get the error which is weird. I'm currently using Revolution R Open 3.2.1 on a CentosOS 6.6. Thanks for all the help with this.

Output 1:
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

..Successfully connected to http://127.0.0.1:54321/

R is connected to the H2O cluster:
H2O cluster uptime: 1 seconds 893 milliseconds
H2O cluster version: 3.2.0.5
H2O cluster name: H2O_started_from_R_tkozlowski_ejy175
H2O cluster total nodes: 1
H2O cluster total memory: 26.67 GB
H2O cluster total cores: 80
H2O cluster allowed cores: 2
H2O cluster healthy: TRUE

Note: As started, H2O is limited to the CRAN default of 2 CPUs.
Shut down and restart H2O as shown below to use all your CPUs.
> h2o.shutdown(localH2O)
> localH2O = h2o.init(nthreads = -1)

Output 2:

java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

..Successfully connected to http://127.0.0.1:54321/

R is connected to the H2O cluster:
H2O cluster uptime: 1 seconds 902 milliseconds
H2O cluster version: 3.2.0.5
H2O cluster name: H2O_started_from_R_tkozlowski_zsa759
H2O cluster total nodes: 1
H2O cluster total memory: 26.67 GB
H2O cluster total cores: 80
H2O cluster allowed cores: 80
H2O cluster healthy: TRUE


I run this:

rf_a =
h2o.randomForest(y = y_var,
x = X_vars,
training_frame = data.train,
validation_frame = data.test,
classification=T,
ntree=100,
depth=50,
importance=T)

But get this:
ERROR: Unexpected HTTP Status code: 412 Precondition Failed (url = http://127.0.0.1:54321/99/Rapids)

water.exceptions.H2OIllegalArgumentException
[1] "water.rapids.Exec.lookup(Exec.java:117)"
[2] "water.rapids.Exec.parse(Exec.java:100)"
[3] "water.rapids.ASTAssign.parse_impl(AST.java:702)"
[4] "water.rapids.ASTAssign.parse_impl(AST.java:673)"
[5] "water.rapids.Exec.parse(Exec.java:101)"
[6] "water.rapids.Exec.exec(Exec.java:64)"
[7] "water.api.RapidsHandler.exec(RapidsHandler.java:37)"
[8] "sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)"
[9] "sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)"
[10] "sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
[11] "java.lang.reflect.Method.invoke(Method.java:497)"
[12] "water.api.Handler.handle(Handler.java:58)"
[13] "water.api.RequestServer.handle(RequestServer.java:668)"
[14] "water.api.RequestServer.serve(RequestServer.java:609)"
[15] "water.JettyHTTPD$H2oDefaultServlet.doGeneric(JettyHTTPD.java:617)"
[16] "water.JettyHTTPD$H2oDefaultServlet.doPost(JettyHTTPD.java:565)"
[17] "javax.servlet.http.HttpServlet.service(HttpServlet.java:755)"
[18] "javax.servlet.http.HttpServlet.service(HttpServlet.java:848)"
[19] "org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)"

Error in .h2o.doSafeREST(conn = conn, h2oRestApiVersion = h2oRestApiVersion, :
*Unimplemented* failed lookup on token: ``. Contact sup...@h2o.ai for more information.

Amy Wang

unread,
Nov 6, 2015, 2:03:06 PM11/6/15
to H2O Open Source Scalable Machine Learning - h2ostream, tomkozl...@gmail.com
Hi Tom,

Looks like a bit of typo in the random forest parameter definition, try specifying max_depth instead of depth:

rf_a =
  h2o.randomForest(y = y_var, 
                   x = X_vars, 
                   training_frame = data.train,
                   validation_frame = data.test,
                   classification=T,
                   ntree=100,

                   max_depth=50,
                   importance=T)


Sincerely,
Amy Wang

tomkozl...@gmail.com

unread,
Nov 6, 2015, 4:01:26 PM11/6/15
to H2O Open Source Scalable Machine Learning - h2ostream, tomkozl...@gmail.com

Thanks that worked. Weird that the original code was working fine when I didn't specify nthreads =-1.

Sv Narayan

unread,
Sep 23, 2022, 12:55:17 PM9/23/22
to H2O Open Source Scalable Machine Learning - h2ostream
Hello Everyone, I am facing a similar issue, where code works fine when it uses 16 cores and 16 cores are allowed. But fails with ' Error in .h2o.doSafeREST(conn = conn, h2oRestApiVersion = h2oRestApiVersion,  ' 
when I try to  increase cpu's to 32. Please help.

Line of code:  do.call(h2o.xgboost, params)

Michal Kurka

unread,
Sep 23, 2022, 1:01:33 PM9/23/22
to Sv Narayan, H2O Open Source Scalable Machine Learning - h2ostream
Hello,

can you share the exact error you are facing?

Thank you,
MK

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/h2ostream/a5471928-d0f2-47a7-a94e-6423f4151f99n%40googlegroups.com.

Sv Narayan

unread,
Sep 23, 2022, 1:04:40 PM9/23/22
to H2O Open Source Scalable Machine Learning - h2ostream
Thank you for reply.
Here is the error:
|   0%Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = urlSuffix,  :
  Unexpected CURL error: Failed connect to <URL>; Connection refused
Error in .h2o.__checkConnectionHealth() : 
H2O connection has been severed. Cannot connect to instance at <URL>

Michal Kurka

unread,
Sep 23, 2022, 1:08:13 PM9/23/22
to Sv Narayan, H2O Open Source Scalable Machine Learning - h2ostream
It is possible H2O didn't even start. How are you starting it? Python/R? Do you have full output of the start attempt?

MK

Sv Narayan

unread,
Sep 23, 2022, 1:09:48 PM9/23/22
to H2O Open Source Scalable Machine Learning - h2ostream
It has started fine. The issue occurs when I try to load model. I am using R.

Sv Narayan

unread,
Sep 23, 2022, 1:18:36 PM9/23/22
to H2O Open Source Scalable Machine Learning - h2ostream
H2O version : 3.28.0.1

Michal Kurka

unread,
Sep 23, 2022, 1:26:32 PM9/23/22
to Sv Narayan, H2O Open Source Scalable Machine Learning - h2ostream
H2O generates a log, to help we would need to see the log. It is possible it crashed on oom or it was not responsive for a while.

Sv Narayan

unread,
Sep 23, 2022, 2:45:50 PM9/23/22
to H2O Open Source Scalable Machine Learning - h2ostream
> > library("h2o")
> h2o<-h2o.connect(ip='URL', username='username',password='pwd',strict_version_check = FALSE)
 Connection successful!


R is connected to the H2O cluster:
    H2O cluster uptime:         13 minutes 36 seconds
    H2O cluster timezone:       UTC
    H2O data parsing timezone:  UTC
    H2O cluster version:        3.28.0.1
    H2O cluster version age:    2 years, 9 months and 6 days !!!
    H2O cluster name:           h2o

    H2O cluster total nodes:    1
    H2O cluster total memory:   225.01 GB
    H2O cluster total cores:    32
    H2O cluster allowed cores:  32
    H2O cluster healthy:        TRUE
    H2O Connection ip:          <URL>
    H2O Connection port:        54321
    H2O Connection proxy:       NA
    H2O Internal Security:      FALSE
    H2O API Extensions:         Amazon S3, XGBoost, Algos, AutoML, Core V3, TargetEncoder, Core V4
    R Version:                  R version 3.5.3 (2019-03-11)

Warning message:
In h2o.clusterInfo() :
Your H2O cluster version is too old (2 years, 9 months and 6 days)!
Please download and install the latest version from http://h2o.ai/download/>

$eta
[1] 0.11

$max_depth
[1] 8

$min_child_weight
[1] 100

$subsample
[1] 0.9

$colsample_bylevel
[1] 1

$gamma
[1] 1e-07

$colsample_bytree
[1] 1

$reg_alpha
[1] 1

$reg_lambda
[1] 3

$tree_method
[1] "auto"

$grow_policy
[1] "depthwise"

$max_bin
[1] 256

$max_leaves
[1] 0

$min_sum_hessian_in_leaf
[1] 100

$min_data_in_leaf
[1] 0

$ntrees
[1] 10000

$stopping_tolerance
[1] 1e-04

$stopping_rounds
[1] 5

$stopping_metric
[1] "AUC"

$score_tree_interval
[1] 10

> > test_model <- do.call(h2o.xgboost, params)

  |                                                                                                                      
|   0%Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = urlSuffix,  :
  Unexpected CURL error: Recv failure: Connection reset by peer
Error in .h2o.__checkConnectionHealth() :
  H2O connection has been severed. Cannot connect to instance at <URL>/
Failed connect to sep21-<URL>; Connection refused
23 Sep 2022 18:31:48 [rsession-user] ERROR r error 4 (R code execution error) [errormsg=Error in .h2o.__checkConnectionHealth() :
  H2O connection has been severed. Cannot connect to instance at <URL>/
Failed connect to sep21-<URL>  Connection refused
]; OCCURRED AT: rstudio::core::Error rstudio::r::exec::<unnamed>::evaluateExpressionsUnsafe(SEXPREC*, SEXPREC*, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::<unnamed>::EvalType) /root/rstudio/src/cpp/r/RExec.cpp:159; LOGGED FROM: rstudio::core::json::Value rstudio::session::modules::environment::varToJson(SEXPREC*, const rstudio::r::sexp::Variable&) /root/rstudio/src/cpp/session/modules/environment/EnvironmentUtils.cpp:145
Error in .h2o.__checkConnectionHealth() :
  H2O connection has been severed. Cannot connect to instance at <URL>/
Failed connect to sep21-<URL>; Connection refused
23 Sep 2022 18:31:48 [rsession-user] ERROR r error 4 (R code execution error) [errormsg=Error in .h2o.__checkConnectionHealth() :
  H2O connection has been severed. Cannot connect to instance at <URL>/
Failed connect to sep21-<URL>  Connection refused
]; OCCURRED AT: rstudio::core::Error rstudio::r::exec::<unnamed>::evaluateExpressionsUnsafe(SEXPREC*, SEXPREC*, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::<unnamed>::EvalType) /root/rstudio/src/cpp/r/RExec.cpp:159; LOGGED FROM: rstudio::core::json::Value rstudio::session::modules::environment::varToJson(SEXPREC*, const rstudio::r::sexp::Variable&) /root/rstudio/src/cpp/session/modules/environment/EnvironmentUtils.cpp:145
Error in .h2o.__checkConnectionHealth() :
  H2O connection has been severed. Cannot connect to instance at <URL>/
Failed connect to sep21-<URL>; Connection refused
23 Sep 2022 18:31:48 [rsession-user] ERROR r error 4 (R code execution error) [errormsg=Error in .h2o.__checkConnectionHealth() :
  H2O connection has been severed. Cannot connect to instance at <URL>/
Failed connect to sep21-<URL>  Connection refused
]; OCCURRED AT: rstudio::core::Error rstudio::r::exec::<unnamed>::evaluateExpressionsUnsafe(SEXPREC*, SEXPREC*, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::<unnamed>::EvalType) /root/rstudio/src/cpp/r/RExec.cpp:159; LOGGED FROM: rstudio::core::json::Value rstudio::session::modules::environment::varToJson(SEXPREC*, const rstudio::r::sexp::Variable&) /root/rstudio/src/cpp/session/modules/environment/EnvironmentUtils.cpp:145
Error in .h2o.__checkConnectionHealth() :
  H2O connection has been severed. Cannot connect to instance at <URL>/
Failed connect to sep21-<URL>; Connection refused
23 Sep 2022 18:31:48 [rsession-user] ERROR r error 4 (R code execution error) [errormsg=Error in .h2o.__checkConnectionHealth() :
  H2O connection has been severed. Cannot connect to instance at <URL>/
Failed connect to sep21-<URL>  Connection refused
]; OCCURRED AT: rstudio::core::Error rstudio::r::exec::<unnamed>::evaluateExpressionsUnsafe(SEXPREC*, SEXPREC*, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::<unnamed>::EvalType) /root/rstudio/src/cpp/r/RExec.cpp:159; LOGGED FROM: rstudio::core::json::Value rstudio::session::modules::environment::varToJson(SEXPREC*, const rstudio::r::sexp::Variable&) /root/rstudio/src/cpp/session/modules/environment/EnvironmentUtils.cpp:145
Error in .h2o.__checkConnectionHealth() :
  H2O connection has been severed. Cannot connect to instance at <URL>/
Failed connect to sep21-<URL>; Connection refused
23 Sep 2022 18:31:48 [rsession-user] ERROR r error 4 (R code execution error) [errormsg=Error in .h2o.__checkConnectionHealth() :
  H2O connection has been severed. Cannot connect to instance at <URL>/
Failed connect to sep21-<URL>  Connection refused
]; OCCURRED AT: rstudio::core::Error rstudio::r::exec::<unnamed>::evaluateExpressionsUnsafe(SEXPREC*, SEXPREC*, SEXPREC**, rstudio::r::sexp::Protect*, rstudio::r::exec::<unnamed>::EvalType) /root/rstudio/src/cpp/r/RExec.cpp:159; LOGGED FROM: rstudio::core::json::Value rstudio::session::modules::environment::varToJson(SEXPREC*, const rstudio::r::sexp::Variable&) /root/rstudio/src/cpp/session/modules/environment/EnvironmentUtils.cpp:145
Reply all
Reply to author
Forward
Message has been deleted
0 new messages