PurpleI2P / i2pd

🛡 I2P: End-to-End encrypted and anonymous Internet
https://i2pd.website
BSD 3-Clause "New" or "Revised" License
3.27k stars 424 forks source link

Should I be worried about any of these errors? #1685

Closed xanoni closed 2 years ago

xanoni commented 3 years ago
$ i2pd --version
i2pd version 2.38.0 (0.9.50)
Boost version 1.67.0
OpenSSL 1.1.1d  10 Sep 2019

Top errors by # of occurences over a consecutive 10-day period (skipped everything below 10 occurences):

  19920 error - SOCKS: error when creating the stream, check the previous warnings for more info
  12062 error - I2PTunnel: read error: End of file
   4401 error - SAM: stream read error: Operation canceled
   3000 error - Streaming: No packets have been received yet
   2999 error - SAM: read error: Operation canceled
   1530 error - I2PTunnel: write error: Bad file descriptor
    798 error - Garlic: can't handle ECIES-X25519-AEAD-Ratchet message
    431 error - I2PTunnel: stream read error: Connection reset by peer
    254 error - Garlic: Failed to decrypt message
    225 error - Tunnels: Can't create inbound tunnel, no peers available
    171 error - Tunnels: Can't create outbound tunnel, no inbound tunnels found
    153 error - Streaming: Can't send packets, missing remote LeaseSet, sSID=XXX
    115 error - Tunnels: Can't select next hop for XXX
    105 error - Streaming: No outbound tunnels in the pool, sSID=XXX
     92 error - SAM: read error: End of file
     80 error - SAM: stream read error: Connection reset by peer
     47 error - SAM: destination to connect not found
     47 error - Destination: New remote LeaseSet failed
     39 error - Destination: Can't publish LeaseSet. No outbound tunnels
     17 error - SSU: message 'created' signature verification failed
     11 error - Destination: Can't send LeaseSet request, no inbound tunnels found
     10 error - Garlic: Missing symmetric key for index 0
r4sas commented 2 years ago

Only Garlic: can't handle ECIES-X25519-AEAD-Ratchet message.

anikey-from-i2p commented 10 months ago

Only Garlic: can't handle ECIES-X25519-AEAD-Ratchet message.

This error appears along with the following warning:

Garlic: Flags/static section AEAD verification failed.

(These two appear at the same time, first the warning, then the error).

This occurs sometimes when loading an i2p site. When it occurs, the site does not load (received=0 on the stream in webconsole). It goes away eventually (need to wait some minutes).

Also the "can't" in the error is capitalized.

anikey-from-i2p commented 3 months ago

Should i create a new issue, of i2pd not handling these "ecies"es and "flags" properly?

Vort commented 3 months ago

Do you still see Flags message with latest version of i2pd? As for Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message, I think no issue is needed: it is minor problem and developers are aware of it.

anikey-from-i2p commented 3 months ago

I wrote about it again, because i remembered about it, because i saw it again.

The two messages, when they appear, they appear at the exact same time, first the "Flags" message, then the "Can't handle" message. That makes me think they are related. (I'll call it "the pair" from now on)

Also they (the pair) sometimes appear in batches, with a delay of 0.5-1 second between the pairs in a batch.

It happens sometimes when i load a site, and if the messages appear, it does not load. My guess: the site's data is sent through garlic, and i2pd fails to handle it, and so it does not reach the browser.

Here is some log excerpt with these messages (some data redacted):

01:01:59@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:01:59@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:01:59@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:01:59@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:01@[XXX]/warn - Streaming: Resend #3, another outbound tunnel has been selected for stream with sSID=0
01:02:02@[XXX]/error - Streaming: No packets have been received yet
01:02:02@[XXX]/error - Streaming: No packets have been received yet
01:02:02@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:02@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:02@[XXX]/error - Streaming: No packets have been received yet
01:02:02@[XXX]/error - Streaming: No packets have been received yet
01:02:02@[XXX]/warn - SSU2: Session with [XXX]:[XXX] was not established after 5 seconds
01:02:03@[XXX]/warn - Streaming: Resend #9, another outbound tunnel has been selected for stream with sSID=0
01:02:03@[XXX]/warn - Streaming: Resend #9, another outbound tunnel has been selected for stream with sSID=0
01:02:03@[XXX]/warn - NetDbReq: Destination [XXX] is requested already or cached
01:02:03@[XXX]/warn - NTCP2: SessionCreated read error: Connection reset by peer
01:02:03@[XXX]/warn - SSU2: RelayIntro unknown router to introduce
01:02:04@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:04@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:04@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:04@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:06@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:06@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:07@[XXX]/warn - Streaming: Resend #5, another outbound tunnel has been selected for stream with sSID=0
01:02:07@[XXX]/warn - Streaming: Resend #5, another outbound tunnel has been selected for stream with sSID=0
01:02:08@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:08@[XXX]/warn - Garlic: Trying to generate more ECIES-X25519-AEAD-Ratchet tags
01:02:08@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:08@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:08@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
[SNIP]
01:02:10@[XXX]/warn - Streaming: Resend #4, another remote lease has been selected for stream with rSID=[XXX], sSID=0
01:02:12@[XXX]/warn - Streaming: Resend #10, another remote lease has been selected for stream with rSID=[XXX], sSID=0
01:02:12@[XXX]/warn - Streaming: Resend #10, another remote lease has been selected for stream with rSID=[XXX], sSID=0
01:02:12@[XXX]/warn - NTCP2: SessionCreated read error: End of file
01:02:12@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:12@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:13@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:13@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:14@[XXX]/error - Streaming: No packets have been received yet
01:02:16@[XXX]/warn - Streaming: Resend #6, another remote lease has been selected for stream with rSID=[XXX], sSID=0
01:02:16@[XXX]/warn - Streaming: Resend #6, another remote lease has been selected for stream with rSID=[XXX], sSID=0
01:02:17@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:17@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:17@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:17@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:19@[XXX]/warn - Streaming: Resend #5, another outbound tunnel has been selected for stream with sSID=0
01:02:19@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:19@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:20@[XXX]/warn - Garlic: Flags/static section AEAD verification failed 
01:02:20@[XXX]/error - Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message
01:02:20@[XXX]/warn - Streaming: Unexpected stream status=5 for sSID=[XXX]
Vort commented 3 months ago

What exact version of i2pd it happens with?

anikey-from-i2p commented 3 months ago

Looking at the logs, it seems like the latest one (v2.53.1) (yes i built from the git tag, there is no release like that, but the tag exists)

anikey-from-i2p commented 3 months ago

Another error that worries me, is I2PTunnel: Write error: Bad file descriptor

It means that it tried to write to a non-existant FD. But FDs may be reused. What if, half the time this message appears, and half the time (like if another thread happens to open an FD) it writes to a random other connection, and confuses a peer or even sends sensitive information?

That usually appears after I2PTunnel: Read error: End of file, which makes me guess that this happens when a client closes the tcp stream.

orignal commented 3 months ago

bad file descriptor means already closed socket. When you see Garlic: Flags/static section AEAD verification failed is it high bandwidth traffic? It's possible that new tags was not generated yet and precalculation needs to be adjusted.

anikey-from-i2p commented 3 months ago

bad file descriptor means already closed socket.

Yes, but what if there are moments when, instead of this error appearing, there exists (opened from another thread) another, unrelated FD?

When you see Garlic: Flags/static section AEAD verification failed is it high bandwidth traffic?

It happens sometimes (not often) when i try to load a site. So not high bandwidth.

orignal commented 3 months ago

Does it cause any noticable issues? Like stuck pages, etc.

anikey-from-i2p commented 3 months ago

The bad FD error doesn't, but as far as i remember the Garlic Flags error causes stuck pages.

orignal commented 3 months ago

If it causes stuck page, it must be addressed, because it's not duplicated packets.

anikey-from-i2p commented 3 months ago

By the way, just recently i encountered the Garlic Flags error when qBittorrent was seeding, but it seems it did not affect data sending, since the numbers in the stream info kept growing.

Vort commented 3 months ago

@anikey-from-i2p can you check if less stuck pages appear with 3c69e0b2 commit? I know that Garlic: Can't handle ECIES-X25519-AEAD-Ratchet message errors will still appear, but will they cause problems for you this time?

anikey-from-i2p commented 3 months ago

Sorry, the stuck pages are very rare, i only encounter them rarely. I won't be able to. Maybe it depends on the peers? (like, different peers may be sending it differently?)

Vort commented 3 months ago

No need to hurry with testing. If you update to 3c69e0b2afd4b85d03e1327ef57ec9b571671ead (or later) and won't see problem for months, then it is probably fixed.

Maybe it depends on the peers?

It probably happens when packet drop happen because of poor network connection. Maybe when some node is overloaded as well.