Can't see my workspace when using docker cloud plugin

Jenkins setup:

Jenkins version: 2.452.1, Docker plugin version: 1.6.1
Hello, everyone, we have some jobs that uses Docker cloud as our agent
But we get the error at the end of the page, and it’s possible to see workspace while the job is running and files exist on the machine. How to fix that? We want to see workspace after the build

Docker plugin config
Remote File System Root: /mnt/jenkins
Mount: type=bind,source=/mnt/jenkins/workspace,destination=/mnt/jenkins/workspace

Error: no workspace

There’s no workspace for this project. Possible reasons are:

  1. The project was renamed recently and no build was done under the new name.
  2. The agent this project has run on for the last time was removed.
  3. The workspace directory (null) is removed outside Jenkins.
  4. The workspace was wiped out and no build has been done since then.

Run a build to have Jenkins create a workspace.

Cloud agents are intentionally ephemeral. They are created when the job needs them and are deleted when the job is done using them. If there is something that you need to persist between jobs, you can archive an artifact.

A video from Darin Pope may help:

There is a Jenkins Minute video from Liam Newman that may help:

There is also a tutorial from LevelUp 360 that may help:

But all our workspaces are on the machine and ephemeral agents uses those files using bind (they don’t clear workspace, I can access those files if I connect to the server), isn’t it possible to jenkins look for workspace on the machine where jenkins is installed and JENKINS_HOME located? Our approach worked before, but something happened and it doesn’t look for workspace on machine now

It might be possible, but that’s not how Jenkins treats ephemeral agents. Ephemeral agents are assumed to store their workspace on the agent. When the agent ceases to exist, the workspace is no longer assumed to be available.

Your choice to run the agents on the same computer as the controller is a valid choice but it is not the only choice for Jenkins users with ephemeral agents and I suspect it is not the most common choice.