appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 66 forks source link

Npcap silent installation fails on Visual Studio 2019 image #3491

Open seladb opened 4 years ago

seladb commented 4 years ago

In PcapPlusPlus Appveyor CI I've tried to install Npcap v0.96 with silent install: npcap-0.96.exe /S on the Visual Studio 2019 image, but unfortunately the installation fails and the whole build fails. It does work on the older images Visual Studio 2017 and Visual Studio 2015.

I thought it might be related to the fact that Visual Studio 2019 is running on Windows Server 2019 so I installed a VHD image of Windows Server 2019 and tried the same, but apparently the silent install does work with Administrator privileges.

Do you know what might cause the Npcap silent install to fail?

FeodorFitsner commented 4 years ago

Not sure about npcap installer and the engine it's made with, but msiexec for MSI-based installers allows capturing the installation logs. You have to figure out how to get installation log for npcap-0.96.exe /S. Also, you may try using RDP to see what's going on during the installation.

seladb commented 4 years ago

Thanks for your guidance on using RDP! I've tried that and apparently the machine running the job loses network connectivity for a few second during Npcap install (connectivity is restored later). I'm not sure why that happens so I opened https://github.com/nmap/npcap/issues/215 for the Npcap team.

Is there a timeout/threshold I can set from AppVeyor side to keep the job alive even if the machine running it loses connectivity for some time?

seladb commented 4 years ago

@FeodorFitsner apparently the issue is on the Windows side as mentioned in https://github.com/nmap/npcap/issues/53. Is there any way to configure the appveyor worker/task manager to retry a few times when it loses connectivity before failing the job?

FeodorFitsner commented 4 years ago

The build agent is made to reconnect, in general, but may there is something else. As a solution you can try rebooting VM after installing Npcap. appveyor.yml fragment:

test_script:
  ...
  - <here you install npcap>

  # Restart VM
  - ps: Start-Sleep -s 5; Restart-Computer
  - ps: Start-Sleep -s 5

  - <do your tests>
  ...

Let me know if that worked.

pavel-kirienko commented 3 years ago

@FeodorFitsner why is the first Start-Sleep necessary in Start-Sleep -s 5; Restart-Computer?

FeodorFitsner commented 3 years ago

VM restart is not something that can be controlled by or seen from a running build agent, so I guess that sleep is to give it a chance to exit properly. In general, this recipe was determined by multiple experiments.