Skip to content

Soft Fail due to Erroneous Missing File #71

@shoddyguard

Description

@shoddyguard

When running Install-Package -Name docker -ProviderName DockerMsftProvider -Force as part of an unattended installation on Server 2019 Datacenter (April 2020 Update) the script bombs out due to a erroneous missing file.

Install-Package : An object at the specified path C:\Users\S552A~1.B-A does not exist.
At line:1 char:1
+ Install-Package -Name docker -ProviderName DockerMsftProvider -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], E
   xception
    + FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.RemoveItemCommand,Microsoft.PowerShell.PackageMan
   agement.Cmdlets.InstallPackage

I believe the issue is that something is referencing $env:TEMP but this environment variable can be truncated to the DOS 8.3 standard which is causing some issue with whatever check there is for the presence of the file.

Stepping through the process it seems to be the Docker_DockerSearchIndex.json file:

VERBOSE: Download size: 0.02MB
VERBOSE: Free space on the drive: 32830.55MB
VERBOSE: Downloading https://dockermsft.azureedge.net/dockercontainer/DockerMsftIndex.json to C:\Users\S552A~1.B-A\AppData\Local\Temp\2\DockerMsftProvider\Docker_DockerSearchIndex.json
VERBOSE: About to download
VERBOSE: Finished downloading
VERBOSE: Downloaded in 0 hours, 0 minutes, 0 seconds.
WARNING: An object at the specified path C:\Users\S552A~1.B-A does not exist.

If I check my $env:TEMP variable I indeed get: PS C:\Users\user.name>> $env:TEMP C:\Users\S552A~1.B-A\AppData\Local\Temp\2
Checking for the presence of the file manually I can find it

PS C:\Users\user.name>> Get-ChildItem C:\Users\user.name\AppData\Local\Temp\2\DockerMsftProvider


    Directory: C:\Users\user.name\AppData\Local\Temp\2\DockerMsftProvider


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       04/06/2020     02:38          24250 DockerDefault_DockerSearchIndex.json
-a----       04/06/2020     02:47          24250 Docker_DockerSearchIndex.json

I've tried this on 5 different machines (physical and virtual) and the result is the same.

Docker does however appear to install and run just fine, however this error is especially annoying as it can't easily be filtered out via a try/catch due to the fact that it's a System.Exception.

If other people run into this as a workaround you can filter on $_.Exception.Message

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions