jenkinsci / docker-plugin

Jenkins cloud plugin that uses Docker
https://plugins.jenkins.io/docker-plugin/
MIT License
490 stars 319 forks source link

java.util.NoSuchElementException #921

Closed Joker-DW closed 1 year ago

Joker-DW commented 1 year ago

Jenkins and plugins versions report

Environment ```text Jenkins 2.368 docker-plugin 1.2.10 ```

What Operating System are you using (both controller, and any agents involved in the problem)?

docker image -- jenkins:latest

Reproduction steps

  1. Source Code Management with Git
  2. Make Dockerfile in workspace
  3. Add build step -- [Build / Publish Docker Image] and configure

Expected Results

build success. And I actually have 4 projects, 3 of which will be successful with the same configuration, and only one of which will not be successful, which is this one.So it's weird.

Actual Results

ERROR: Build step failed with exception java.util.NoSuchElementException at java.base/java.util.ArrayDeque.removeFirst(ArrayDeque.java:363) at java.base/java.util.ArrayDeque.remove(ArrayDeque.java:524) at io.netty.handler.stream.ChunkedWriteHandler.doFlush(ChunkedWriteHandler.java:267) at io.netty.handler.stream.ChunkedWriteHandler.flush(ChunkedWriteHandler.java:132) at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:748) at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:740) at io.netty.channel.AbstractChannelHandlerContext.access$2200(AbstractChannelHandlerContext.java:59) at io.netty.channel.AbstractChannelHandlerContext$Tasks$4.run(AbstractChannelHandlerContext.java:1142) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:829) Build step 'Build / Publish Docker Image' marked build as failure

Anything else?

I don't get anything in the error info. It's just a java error. I don't know what I'm gonna do next......And I've been on this for days.

qestoppey commented 1 year ago

I have the same issue. This error happens when I have a small repo instead of a big project. The errors disappear if :

pjdarton commented 1 year ago

The error stacktrace here doesn't seem to mention the docker-plugin directly, but it does mention the netty transport layer (a lot), suggesting that the cause of the issue may actually be buried within netty. ...but there's just been a new release of the docker-plugin that replaces the netty transport layer so I'd strongly suggest you try that new version - it'll either work now (if so, please close this issue) or fail with a different (hopefully more informative!) message (if so, please describe it here).

Note: #918 looks very similar to this; they might be related.

basil commented 1 year ago

The latest releases of docker-plugin and docker-java-api do not use Netty anymore. Please upgrade to these latest releases. If the problem persists with the latest releases, please file a new issue with steps to reproduce the problem from scratch.