transporter icon indicating copy to clipboard operation
transporter copied to clipboard

tls: oversized record received

Open rbwendt opened this issue 11 years ago • 10 comments

I'm using transporter to synchronize some data to a cloud elastic search provider that only offers an HTTPS interface.

I'm getting the following error:

transporter: CRITICAL: elasticsearch error (Post https://{{ my cloud provider }}/_bulk: tls: oversized record received with length 20527)

The error appears to be arising from within the crypto/tls library in crypto/tls/conn.go. This library won't allow payloads above maxCiphertext = 16384 + 2048 (encoded in a constant).

I suggest performing multiple requests to work around this issue.

rbwendt avatar Jul 24 '15 20:07 rbwendt

This is probably actually an issue with the elastigo library.

rbwendt avatar Jul 27 '15 13:07 rbwendt

Yeah, it does sound like an issue with that lib. we keep a buffer in the mongo library that's tunable. we could probably work around the bug in elastigo by doing something else, by capturing the sizes of documents as they're dumped, and forcing a flush periodically

good catch btw

nstott avatar Jul 27 '15 13:07 nstott

Would you do something like adding a size tracking variable to elasticsearch.go, incrementing it by the size of message.Msg in applyOp, then calling e.indexer.Flush() when it gets within a certain amount of maxCipherText?

Oh, but you'd have to track the bulk commands as well as just the documents.

rbwendt avatar Jul 27 '15 13:07 rbwendt

it might make sense to store the size of the document in the message itself, have the transporter source record that and yeah elasticsearch would have to keep a running tally of the cumulative size, and flush when it's too big

nstott avatar Jul 27 '15 13:07 nstott

It's interesting because that's just the maximum TLS fragment size, not document size. A document can clearly be bigger than that. I wonder why this is occurring.

rbwendt avatar Jul 27 '15 14:07 rbwendt

rbwendt ... does the error happen as soon as you start the transporter or does it occur later while it is processing?

codepope avatar Jul 27 '15 16:07 codepope

It happens a fair bit later. It seems like it has lots of time to collect data from mongo and then the error occurs.

rbwendt avatar Jul 27 '15 17:07 rbwendt

@rbwendt are you still seeing the issue? We updated the elastigo library with version 0.1.1.

jipperinbham avatar Nov 30 '15 22:11 jipperinbham

@jipperinbham Sorry I no longer use this application, and I don't have the time or resources to set up my old branch and test this out for you.

rbwendt avatar Dec 01 '15 14:12 rbwendt

I am currently seeing this same issue. The error output occurs for me multiple times about 50 to 60 seconds after I startup transporter.

ReedD avatar Aug 08 '16 19:08 ReedD