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

DownloadWinUpdates should search for up-to-date OS version #133

Closed
mattcowen opened this issue Feb 11, 2021 · 6 comments
Closed

DownloadWinUpdates should search for up-to-date OS version #133

mattcowen opened this issue Feb 11, 2021 · 6 comments

Comments

@mattcowen
Copy link

mattcowen commented Feb 11, 2021

Describe the issue
DownloadWinUpdates.ps1 fails on line 162 and again on 181 because $feed is null. This is because there is no longer an entry in the feed with title "1607" or "Security Update for Adobe Flash Player" respectively. I tried changing this to search for 1809 and checking $feed is not null for the Flash update search. This appears to have worked.

I can submit a PR if wanted

Hardware
VM in Azure

Send the logs
You get the following in WindowsUpdates log
Getting info for latest Adobe Flash Security Update
Azure Stack POC Configurator Stage: WindowsUpdates failed. Updating AzSPoC Progress database
You cannot call a method on a null-valued expression..Exception.Message

@yellowpanda
Copy link

I get the same error message.

@mattmcspirit
Copy link
Owner

Hey both - @mattcowen, @yellowpanda - does your fix require the user to use a newer evaluation of Windows Server 2016 (1607)?

@yellowpanda
Copy link

I think the change can be limited to only handle the case when https://support.microsoft.com/app/content/api/content/feeds/sap/en-us/6ae59d69-36fc-8e4d-23dd-631d98bf74a9/rss does not contain any "Security Update for Adobe Flash Player" patches. But I'm testing.

@mattmcspirit
Copy link
Owner

It's been a while since i looked at this, but i know with the recent fixes, @rfsonders and @SqlTechMike have had things working. We may need to re-validate a few things. Windows Server 2016 is build 1607, and 1809 is 2019. App Service (for example), still requires WS 2016 and will apply the CU's:

2020-10 Cumulative Update for Windows Server 2016 for x64-based Systems (KB4580346)
2020-09 Servicing Stack Update for Windows Server 2016 for x64-based Systems (KB4576750)

If it doesn't detect them in the image. This takes a long time, especially in nested configs, and may cause a failure - that's why i update the base image to start with, but something must be going wrong with the update detection logic that I'll need time to troubleshoot.

As for documentation, it does mention here: https://github.com/mattmcspirit/azurestack#step-3---run-the-azspocps1-script that you should use the WS 2016 Eval, and says that you would have downloaded this with the ASDK bits. If you're running this in the Azure VM, you won't have downloaded the ASDK bits as this was done for you - sorry about the confusion there.

@yellowpanda
Copy link

yellowpanda commented Feb 26, 2021

I think this bug originates from the following piece of code from deployment/powershell/DownloadWinUpdates.ps1:

$rss = "https://support.microsoft.com/app/content/api/content/feeds/sap/en-us/6ae59d69-36fc-8e4d-23dd-631d98bf74a9/rss"
#...
Write-Host "Getting info for latest Adobe Flash Security Update"
$rssFeed = [xml](New-Object System.Net.WebClient).DownloadString($rss)
$feed = $rssFeed.rss.channel.item | Where-Object { $_.title -like "*Security Update for Adobe Flash Player*" }
$feed = ($feed | Select-Object -Property Link | Sort-Object link -Descending) | Select-Object -First 1
$flashKB = "KB" + ($feed.link).Split('/')[4] # <--- Exception: "You cannot call a method on a null-valued expression."
$KBs += $flashKB 

If you open the rss url in a browser and search for "Security Update for Adobe Flash Player" it will not find anything. $feed will therefor be null and the code except.

You can, as suggested above, make an if (@feed) around the last 3 lines, but I guess the intention with this code is to install a patch of some kind.

@mattmcspirit
Copy link
Owner

This should now be fixed in the latest release.

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

Successfully merging a pull request may close this issue.

3 participants