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

404 not found and getw10ver7.exe package error on some machines #37

Closed
IsaacGood opened this issue Oct 1, 2021 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@IsaacGood
Copy link

IsaacGood commented Oct 1, 2021

Describe the bug
Getting the error below on a few lenovo machines. Sometimes a few updates are listed then followed by the exception error, but the error is the same either way.

Error messages or Screenshots
PS C:\WINDOWS\system32> Get-LSUpdate
Exception calling "DownloadFile" with "2" argument(s): "The remote server
returned an error: (404) Not Found."
At C:\Program Files\WindowsPowerShell\Modules\LSUClient\1.3.1\private\Save-Pack
ageFile.ps1:46 char:9

  •     $webClient.DownloadFile($SourceFile.AbsoluteLocation, $Downlo ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : WebException

WARNING: The command or file '%PACKAGEPATH%\getw10ver7.exe' could not be found
from 'C:\WINDOWS\TEMP\31uqabgy.3sc\yh2s4sbc.huz' and was not run

Please complete the following information:

  • Computer model: 81BH (LENOVO_MT_81BH_BU_idea_FM_ideapad 320-15IKB Touch)
  • Computer model: 90F10000US (LENOVO_MT_90F1_BU_LENOVO_FM_ideacentre 300S-08IHH)
  • Module version used: 1.3.1
  • Windows 10 build 19043
@IsaacGood IsaacGood added the bug Something isn't working label Oct 1, 2021
@jantari
Copy link
Owner

jantari commented Oct 2, 2021

Hi, this is likely the same issue as #36 and we've also seen it before as part of #35 with Model 80VB.

If you run Get-LSUpdate with the -Verbose parameter it'll tell you what URLs it's downloading, and for both models 81BH and 90F1 the 404 error comes from same the URL https://download.lenovo.com/marketing/getw10ver7.exe which, if you check it manually, will also give a 404 because it doesn't seem to exist.

That file is just missing on Lenovos servers, probably an oversight on their end, but nothing we can fix unless you want to maintain your own repository. The error isn't fatal so the command contines and the warning you get later is when it's trying to run the getw10ver7.exe file (which doesn't exist because it couldn't be downloaded). Unless you work at Lenovo, I'd ignore this error as it's not caused by your network or LSUClient.

@IsaacGood
Copy link
Author

That's understandable. I was thinking I could modify my script to check for the error and report accordingly but when it gets to the point of the error the script just exits so the rest of the script doesn't execute. Is there a way to make Get-LSUpdate (or whatever it's triggering) not exit the script on error? I assume this would also prevent any updates that come after the error from installing also, unless this error is only occuring after the installs are done.

@jantari
Copy link
Owner

jantari commented Oct 5, 2021

It's a non-terminating error, so unless you've explicitly set -ErrorAction or $ErrorActionPreference to "Stop" in PowerShell it won't exit the cmdlet. If it exited then you also wouldn't get the The command or file '%PACKAGEPATH%\getw10ver7.exe' could not be found warning message later.

I assume this would also prevent any updates that come after the error from installing also, unless this error is only occuring after the installs are done.

The error comes from Get-LSUpdate, so if you're in a situation where PowerShell really exits at that point then no updates would have been installed yet, yes. You'll have to look through your PowerShell settings to find out why it's exiting if that's the case.

@IsaacGood
Copy link
Author

IsaacGood commented Oct 5, 2021

Doh, I forgot I had a generic trap in there to capture errors and exit 2 (script failure for syncro so I get alerted). Commenting that out the script continues fine, thanks. I'll add an exception to ignore 404's. Thanks!

@jantari
Copy link
Owner

jantari commented Oct 5, 2021

Ah yes, that would explain it as well 😉

@jantari jantari closed this as completed Oct 5, 2021
jantari pushed a commit that referenced this issue Jul 28, 2023
this makes no difference when running Get-LSUpdate in a normal
PowerShell session, but some deployment/script-running solutions wrap
the entire script in a big try-catch which triggered on any .NET
exception from DownloadFile. Try-Catching the DownloadFile call
separately and "downgrading" any exceptions to a PowerShell-native
error prevents any unintended script terminations in such cases.

I still recommend NOT wrapping LSUClient scripts in a global try-catch
whenever it is possible to avoid it.

also referencing previous issues #35, #36, #37 and #65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants