I am trying to use the Jetty server build into I2P to host a site. This site, actually ;) However, I currently cannot even get the pre-configured help-pages to show up. Now I am trying to find out, what gives.

In the routerconsole the tunnel is shown as up. Pressing the Preview button only gives me

503 Service Unavailable

This I2P website is unavailable. It may be down or undergoing maintenance.

Jetty seems to get loaded, though:

root@i2p:~# view /var/log/i2p/wrapper.log
[...]
2015/10/23 11:32:04 | INFO: Jetty 8.1.17.v20150415 logging to I2P logs using class org.eclipse.jetty.server.Server
2015/10/23 11:32:04 | 2015-10-23 11:32:04.735:INFO:oejs.Server:jetty-8.1.17.v20150415

Looking into the router log shows an error then:

root@i2p:~# view /var/log/i2p/log-router-0.txt
23/10/15 12:47:54 ERROR [7.0.0.1:7658] .i2ptunnel.I2PTunnelHTTPServer: Error connecting to HTTP server /127.0.0.1:7658
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at java.net.Socket.<init>(Socket.java:425)
        at java.net.Socket.<init>(Socket.java:241)
        at net.i2p.i2ptunnel.I2PTunnelServer.getSocket(I2PTunnelServer.java:691)
        at net.i2p.i2ptunnel.I2PTunnelServer.getSocket(I2PTunnelServer.java:646)
        at net.i2p.i2ptunnel.I2PTunnelHTTPServer.blockingHandle(I2PTunnelHTTPServer.java:430)
        at net.i2p.i2ptunnel.I2PTunnelServer$Handler.run(I2PTunnelServer.java:574)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
23/10/15 12:50:21 ERROR [7.0.0.1:7658] .i2ptunnel.I2PTunnelHTTPServer: Error accepting java.net.ConnectException: ServerSocket closed
        at net.i2p.client.streaming.impl.ConnectionHandler.accept(ConnectionHandler.java:138)
        at net.i2p.client.streaming.impl.I2PSocketManagerFull.receiveSocket(I2PSocketManagerFull.java:300)
        at net.i2p.client.streaming.impl.I2PServerSocketFull.accept(I2PServerSocketFull.java:38)
        at net.i2p.i2ptunnel.I2PTunnelServer.run(I2PTunnelServer.java:489)
        at java.lang.Thread.run(Thread.java:745)
        at net.i2p.util.I2PThread.run(I2PThread.java:115)

So it tries to connect to local port 7658, but doesn’t succeed. Why? The website should be reachable using 127.0.0.1:7658. But wait, is it?

root@i2p:~# netstat -nl | grep 7658

No, nothing is listening on Port 7658. What gives?

The Configuration

All this is using:

root@i2p:~# java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

Java 1.7 should be ok, I assume. The configuration of the tunnel I configured in the web-console of I2P is in /var/lib/i2p/i2p-config/i2ptunnel.config configuration-file-wise. That looks ok. But the tunnel is shown as up, so maybe that’s not the problem here. The settings for the Jetty server are in /var/lib/i2p/i2p-config/eepsite/jetty.xml. Looks ok, too, or something. I just don’t get it :(

Update

Should have been easy, it turns out. The eepsite basically is the combination of a jetty web-server as a process listening on a local port PLUS the tunnel to make that port available under a specific name (that of the eepsite). I looked through all (probably) configuration pages while trying to find out what’s wrong, but everything looked alright to me. Turns out I was simply missing the service. Like the router console didn’t know about jetty at all. And so jetty got not started, becaues that is done by the I2P router. Digging around I found those are defined in /var/lib/i2p/i2p-config/clients.config. And mine had only 3. It was really short.

So I remote I2P competely with apt-get purge i2p followed by apt-get autoremove to also remove all packages only depending on i2p. I then re-installed, re-configured, and voila, everything good again. How did that happen? I don’t like re-installing to fix things usually and I am not used to that from Linux stuff. I had migrated the OS of the machine to a newer version including an update of the package sources. I suspect something could have went wrong therein. But not sure. Usually in the end it turns out I have done something stupid ;)

But if you keep getting 503 pages instead of your pages (the help pages by default), remember to check both:

  • the service I2P webserver must be listed as started (click on I2P SERVICES on the router-console leading you to /configclients)
  • the according hidden service (by default named I2P webserver again) must be listed as started in the HIDDEN SERVICE MANAGER reachable from the router console and leading to /i2ptunnelmgr

The hint to look for the other and where to find it came from user hummingbird in the thread@zzz.i2p where I asked for help. Thx buddy!