Opened 6 years ago

Closed 3 years ago

#722 closed defect (fixed)

Destination not killed on restart

Reported by: echelon Owned by: zzz
Priority: major Milestone: 0.9.20
Component: apps/i2ptunnel Version: 0.9.2
Keywords: Cc:
Parent Tickets:

Description

Hi

On a I2P restart one specific destination is not stopped and started.
In my case it is the IRCd connection tunnel client towards the IRCd hub.
My router died in the night due to memory problems with 0.9.2-3 and restarted autoamtic. All destination came up, except the IRCd client connection tunnel.
Even on manual restart it does not start. Only after I click on shutdown and afterwards start it new with sh i2prouter run.

Logs show:

01.10.12 11:08:12 WARN [ handler 1/1] er.transport.udp.PacketHandler?: NTP failure, UDP adjusting clock by 499ms
01.10.12 11:10:26 ERROR [CP Reader 13] ent.ClientMessageEventListener?: Signature verification *FAILED* on a create session message. Hijack attempt?
01.10.12 11:10:26 ERROR [CP Reader 13] .client.ClientConnectionRunner?: Disconnecting the client - Invalid signature on CreateSessionMessage? config: null
01.10.12 11:10:26 ERROR [2CP Writer 1] .client.ClientConnectionRunner?: IO Error sending I2CP message to client
java.net.SocketException?: Socket closed

at java.net.SocketOutputStream?.socketWrite(SocketOutputStream?.java:116)
at java.net.SocketOutputStream?.write(SocketOutputStream?.java:153)
at java.io.BufferedOutputStream?.flushBuffer(BufferedOutputStream?.java:82)
at java.io.BufferedOutputStream?.flush(BufferedOutputStream?.java:140)
at net.i2p.router.client.ClientConnectionRunner?.writeMessage(ClientConnectionRunner?.java:515)
at net.i2p.router.client.ClientWriterRunner?.run(ClientWriterRunner?.java:70)
at java.lang.Thread.run(Thread.java:722)
at net.i2p.util.I2PThread.run(I2PThread.java:85)

01.10.12 11:03:14 ERROR [2CP Writer 1] .client.ClientConnectionRunner?: IO Error sending I2CP message to client
java.net.SocketException?: Socket closed

at java.net.SocketOutputStream?.socketWrite(SocketOutputStream?.java:116)
at java.net.SocketOutputStream?.write(SocketOutputStream?.java:153)
at java.io.BufferedOutputStream?.flushBuffer(BufferedOutputStream?.java:82)
at java.io.BufferedOutputStream?.flush(BufferedOutputStream?.java:140)
at net.i2p.router.client.ClientConnectionRunner?.writeMessage(ClientConnectionRunner?.java:515)
at net.i2p.router.client.ClientWriterRunner?.run(ClientWriterRunner?.java:70)
at java.lang.Thread.run(Thread.java:722)
at net.i2p.util.I2PThread.run(I2PThread.java:85)

01.10.12 11:05:06 ERROR [rtup tunnels] net.i2p.i2ptunnel.I2PTunnel : [10]: Invalid I2PTunnel configuration to create an HTTP Proxy connecting to the router at 127.0.0.1:7654 and listening on 127.0.0.1:9911
java.lang.IllegalArgumentException?: No valid target destinations found

at net.i2p.i2ptunnel.I2PTunnelClient.<init>(I2PTunnelClient.java:64)
at net.i2p.i2ptunnel.I2PTunnel.runClient(I2PTunnel.java:716)
at net.i2p.i2ptunnel.TunnelController?.startClient(TunnelController?.java:345)
at net.i2p.i2ptunnel.TunnelController?.doStartTunnel(TunnelController?.java:185)
at net.i2p.i2ptunnel.TunnelController?.startTunnel(TunnelController?.java:136)
at net.i2p.i2ptunnel.TunnelControllerGroup?$StartControllers?.run(TunnelControllerGroup?.java:137)
at java.lang.Thread.run(Thread.java:722)
at net.i2p.util.I2PThread.run(I2PThread.java:85)

01.10.12 11:05:06 ERROR [rtup tunnels] i2p.i2ptunnel.TunnelController?: Error starting the tunnel IRCd link
java.lang.IllegalArgumentException?: No valid target destinations found

at net.i2p.i2ptunnel.I2PTunnelClient.<init>(I2PTunnelClient.java:64)
at net.i2p.i2ptunnel.I2PTunnel.runClient(I2PTunnel.java:716)
at net.i2p.i2ptunnel.TunnelController?.startClient(TunnelController?.java:345)
at net.i2p.i2ptunnel.TunnelController?.doStartTunnel(TunnelController?.java:185)
at net.i2p.i2ptunnel.TunnelController?.startTunnel(TunnelController?.java:136)
at net.i2p.i2ptunnel.TunnelControllerGroup?$StartControllers?.run(TunnelControllerGroup?.java:137)
at java.lang.Thread.run(Thread.java:722)
at net.i2p.util.I2PThread.run(I2PThread.java:85)

01.10.12 11:05:31 ERROR [Client 7 ] .i2p.i2ptunnel.I2PTunnelClient: Error listening for connections on 9911
java.net.BindException?: Die Adresse wird bereits verwendet

at java.net.PlainSocketImpl?.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl?.bind(AbstractPlainSocketImpl?.java:376)
at java.net.ServerSocket?.bind(ServerSocket?.java:376)
at java.net.ServerSocket?.<init>(ServerSocket?.java:237)
at net.i2p.i2ptunnel.I2PTunnelClientBase.run(I2PTunnelClientBase.java:566)
at java.lang.Thread.run(Thread.java:722)
at net.i2p.util.I2PThread.run(I2PThread.java:85)

Subtickets

Change History (7)

comment:1 Changed 6 years ago by zzz

  • Component changed from router/general to apps/i2ptunnel

note to self

Die Adresse wird bereits verwendet = The address is already in use

comment:2 Changed 6 years ago by zzz

<zzz> eche|on, re: ticket #722, you're running i2ptunnel in a separate JVM?
<eche|on> zzz: no, all in one
<zzz> eche|on, you have any external clients connecting on I2CP 7654?
<eche|on> hmm, jwebcache ?
<zzz> what's on port 9911?
<eche|on> thats a client tunnel for IRCd to connect to that port, forwarding to the IRCd huib at postman.,i2p
<zzz> why are the logs all out of order - 11:10, 11:03, 11:05
<zzz> I'm very confused
<eche|on> yeah, I copied one ahead of the other...
<eche|on> sorry
<eche|on> thos were two events, the second one is shown first
<zzz> ok the ones at the top (11:10 and 11:03) are for an external client, probably jwebcache
<zzz> the ones at the bottom (11:05) are for irc
<eche|on> the external client can only be jwebcache, all other went via http proxy or irc proxy
<eche|on> except for snark
<eche|on> but snark should be fine
<zzz> how are you specifying the address for postman's hub? with a b32, or you have it in your private address book?
<eche|on> I did specify with a b32
<eche|on> with a persistant local key file
<eche|on> private key, sorry
<zzz> that's the cause of the 'no valid destinations found', which I think cascaded into a partial start, then fail, then 9911 port stuck open
<zzz> get postman's full dest, put it in your private address book, and put the name in i2ptunnel instead of the b32, that should make it more reliable
<eche|on> you are the master of code ;-)
<eche|on> ok, it is a private b32 dest, but I will ask him
<zzz> that's a workaround, not a fix really
<eche|on> I do know
<zzz> like it says on i2ptunnel page, 'b32 not recommended'
<kytv2> if you have BOB running: telnet localhost 2827. At the prompt "lookup b32". It'll return the b64.
<kytv2> (surely there's a "better way" but that's how I do it)


analysis:

1) Disconnect message may not have gotten out to jwebcache, will put in a small delay

2) Still need to implement delayed naming resolution in i2ptunnel standard client.

3) I2PTunnelClientBase starts itself as a thread in constructor, including opening the socket and then wait() ing for the startRunning() call. So when I2PTunnelClient calls super() in its constructor, it's all set up before it throws the IAE.

Starting a thread in the constructor is bad for many reasons (final object issues etc) and this is another one. Why do we start up the thread and then let it sit? Really bad. It's always been that way.

comment:3 Changed 6 years ago by zzz

  • Milestone changed from 0.9.3 to 0.9.4

#651 is related

comment:4 Changed 6 years ago by str4d

  • Milestone 0.9.4 deleted

comment:5 Changed 6 years ago by zzz

  • Milestone set to 0.9.8
  • Owner set to zzz
  • Status changed from new to accepted

will be addressed with the other i2ptunnel tickets

comment:6 Changed 4 years ago by str4d

  • Milestone 0.9.8 deleted

What is the status of this ticket, zzz?

comment:7 Changed 3 years ago by zzz

  • Milestone set to 0.9.20
  • Resolution set to fixed
  • Status changed from accepted to closed

ref: end of comment 2

1) is implemented (ClientConnectionRunner? line 644) October 2012
2) and 3) were indeed fixed at some point in the last couple of years, setting milestone to 0.9.20 but not bothering to research actually when

Note: See TracTickets for help on using tickets.