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

Soft Fail due to Erroneous Missing File #71

Open
shoddyguard opened this issue Jun 4, 2020 · 1 comment
Open

Soft Fail due to Erroneous Missing File #71

shoddyguard opened this issue Jun 4, 2020 · 1 comment

Comments

@shoddyguard
Copy link

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

@shoddyguard
Copy link
Author

I've got a better workaround rather than filtering out the $_.Exception.Message.

If you temporarily replace your TEMP path with the full path instead of the truncated path the package installs without fault:

$env:TEMP = (Get-Item $env:TEMP).FullName

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

No branches or pull requests

1 participant