Jenkins pipeline fails with ClosedChannelException during artifact upload (k8s agent)

Hi community,

I’m experiencing a weird issue with my pipeline when it’s trying to archive and upload artifacts to GCS.
The pipeline runs on a Kubernetes agent, and everything works fine for other stages, but it fails exactly during the artifact archiving step with the following error:

python-repl

CopyEdit

java.nio.channels.ClosedChannelException
...
java.util.concurrent.ExecutionException: hudson.remoting.RequestAbortedException: java.nio.channels.ClosedChannelException
...
org.jenkinsci.plugins.workflow.support.steps.AgentOfflineException: Unable to create live FilePath; Connection was broken

This happens specifically for the backend pipeline, not for the frontend pipeline.
The pod/agent disconnects while attempting to transfer files back to the controller.

  • Jenkins version: 2.504.2
  • Environment: k8s pod as agent
  • Step failing: archiveArtifacts
  • The other stages execute successfully.

Could anyone please help me debug this or advise me on what might be causing the agent to disconnect during artifact upload?