jenkinsci / jenkinsci/docker-ssh-agent
Windows tests are failing with `Error response from daemon: invalid entry name "NUL"` when checking images can be rebuilt with custom args
- Dominant language
- PowerShell
- Stars
- 208
- Forks
- 177
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 11
Description
Note: extracted from https://github.com/jenkinsci/docker-ssh-agent/issues/604#issuecomment-5316418090 and https://github.com/jenkinsci/docker-ssh-agent/issues/604#issuecomment-5316458733
Since a few days, the tests on Windows (both 2019 and 2022 so we cannot count on removing 2019) are failing.
Only the 2 last tests of the harness are failing: the 2 ones which are rebuilding the image with custom build args:
- https://ci.jenkins.io/job/Packaging/job/docker-ssh-agent/job/master/1256/stages/?selected-node=254
- Screenshot:
Click to expand
- Build logs:
Click to expand
```
13:37:22 = TEST: Starting test harness
13:37:29 = TEST: Pester 6.0.1 not found: installing...
13:37:41 = TEST: Setting up Pester environment...
13:37:41 = TEST: Testing all images...
13:37:43 = TEST: Testing jenkins/ssh-agent:windowsservercore-ltsc2022-jdk21 image
13:37:43
Pester v6.0.1
13:37:44
13:37:44
Running tests from 1 files.
13:37:44
Discovery: Discovering tests in sshAgent.Tests.ps1
13:37:44 = TESTS: Preparing jenkins/ssh-agent:windowsservercore-ltsc2022-jdk21
13:37:44
Discovery: Found 11 tests in 696 ms
13:37:45
13:37:45
Running tests from 'Z:\agent\workspace\ackaging_docker-ssh-agent_master\tests\sshAgent.Tests.ps1'
13:37:52
Describing [windowsservercore-ltsc2022-jdk21] image has setup-sshd.ps1 in the correct location
13:37:54
[+] has setup-sshd.ps1 in C:/ProgramData/Jenkins 2s
13:38:01
13:38:01
Describing [windowsservercore-ltsc2022-jdk21] image has no pre-existing SSH host keys
13:38:03 [cmd] docker exec pester-jenkins-ssh-agent-windowsservercore-ltsc2022-jdk21 powershell.exe -C "if(Test-Path C:/ProgramData/ssh/ssh_host*_key*) { exit 0 } else { exit 1 }"
13:38:03 [stdout]
13:38:03 [stderr]
13:38:03
[+] has has no SSH host key present in C:\ProgramData\ssh 1.86s
13:38:04
13:38:04
Describing [windowsservercore-ltsc2022-jdk21] checking image metadata
13:38:04
[+] has correct volumes 116ms
13:38:04
[+] has the source GitHub URL in docker metadata 98ms
13:38:11
13:38:11
Describing [windowsservercore-ltsc2022-jdk21] image has expected tools versions installed and in the PATH
13:38:14
[+] has expected java installed and in the path 3.44s
13:38:16
[+] has expected git-lfs (and thus git) installed and in the path 1.75s
13:38:23
13:38:23
Describing [windowsservercore-ltsc2022-jdk21] create agent container with pubkey as argument
13:38:29
[+] runs commands via ssh, container with pubkey as argument 5.28s
13:38:36
13:38:36
Describing [windowsservercore-ltsc2022-jdk21] create agent container with pubkey as envvar
13:38:41
[+] runs commands via ssh, container with pubkey as envvar 5.18s
13:38:48
13:38:48
Describing [windowsservercore-ltsc2022-jdk21] create agent container like docker-plugin with '/usr/sbin/sshd -D -p 22' as argument
13:38:53
[+] runs commands via ssh, container like docker-plugin 5.19s
13:38:54
13:38:54
Describing [windowsservercore-ltsc2022-jdk21] image can be built
13:38:54 [cmd] docker build --build-arg "WINDOWS_VERSION_TAG=ltsc2022" --build-arg "JAVA_ZIP_URL=https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.3%2B9/OpenJDK25U-jdk_x64_windows_hotspot_25.0.3_9.zip" --build-arg "JAVA_HOME=C:\openjdk-21" --tag=windowsservercore-ltsc2022-jdk21 --file ./windows/windowsservercore/Dockerfile .
13:38:54 [stdout]
13:38:54 [stderr] Error response from daemon: invalid entry name "NUL"
13:38:54
13:38:54
[-] builds image 202ms
13:38:54
Expected 0, but got 1.
13:38:54
at $exitCode | Should -Be 0, Z:\agent\workspace\ackaging_docker-ssh-agent_master\tests\sshAgent.Tests.ps1:205
13:38:54
13:38:54
Describing [windowsservercore-ltsc2022-jdk21] image can be built with custom build args
13:38:54 [cmd] docker build --build-arg "WINDOWS_VERSION_TAG=ltsc2022" --build-arg "JAVA_ZIP_URL=https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25.0.3%2B9/OpenJDK25U-jdk_x64_windows_hotspot_25.0.3_9.zip" --build-arg "JAVA_HOME=C:\openjdk-21" --build-arg "user=testuser" --build-arg "JENKINS_AGENT_WORK=C:/hamster" --tag=custom-jenkins/ssh-agent:windowsservercore-ltsc2022-jdk21 --file ./windows/windowsservercore/Dockerfile .
13:38:54 [stdout]
13:38:54 [stderr] Error response from daemon: invalid entry name "NUL"
13:38:54
13:38:54
[-] uses build args correctly 178ms
13:38:54
Expected 0, but got 1.
13:38:54
at $exitCode | Should -Be 0, Z:\agent\workspace\ackaging_docker-ssh-agent_master\tests\sshAgent.Tests.ps1:220
13:38:55
Tests completed in 70.96s
13:38:55
Tests Passed: 9, Failed: 2, Skipped: 0, Inconclusive: 0, NotRun: 0
script returned exit code 2
```
No code changes when the tests did fail: should be either an infra change (agent VM images are updated at least weekly) or a parent dependency (parent base image).
- @lemeurherve proposed to retry with an older packer-image. Reading https://docs.docker.com/engine/release-notes/29/#2972 (`Fix a regression introduced in Docker Engine 29.7.0 that caused image pulls to reject images containing absolute hardlink targets, as produced by some image builders.` moby/moby#53305), looks like we have to try with an image using Docker CE 29.6.x OR wait for a new agent image to be released an try with the 29.7.2 patched version.
- I'm trying to reproduce on my Windows 11 machine to ensure it is not a Pester or base image issue.
Contributor guide
Research direction
Start with tests/sshAgent.Tests.ps1 at the failing checks around lines 205 and 220, then review the Windows agent logs and Docker Engine version. Re-run the harness on Windows 2019 and 2022, comparing an image with Docker CE 29.6.x against one with the patched 29.7.2 release. Done means both image-build tests pass with no invalid NUL entry error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, powershell
- Domain
- ci-cd, infrastructure, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100