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

Getting Remote server return 404 error. #36

Closed
aviasoletech opened this issue Sep 3, 2021 · 3 comments
Closed

Getting Remote server return 404 error. #36

aviasoletech opened this issue Sep 3, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@aviasoletech
Copy link

aviasoletech commented Sep 3, 2021

When I tried to execute Get-LSUpdate with administrator mode it's returning the below error. Can you please guide me on this issue?.

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.0\private\Save-PackageFile.ps1:46 char:9
+         $webClient.DownloadFile($SourceFile.AbsoluteLocation, $Downlo ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebExceptio
@aviasoletech aviasoletech added the bug Something isn't working label Sep 3, 2021
@jantari
Copy link
Owner

jantari commented Sep 4, 2021

If it is just one 404 error you get and the command otherwise works as expected it is most likely that a file is just missing in Lenovos repository. That does happen.

You can run Get-LSUpdate with the -Verbose parameter and it'll tell you what URLs it's trying to download. If the URL points to a file that doesn't exist you'll get a 404, but only Lenovo can fix that or you have to use your own repository.

@jantari
Copy link
Owner

jantari commented Sep 16, 2021

It's been a while, have you had a chance to look into this any further? What computer model are you getting this 404 on (output of (gcim CIM_ComputerSystem).Model) ?

@jantari
Copy link
Owner

jantari commented Sep 27, 2021

Closing due to the lack of responses and the fact that some rare but reproducible 404s are "normal" for some computer models when accessing the official Lenovo repository, which is just sometimes missing a file. Typically this can be ignored, however should you ever get this error when accessing a self-hosted repository I'd advise trying to find and add the missing file(s) in there.

@jantari jantari closed this as completed Sep 27, 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