Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nanoserver build error: Failed to load XML document C:\"C:\Program Files\OpenSSH-Win64\openssh-events.man" #302

Closed
lemeurherve opened this issue Aug 21, 2023 · 2 comments

Comments

@lemeurherve
Copy link
Member

lemeurherve commented Aug 21, 2023

Jenkins and plugins versions report

ci.jenkins.io

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

ci.jenkins.io

Reproduction steps

  1. Run a build (ex: https://ci.jenkins.io/job/Packaging/job/docker-ssh-agent/job/master/336/)
  2. Check nanoserver Docker image build logs

Expected Results

No error in nanoserver Docker image build logs.

Actual Results

Error in nanoserver Docker image build logs:

Step 24/32 : RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ;     $url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ;     Write-Host "Retrieving $url..." ;     Invoke-WebRequest -Uri $url -OutFile C:/openssh.zip -UseBasicParsing ;     Expand-Archive c:/openssh.zip 'C:/Program Files' ;     Remove-Item C:/openssh.zip ;     $env:PATH = '{0};{1}' -f $env:PATH,'C:\Program Files\OpenSSH-Win64' ;     & 'C:/Program Files/OpenSSH-Win64/Install-SSHd.ps1' ;     if(!(Test-Path 'C:\ProgramData\ssh')) { New-Item -Type Directory 
-Path 'C:\ProgramData\ssh' | Out-Null } ;     Copy-Item 'C:\Program Files\OpenSSH-Win64\sshd_config_default' 'C:\ProgramData\ssh\sshd_config' ;     $content = Get-Content -Path "C:\ProgramData\ssh\sshd_config" ;     $content | ForEach-Object { $_ -replace '#PermitRootLogin.*','PermitRootLogin no'                         -replace '#PasswordAuthentication.*','PasswordAuthentication no'                         -replace '#PermitEmptyPasswords.*','PermitEmptyPasswords no'                         -replace '#PubkeyAuthentication.*','PubkeyAuthentication yes'                         -replace '#SyslogFacility.*','SyslogFacility LOCAL0'                         -replace '#LogLevel.*','LogLevel INFO'                         -replace 'Match Group administrators',''                         -replace '(\s*)AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys',''                 } |     Set-Content -Path "C:\ProgramData\ssh\sshd_config" ;     Add-Content -Path "C:\ProgramData\ssh\sshd_config" -Value 'ChallengeResponseAuthentication no' ;     Add-Content -Path "C:\ProgramData\ssh\sshd_config" -Value 'HostKeyAgent \\.\pipe\openssh-ssh-agent' ;     Add-Content -Path "C:\ProgramData\ssh\sshd_config" -Value ('Match User {0}' -f $env:JENKINS_AGENT_USER) ;     Add-Content -Path "C:\ProgramData\ssh\sshd_config" -Value ('       AuthorizedKeysFile C:/Users/{0}/.ssh/authorized_keys' -f $env:JENKINS_AGENT_USER) ;     New-Item -Path HKLM:\SOFTWARE -Name OpenSSH -Force | Out-Null ;     New-ItemProperty -Path HKLM:\SOFTWARE\OpenSSH -Name DefaultShell -Value 'C:\Program Files\Powershell\pwsh.exe' -PropertyType string -Force | Out-Null
 ---> Running in 4e7902f9dca7
Retrieving https://github.com/PowerShell/Win32-OpenSSH/releases/download/V8.6.0.0p1-Beta/OpenSSH-Win64.zip ...
C:\"C:\Program Files\OpenSSH-Win64\openssh-events.man"(0): Error 0x8007007b: At column=0, The filename, directory name, or volume label syntax is incorrect.

Failed to load XML document C:\"C:\Program Files\OpenSSH-Win64\openssh-events.man".
The filename, directory name, or volume label syntax is incorrect.
  [*] C:\Program Files\OpenSSH-Win64\moduli
Inheritance is removed from 'C:\Program Files\OpenSSH-Win64\moduli'.
'BUILTIN\Users' now has Read access to 'C:\Program Files\OpenSSH-Win64\moduli'. 
      Repaired permissions

C:\"C:\Program Files\OpenSSH-Win64\openssh-events.man"(0): Error 0x8007007b: At column=0, The filename, directory name, or volume label syntax is incorrect.

Failed to load XML document C:\"C:\Program Files\OpenSSH-Win64\openssh-events.man".
The filename, directory name, or volume label syntax is incorrect.
 [SC] SetServiceObjectSecurity SUCCESS
 [SC] ChangeServiceConfig2 SUCCESS
 [SC] ChangeServiceConfig2 SUCCESS
 sshd and ssh-agent services successfully installed
Complete logs with colors image

Anything else?

Noticed while working on #295 (comment)

@lemeurherve lemeurherve changed the title nanoserver build error: Failed to load XML document C:\"C:\Program Files\OpenSSH-Win64\openssh-events.man" nanoserver build error: Failed to load XML document C:\"C:\Program Files\OpenSSH-Win64\openssh-events.man" Aug 21, 2023
@lemeurherve
Copy link
Member Author

Note: even with this error message OpenSSH is correctly installed as tested in #295

@lemeurherve
Copy link
Member Author

Fixed in #403 and released as https://github.com/jenkinsci/docker-ssh-agent/releases/tag/5.37.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant