Q:

h2o.init fails with Unexpected HTTP Status code: 301 Moved Permanently

Here is what is happening:
> h2o.init(startH2O = FALSE)
 Connection successful!

ERROR: Unexpected HTTP Status code: 301 Moved Permanently (url = http://localhost:54321/3/Cloud?skip_ticks=true)

Error: lexical error: invalid char in json text.
                                       <HTML>  <HEAD><TITLE>Redirectio
                     (right here) ------^

I've attempted numerous solutions related to this and this without success.
I'm using OSX 10.12.6. Here are a few notes on my configuration:
$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

In R (version 3.4.3):
> packageVersion("h2o")
[1] ‘3.16.0.2’
> Sys.getenv("JAVA_HOME") # Based on my manual setting in ~/.Renviron
[1] "/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home"
> update.packages() # everything up-to-date
> 

Any ideas for what to check for would be appreciated!

A:

An HTTP proxy is interfering.  You need to disable it.
In R:
Sys.unsetenv("http_proxy")
Sys.unsetenv("https_proxy")
# now call h2o.init

[ To debug further, try running the curl command-line program:
curl -v http://localhost:54321/3/Cloud

and see what the output says. ]

