d365collaborative / d365fo.tools

Tools used for Dynamics 365 Finance and Operations
MIT License
246 stars 101 forks source link

Exception calling "Start" with "0" arguments: "The system cannot find the file specified" #350

Closed JohannesDrexler closed 4 years ago

JohannesDrexler commented 4 years ago

I tried to install a package on my local VM like this: Invoke-D365SDPInstall -Path .\LAC365FO_Version_6100\ -QuickInstallAll -verbose

and it exits with the following logs:

`VERBOSE: [12:40:23][Test-AssembliesLoaded] Total time spent inside the function was 00:00:00
VERBOSE: [12:40:23][Test-PathExists] Testing the path: C:\Logs\InstallationRecords\Runbooks
VERBOSE: [12:40:23][Test-PathExists] Testing the path:
C:\Logs\InstallationRecords\Runbooks\Runbook_20191210002946e97ea11a-cb12-4a3a-8784-6e71875a2d38.xml
VERBOSE: [12:40:24][Test-PathExists] Testing the path:
C:\Logs\InstallationRecords\Runbooks\Runbook_20191209235752a75cf1dc-aeee-4ece-8d34-257b360adaa5.xml
VERBOSE: [12:40:24][Test-PathExists] Testing the path:
C:\Logs\InstallationRecords\Runbooks\Runbook_201907301123489754aeb1-8650-4c61-8589-c86d14a4b895.xml
VERBOSE: [12:40:24][Test-PathExists] Testing the path:
C:\Logs\InstallationRecords\Runbooks\Runbook_20190730104631cd5718f8-4351-4922-9658-abb1087be237.xml
VERBOSE: [12:40:24][Test-PathExists] Testing the path: .\LAC365FO_Version_6100\DefaultTopologyData.xml
VERBOSE: [12:40:24][Test-PathExists] Testing the path: .\LAC365FO_Version_6100\AXUpdateInstaller.exe
VERBOSE: [12:40:24][Invoke-D365SDPInstall] Using QuickInstallAll mode
VERBOSE: [12:40:24][Invoke-TimeSignal] The command 'Invoke-Process' was already taking part in time measurement. The
entry has been update with current date and time.
VERBOSE: [12:40:24][Test-PathExists] Testing the path: .\LAC365FO_Version_6100\AXUpdateInstaller.exe
VERBOSE: [12:40:24][Invoke-Process] Output and Error streams will be redirected (silence mode)
VERBOSE: [12:40:24][Invoke-Process] Starting the AXUpdateInstaller.exe
Exception calling "Start" with "0" argument(s): "The system cannot find the file specified"
At line:3001 char:5
+     $p.Start() | Out-Null
+     ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : Win32Exception

You cannot call a method on a null-valued expression.
At line:3004 char:9
+         $stdout = $p.StandardOutput.ReadToEnd()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At line:3005 char:9
+         $stderr = $p.StandardError.ReadToEnd()
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

VERBOSE: [12:40:24][Invoke-Process] Waiting for the AXUpdateInstaller.exe to complete
Exception calling "WaitForExit" with "0" argument(s): "No process is associated with this object."
At line:3009 char:5
+     $p.WaitForExit()
+     ~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : InvalidOperationException

[12:40:24][Invoke-Process] Exit code from AXUpdateInstaller.exe indicated an error happened. Will output both standard s
tream and error stream.
[12:40:24][Invoke-Process] Standard output was: \r\n
[12:40:24][Invoke-Process] Error output was: \r\n
WARNING: [12:40:24][Invoke-Process] Stopping because of Exit Code. | Stopping because an Exit Code from
AXUpdateInstaller.exe wasn't 0 (zero) like expected.
VERBOSE: [12:40:24][Invoke-D365SDPInstall] Total time spent inside the function was 00:00:00.0938006`

However when i use the full path the command works as expected: Invoke-D365SDPInstall -Path "C:\Users\Administrator\Downloads\LAC365FO_Version_6100" -QuickInstallAll -verbose

I believe the way the path is handled needs a bit tweaking. I'll try to set up a PR later

Splaxi commented 4 years ago

I believe you should be inside the sub folder and simply use -Path "."

JohannesDrexler commented 4 years ago

Sorry for letting you wait so long for feedback... i set the current directory to the directory of the extrated package and tried using "." as path. this resulted in the following output:

PS C:\Temp\pu31> Invoke-D365SDPInstall -Path . -QuickInstallAll
[14:47:13][Test-PathExists] The C:\windows\system32\DefaultTopologyData.xml path wasn't found. Please ensure the path exists and you have enough permission to access the path.
[14:47:13][Test-PathExists] The C:\windows\system32\AXUpdateInstaller.exe path wasn't found. Please ensure the path exists and you have enough permission to access the path.
WARNING: [14:47:13][Test-PathExists] Stopping because of missing paths.

using .\. as path resulted in the same messages as in the initial message in this issue

Splaxi commented 4 years ago

Could you please try with the Verbose parameter enabled? 🤔

Splaxi commented 4 years ago

And could you confirm what version you are running? 😉

JohannesDrexler commented 4 years ago

i used version 0.5.61 of d365fo.tools. i'll try again with -verbose and post results here once my vm is ready again

Splaxi commented 4 years ago

I believe I have found the bug - 0.5.63 should solve the issue.

Please give it 10-15 minutes to upload to the PowerShellGallery