Skip to content

TooLongFrameException thrown when large number of containers present #977

Description

@fraz3alpha

The docker-java library throws an exception when listing containers in the cases where the size of the returned JSON file is > 1Mb, e.g.

o.netty.handler.codec.TooLongFrameException: object length exceeds 1048576: 1049308 bytes discarded
	at io.netty.handler.codec.json.JsonObjectDecoder.decode(JsonObjectDecoder.java:106)
	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
...

This library has several different instances of calls to the JsonObjectDecoder() where this is configured, and in each case the maxObjectLength parameter not given therefore the default of 1Mb (1024 * 2014) is used.

In my particular case this occurs when the number of containers in my Docker swarm passes roughly 1000 containers, however it is dependent on how much data is returned for each container

This issue is the cause of an open issue against the Jenkins docker-plugin project.

For uses of the library in larger environments it is essential to be able to configure this value.

When used within something such as a Jenkins plugin setting this default value via an environment variable would particularly useful as it could be set once on the commandline and no further changes to other code would be needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions