-
Notifications
You must be signed in to change notification settings - Fork 71
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
Exception thrown while "Searching for Windows updates..." #144
Comments
i have the same issue today |
We also have the same issue with builds today, running 0.16 I'm going to try using version 0.15 |
We have the same error with Windows 11 23H2 since today. Already tested plugin version 0.15 and 0.16. |
Same issue here! 0.15 and 0.16 also not working! |
Same issue here! We are not able to create windows images anymore. Is it possible to prioritize PR#145 to get us back in business asap? |
We are encountering the same issue with versions 0.15 and 0.16 as previously reported by other users. We're using the Windows 11 23H2 AVD image without Office from the Azure Marketplace. We would greatly appreciate it if PR #145 could be prioritized to help us resolve this issue as soon as possible. |
Another interesting bit is I also tried using the PSWindowsUpdate Powershell module and it seems to hit a very similar null reference issue? Maybe not related, but it would be quite a coincidence.
|
Same here. My Server 2016 and Server 2022 image templates are able to be built and they include the windows update steps in them. |
@rgl Why did you close the issue without feedback? Please reopen it.
EDIT
|
We're seeing this with Custom Image Templates and AVD customers as well. |
I confirm that the newest update didn't help.
|
I applied the newest release (v0.16.3). The 'CanRequestUserInput' issue is gone, but there is a new one.
|
please try https://github.com/rgl/packer-plugin-windows-update/releases/tag/v0.16.4. it now ignores updates that do not have a title. |
Hello, I tried to update the packer module to 0.16.4 but it does not find any updates anymore: In previous version it always finds updates, example: So, I think it doesn't find the updates anymore. |
I can confirm what @Ruthhl3ss says, it doesn't find updates anymore, it has always found Defender updates before. |
My guess is something in the latest Windows 11 build 22631.3880.240704 released on 07/09 broke WSUS or some other component used by Windows Update Agent, resulting in updates being correctly picked up by the Windows Update Agent but having $null fields. Or something in between those layers broke as well that result in this behavior, not entirely sure at this point. A workaround that worked for me was pinning Windows version to the previous 22631.3737.240607. Not the best thing, but at least it might fix the issue for some of you who don't necessarily care about using the latest version out of the box. The updates from KB5040442 are picked up and installed correctly on the previous version anyway, which seems to be the main difference across the latest and the previous version. EDIT: I spoke too soon, the issue appears again after KB5040442 is installed. So maybe excluding that update would work. |
I tried excluding KB5040442, that worked fine. Something about KB5040442 is breaking the COM interface, so it's not an issue that can be fixed in this plugin. But maybe having an appropriate error message that indicates a break in behavior with Microsoft.Update.Session would be a good idea. |
@jbne Did you try that with plugin version 0.16.4? |
No I tried that with 0.16, haven't updated yet. I agree, other than not having the updates from KB5040442 most users wouldn't be affected by excluding it. |
re: this, tried with 0.16.4 and it worked fine when including a filter this way (as well as setting the image_version to the previous instead of latest):
|
@jbne tried your filter, my pipeline still doesn't install any windows updates. |
this bit "type": "PowerShell", combined with "type": "WindowsUpdate", |
@alucenx Maybe a code block next time? Pretty hard to read ;-) |
|
I have this issue and I'd rather not filter out the KB so I have escalated it to the Windows team to investigate as it is clear that it isn't an issue with this packer plugin. |
Ahh that might be because you're still using the latest image version, you would have to roll back to the previous using image_version - sorry I didn't include that in my comment originally 😅 I updated it to reflect that. That exclusion filter doesn't retroactively work when the KB update is already baked into the image, which is the case with latest. Though it sounds like that piece posted by @alkurdy might fix latest, which is what @alucenx tried. You probably don't need the filter in that case. |
I'm using win11-23h2-pro build 22631.3880.240704 |
the workaround didn't work there. I'm afraid you/we have to wait for microsoft to fix this known issue as described in the article: The June 2024 preview update might impact applications using Windows Update APIs. |
@rgl Thank you for the link! Now we all know this is a Know issue and that we have to wait, sadly. |
As an FYI, I always have had that 'pause before' in the WU task so I can't say if that's what corrected it for me. Edit: Strange. My PRO builds were working fine. I've ran a few packer builds of 11 23h3 pro without issue, then my latest one give me: ERROR EXCEPTION: System.Management.Automation.RuntimeException: the windows update api is in an invalid state. see #144. |
Try using a fixed build (ex: i use 22631.3737.240611, ent) and exclude:$_.Title -like 'KB5040442' |
I re-ran my PRO build right after it errored out and updates sailed through without issue. I haven't excluded 5040442. I'm still using the provisioner like I posted above. I've done other builds after that and so far, none have failed. |
@alucenx When you start from an older build like Today, I'll try the following settings:
UPDATE: This worked extremely well! In the first cycle, he installed every pending update without issues, except the faulty one.
Afterwards all of our software stack was installed.
|
In my case, I had the error ( After upgrading to
My plugin configuration is basic: provisioner "windows-update" {
pause_before = "30s"
} I don't believe the pause is needed anymore - in the past, with |
Microsoft have fixed the underlying cause of the issue in KB5040527 https://support.microsoft.com/en-gb/topic/july-25-2024-kb5040527-os-builds-22621-3958-and-22631-3958-preview-de3e1e24-0c07-4210-9777-8e03a1446bae |
Thanks @HenryGelderbloem, I'll be testing out with the following today:
|
|
Anyone know if this issue has been fixed yet? |
I don't have any more issues. I switched back to image version latest |
I'm getting an error when the builder is in the "Searching for Windows updates..." step. I was able to successfully perform Windows updates using this plugin yesterday and earlier today, my configuration hasn't functionally changed since then so not sure what could be causing this.
Here's the relevant bits, let me know if more info is needed to diagnose the issue:
The text was updated successfully, but these errors were encountered: