Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

"update-icinga" of component "service" fails but reports "success"

Aperta
#857 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
powershell
Ambito
devops

Direzione di ricerca

Inizia riproducendo il comportamento con gli entry point update-icinga -confirm e show-icinga, concentrandoti sulla sostituzione non riuscita di icinga-service.exe. Traccia il modo in cui il comando di aggiornamento gestisce gli errori di eliminazione e copia segnalati. Il lavoro è completato quando un aggiornamento non riuscito del servizio viene segnalato come non riuscito e le versioni installata e disponibile sono coerenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Investigation

The IfW-component has to be updated from version 1.2.0 to 1.3.0.:

Component    Version   Available
---          ---       ---
agent        2.15.2    2.15.2
framework    1.13.5    1.13.5
plugins      1.13.1    1.13.1
service      1.2.0     1.3.0

Try to update in an admin-PS with

update-icinga -confirm

[Notice]: The installed version "1.13.5" of component "framework" is identical or lower than the new version "1.13.5". Use "-Force" to install anyway
[Notice]: The installed version "1.13.1" of component "plugins" is identical or lower than the new version "1.13.1". Use "-Force" to install anyway
[Notice]: The installed version "2.15.2" of component "agent" is identical or lower than the new version "2.15.2". Use "-Force" to install anyway
[Notice]: Downloading "service" from https://mydownloadhost/service/icinga-service-v1.3.0.zip
[Notice]: Installing component "service" into "C:\Program Files\icinga-framework-service\"
[Notice]: Updating Icinga PowerShell Service binary
[Notice]: Waiting for lock on path "C:\Program Files\icinga-framework-service\icinga-service.exe" to be released before trying to remove it
[Error]: Failed to remove items from path "C:\Program Files\icinga-framework-service\icinga-service.exe". Recurse is "False", Force is "True": "System.UnauthorizedAccessException: Access to the path 'C:\Program Files\icinga-framework-service\icinga-service.exe' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileInfo.Delete()
   at Microsoft.PowerShell.Commands.FileSystemProvider.RemoveFileSystemItem(FileSystemInfo fileSystemInfo, Boolean force
)"
[Error]: Failed to copy items from path "C:\Program Files\icinga-framework-service\icinga-service.exe.update" to "C:\Program Files\icinga-framework-service\icinga-service.exe": System.IO.IOException: The process cannot access the file 'C:\Program Files\icinga-framework-service\icinga-service.exe' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at System.IO.FileInfo.CopyTo(String destFileName, Boolean overwrite)
   at Microsoft.PowerShell.Commands.FileSystemProvider.CopyFileInfoItem(FileInfo file, String destinationPath, Boolean f
orce, PowerShell ps)
   at Microsoft.PowerShell.Commands.FileSystemProvider.CopyItemLocalOrToSession(String path, String destinationPath, Boo
lean recurse, Boolean Force, PowerShell ps)
   at Microsoft.PowerShell.Commands.FileSystemProvider.CopyItem(String path, String destinationPath, Boolean recurse)
   at System.Management.Automation.SessionStateInternal.CopyItem(CmdletProvider providerInstance, String path, String co
pyPath, Boolean recurse, CmdletProviderContext context)
[Notice]: Service User ".\LocalSystem" for service "icingapowershell" successfully updated
[Notice]: Stopping service "icingapowershell"
[Notice]: Starting service "icingapowershell"
[Notice]: Stopping service "icingapowershell"
[Notice]: Service User "NT AUTHORITY\NetworkService" for service "icingapowershell" successfully updated
[Notice]: Successfully set the icinga2 service to delayed autostart
[Notice]: Successfully set the icingapowershell service to delayed autostart
[Notice]: Installation of component "service" was successful

now check the "success":

show-icinga
[...]
Installed components on this system:

Component    Version   Available
---          ---       ---
agent        2.15.2    2.15.2
framework    1.13.5    1.13.5
plugins      1.13.1    1.13.1
service      1.2.0     1.3.0

so once again:

update-icinga -confirm
[Notice]: The installed version "1.13.5" of component "framework" is identical or lower than the new version "1.13.5". Use "-Force" to install anyway
[Notice]: The installed version "1.13.1" of component "plugins" is identical or lower than the new version "1.13.1". Use "-Force" to install anyway
[Notice]: The installed version "2.15.2" of component "agent" is identical or lower than the new version "2.15.2". Use "-Force" to install anyway
[Notice]: Downloading "service" from https://mydownloadhost/service/icinga-service-v1.3.0.zip
[Notice]: Installing component "service" into "C:\Program Files\icinga-framework-service\"
[Notice]: Updating Icinga PowerShell Service binary
[Notice]: Service User ".\LocalSystem" for service "icingapowershell" successfully updated
[Notice]: Stopping service "icingapowershell"
[Notice]: Starting service "icingapowershell"
[Notice]: Stopping service "icingapowershell"
[Notice]: Service User "NT AUTHORITY\NetworkService" for service "icingapowershell" successfully updated
[Notice]: Successfully set the icinga2 service to delayed autostart
[Notice]: Successfully set the icingapowershell service to delayed autostart
[Notice]: Installation of component "service" was successful

this was finally successful:

ls 'C:\Program Files\icinga-framework-service\icinga-service.exe' | % versioninfo

ProductVersion   FileVersion      FileName
--------------   -----------      --------
1.3.0.0          1.3.0.0          C:\Program Files\icinga-framework-service\icinga-service.exe

show-icinga
[...]
Component    Version   Available
---          ---       ---
agent        2.15.2    2.15.2
framework    1.13.5    1.13.5
plugins      1.13.1    1.13.1
service      1.3.0     1.3.0
Lingua principale
PowerShell
Stelle
86
Fork
34
Merge medio
1h 31m
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Icinga/icinga-powershell-framework

Tutte le issue di Icinga/icinga-powershell-framework

Issue simili

Altre issue su DevOps

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.