communitytools-image2docker-win icon indicating copy to clipboard operation
communitytools-image2docker-win copied to clipboard

Script fails with cannot find path error

Open stationcasinosgithub opened this issue 8 years ago • 8 comments

Running this command in an administrator PS shell: ConvertTo-Dockerfile -ImagePath D:\temp\Share\COVQAWEBSVC03\COVQAWEBSVC03-disk1.vhdx -Ar tifact IIS -OutputPath d:\temp\share\docker

Fails with a bunch of the below errors. Does something have to already exist on my machine for this to work? Thanks for any help!

Copy-Item : Cannot find path 'C:\Users\RAY~1.DEV\AppData\Local\Temp\6c849d2b-3068-455f-a42d-2b2b1b362d20-mount\WebSites \websvc\AccountManagement\MessagingServices' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.1\Functions\Private\Artifacts\IIS\Generate_IIS.ps1:64 char:5

  • Copy-Item $fullSourcePath $ManifestPath -Recurse -Force
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (C:\Users\RAY~1....ssagingServices:String) [Copy-Item], ItemNotFoundExce ption
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

Copy-Item : Cannot find path 'C:\Users\RAY~1.DEV\AppData\Local\Temp\6c849d2b-3068-455f-a42d-2b2b1b362d20-mount\WebSites\websvc\Enterprise' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.1\Functions\Private\Artifacts\IIS\Generate_IIS.ps1:64 char:5

  • Copy-Item $fullSourcePath $ManifestPath -Recurse -Force
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (C:\Users\RAY~1....bsvc\Enterprise:String) [Copy-Item], ItemNotFoundExce ption
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

stationcasinosgithub avatar May 03 '17 17:05 stationcasinosgithub

No, you don't need any extra software - only PowerShell 5.0 and Image2Docker.

It could be the long path name for the default mount path is causing a problem - can you try specifying a mount path, adding this to the end of your ConvertTo-Dockerfile command:

... -MountPath c:\i2d-temp

sixeyed avatar May 03 '17 19:05 sixeyed

So I added that to the command and then received the below errors. The folder was actually created by this process but was empty. I did notice that a bunch of folders was created in the d:\temp\share\docker folder, so I am now running the command with -MountPath d:\temp\share\docker.

Copy-Item : Cannot find path 'D:\i2d-temp\WebSites\websvc\AccountManagement\MessagingServices' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.1\Functions\Private\Artifacts\IIS\Generate_IIS.ps1:64 char:5

  • Copy-Item $fullSourcePath $ManifestPath -Recurse -Force
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (D:\i2d-temp\Web...ssagingServices:String) [Copy-Item], ItemNotFoundExce ption
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

Copy-Item : Cannot find path 'D:\i2d-temp\WebSites\websvc\Enterprise' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.1\Functions\Private\Artifacts\IIS\Generate_IIS.ps1:64 char:5

  • Copy-Item $fullSourcePath $ManifestPath -Recurse -Force
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (D:\i2d-temp\WebSites\websvc\Enterprise:String) [Copy-Item], ItemNotFoun dException
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

stationcasinosgithub avatar May 04 '17 19:05 stationcasinosgithub

So that didn't work either - results below:

PS D:\temp\Share\COVQAWEBSVC03> ConvertTo-Dockerfile -ImagePath D:\temp\Share\COVQAWEBSVC03\COVQAWEBSVC03-disk1.vhdx -Ar tifact IIS -OutputPath d:\temp\share\docker -MountPath d:\temp\share\docker Copy-Item : Cannot find path 'D:\temp\share\docker\WebSites\websvc\AccountManagement\MessagingServices' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.1\Functions\Private\Artifacts\IIS\Generate_IIS.ps1:64 char:5

  • Copy-Item $fullSourcePath $ManifestPath -Recurse -Force
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (D:\temp\share\d...ssagingServices:String) [Copy-Item], ItemNotFoundExce ption
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

Copy-Item : Cannot find path 'D:\temp\share\docker\WebSites\websvc\Enterprise' because it does not exist. At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.1\Functions\Private\Artifacts\IIS\Generate_IIS.ps1:64 char:5

  • Copy-Item $fullSourcePath $ManifestPath -Recurse -Force
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (D:\temp\share\d...bsvc\Enterprise:String) [Copy-Item], ItemNotFoundExce ption
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

stationcasinosgithub avatar May 04 '17 19:05 stationcasinosgithub

Does your VM use multiple VHDs? E.g. one for the OS and another for the IIS content?

sixeyed avatar May 04 '17 19:05 sixeyed

I'm being told and fairly confident that there is only the c drive. This started as a VMWare ESX hard drive, I converted it to Hyper-v using a MS tool and then ran the PS command on it. Interesting though is that when I run the command without the MountPath command, the d:\temp\share\docker folder contains what appears to be enough to build the Docker container. Trying that now.

stationcasinosgithub avatar May 04 '17 21:05 stationcasinosgithub

@stationcasinosgithub did things work for you, or is this still an issue?

pdevine avatar Jul 22 '17 23:07 pdevine

I have the same problem:

ConvertTo-Dockerfile -ImagePath D:\Trace\DS_APP.vhdx -Artifact IIS -ArtifactParam AppName -MountPath D:\DockerMount\

Copy-Item : Cannot find path D:\DockerMount\Vulcan\App\AppName\Site because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.3\Functions\Private\Artifacts\IIS\Generate_IIS.ps1:71 char:5
+     Copy-Item $fullSourcePath $ManifestPath -Recurse -Force
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (D:\DockerMount\Vulcan\App\AppName\Site:String) [Copy-Item], ItemNotFoundE   xception
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

There is only one VHDX file but all app files are on drive D: (two partitions in one file).

lukaszherman avatar Aug 09 '17 12:08 lukaszherman

I have the same problem. IIS Config file is on C: drive, but IIS site folders are on the D: drive. Any easy way to fix this?

chrisgelhaus avatar Sep 13 '18 14:09 chrisgelhaus