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

Downloaded file is at old $env:TEMP\chocolatey\chocolatey location, but install calls with just $env:TEMP\chocolatey\ location #969

Closed
Chicopower opened this issue Sep 20, 2016 · 10 comments

Comments

@Chicopower
Copy link

Chicopower commented Sep 20, 2016

Original title: ERROR: Exception calling "Start" with "0" argument(s): "The directory name is invalid"

What You Are Seeing?

The directory name is invalid error when i install my chocolatey package with Chocolatey v.0.10.1
It seem that chocolatey v.0.10.1 download my package here:
C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\chocolatey
But use this path to install it:
C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\

What is Expected?

Package installation to complete.
The same package install successfully with Chocolatey v.0.10.0

How Did You Get This To Happen? (Steps to Reproduce)

Install started with:
choco install DSAP.RMQ.VS2012 --allow-empty-checksums --execution-timeout=27000

Here is my chocolate package "DSAP.RMQ.VS2012" content:
$packageName = 'DSAP.RMQ.VS2012'
$url = 'xxxmyurlxxx/en_visual_studio_premium_2012_x86_web_installer_2599080.exe'
$silentArgs = "/S /Passive /NoRestart /ProductKey xxxmyproductkeyxxx"
$fileType = 'EXE'

try {
Install-ChocolateyPackage $packageName $fileType $silentArgs $url

} catch {
throw $_.Exception
}

Output Log

2016-09-20 09:31:59,441 [INFO ] - Download of en_visual_studio_premium_2012_x86_web_installer_2599080.exe (955.23 KB) completed.
2016-09-20 09:31:59,441 [INFO ] -
2016-09-20 09:32:02,457 [DEBUG] - No runtime virus checking built into FOSS Chocolatey. Check out Pro/Business - https://chocolatey.org/compare
2016-09-20 09:32:02,457 [DEBUG] - Checking that 'C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\chocolatey\DSAP.RMQ.VS2012\1.0.0.1\en_visual_studio_premium_2012_x86_web_installer_2599080.exe' is the size we expect it to be.
2016-09-20 09:32:02,457 [DEBUG] - Verifying package provided checksum of '' for 'C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\chocolatey\DSAP.RMQ.VS2012\1.0.0.1\en_visual_studio_premium_2012_x86_web_installer_2599080.exe'.
2016-09-20 09:32:02,472 [DEBUG] - Running 'Get-ChecksumValid' with file:'C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\chocolatey\DSAP.RMQ.VS2012\1.0.0.1\en_visual_studio_premium_2012_x86_web_installer_2599080.exe', checksum: '', checksumType: '', originalUrl: 'xxxmyurlxxx/en_visual_studio_premium_2012_x86_web_installer_2599080.exe'
2016-09-20 09:32:02,472 [DEBUG] - Empty checksums are allowed due to allowEmptyChecksums feature or option.
2016-09-20 09:32:02,488 [DEBUG] - Running 'Install-ChocolateyInstallPackage' for DSAP.RMQ.VS2012 with file:'C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\chocolatey\DSAP.RMQ.VS2012\1.0.0.1\en_visual_studio_premium_2012_x86_web_installer_2599080.exe', args: '/S /Passive /NoRestart /ProductKey xxxmyproductkeyxxx', fileType: 'EXE', validExitCodes: '0', useOnlyPackageSilentArguments: 'False'
2016-09-20 09:32:02,488 [INFO ] - Installing DSAP.RMQ.VS2012...
2016-09-20 09:32:02,488 [INFO ] -
2016-09-20 09:32:02,488 [INFO ] - Installing DSAP.RMQ.VS2012...
2016-09-20 09:32:02,535 [DEBUG] - Running 'Start-ChocolateyProcessAsAdmin' with exeToRun:'C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\DSAP.RMQ.VS2012\1.0.0.1\en_visual_studio_premium_2012_x86_web_installer_2599080.exe', statements: '/S /Passive /NoRestart /ProductKey xxxmyproductkeyxxx ', workingDirectory: 'C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\DSAP.RMQ.VS2012\1.0.0.1'
2016-09-20 09:32:02,535 [DEBUG] - Elevating Permissions and running ["C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\DSAP.RMQ.VS2012\1.0.0.1\en_visual_studio_premium_2012_x86_web_installer_2599080.exe" /S /Passive /NoRestart /ProductKey xxxmyproductkeyxxx ]. This may take a while, depending on the statements.
2016-09-20 09:32:02,535 [WARN ] - WARNING: May not be able to find 'C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\DSAP.RMQ.VS2012\1.0.0.1\en_visual_studio_premium_2012_x86_web_installer_2599080.exe'. Please use full path for executables.
2016-09-20 09:32:02,535 [INFO ] - WARNING: May not be able to find 'C:\Users\xxxmyusernamexxx\AppData\Local\Temp\chocolatey\DSAP.RMQ.VS2012\1.0.0.1\en_visual_studio_premium_2012_x86_web_installer_2599080.exe'. Please use full path for executables.
2016-09-20 09:32:02,660 [DEBUG] - Setting RunAs for elevation
2016-09-20 09:32:02,691 [ERROR] - ERROR: Exception calling "Start" with "0" argument(s): "The directory name is invalid"
2016-09-20 09:32:02,691 [INFO ] - ERROR: Exception calling "Start" with "0" argument(s): "The directory name is invalid"
2016-09-20 09:32:02,707 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\DSAP.RMQ.VS2012\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '''] exited with '-1'.

@ferventcoder
Copy link
Member

We typically want the full output log please including configuration values.

It's possible the fix we implemented for #908 was only a partial fix and caused this issue.

@ferventcoder ferventcoder added this to the 0.10.2 milestone Sep 20, 2016
@ferventcoder ferventcoder self-assigned this Sep 22, 2016
@ferventcoder ferventcoder changed the title ERROR: Exception calling "Start" with "0" argument(s): "The directory name is invalid" Downloaded file is at old $env:TEMP\chocolatey\chocolatey location, but install calls with just $env:TEMP\chocolatey\ location Sep 22, 2016
ferventcoder added a commit that referenced this issue Sep 22, 2016
When seen in other methods, ensure that it replaces the value
appropriately.
ferventcoder added a commit that referenced this issue Sep 22, 2016
Only remove the file path from the double chocolatey folder in the temp
directory when a file exists at that location.
ferventcoder added a commit that referenced this issue Sep 22, 2016
Generate the ignore after the file location has been determined.
ferventcoder added a commit that referenced this issue Sep 22, 2016
* stable:
  (GH-969) Generate ignore after $file location
  (GH-969) Remove double choco folder if file exists
  (GH-969) Ensure replacement of double chocolatey
  (doc) update CHANGELOG_LICENSED
  (GH-971) Expand Env Variables for Config Settings
  (GH-971) IEnvironment.ExpandEnvironmentVariables
  (GH-972) Fix - UseOriginalLocation fails w/no 64bit file
@ferventcoder
Copy link
Member

The workaround for this is to explicitly set the cacheLocation - choco config set cacheLocation value

@togakangaroo
Copy link

hmm...I'm still getting this even on v0.10.5. I've run

choco config set cacheLocation $env:TEMP/chocolatey

and I've verified its set correctly with choco config get cacheLocation. Still, upgrading ilspy gives me this error.

> choco config get cacheLocation
Chocolatey v0.10.5
C:\Users\gmaue\AppData\Local\Temp/chocolatey
> choco upgrade ilspy -y
Chocolatey v0.10.5
Upgrading the following packages:
ilspy
By upgrading you accept licenses for the packages.

You have ilspy v2.3.1.1855 installed. Version 2.4.0.1963 is available based on your source(s).
Progress: Downloading ilspy 2.4.0.1963... 100%

ilspy v2.4.0.1963 [Approved]
ilspy package files upgrade completed. Performing other installation steps.
File appears to be downloaded already. Verifying with package checksum to determine if it needs to be redownloaded.
Hashes match.
Hashes match.
Extracting C:\Users\gmaue\AppData\Local\Temp\chocolatey\ilspy\2.4.0.1963\ILSpy_Master_2.4.0.1963_Binaries.zip to C:\ProgramData\chocolatey\lib\ilspy\tools...
ERROR: Exception calling "Start" with "0" argument(s): "The directory name is invalid"
The upgrade of ilspy was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\ilspy\tools\chocolateyInstall.ps1'.
 See log for details.

Chocolatey upgraded 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - ilspy (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\ilspy\tools\chocolateyInstall.ps1'.
 See log for details.

@ferventcoder
Copy link
Member

@togakangaroo you see this because you specifically set the cacheLocation that way. Don't. ;)

@togakangaroo
Copy link

togakangaroo commented May 15, 2017 via email

@ferventcoder
Copy link
Member

choco config set cacheLocation c:\programdata\choco-cache is more appropriate.

@ferventcoder
Copy link
Member

ferventcoder commented May 15, 2017

If you have the full log file, I think we will see your issue is specifically with setting "/" versus "\" - not all tools in Windows know how to deal with the forward slash. Best not to have that be a path setting.

@ferventcoder
Copy link
Member

Actually, please file another issue about normalizing the paths of settings. Thanks!

@togakangaroo
Copy link

Ok, Will do, but the above fix didn't work

> choco config set cacheLocation c:\programdata\choco-cache
Chocolatey v0.10.5
Updated cacheLocation = c:\programdata\choco-cache
> choco upgrade ilspy -y
Chocolatey v0.10.5
Upgrading the following packages:
ilspy
By upgrading you accept licenses for the packages.

You have ilspy v2.3.1.1855 installed. Version 2.4.0.1963 is available based on your source(s).
Progress: Downloading ilspy 2.4.0.1963... 100%

ilspy v2.4.0.1963 [Approved]
ilspy package files upgrade completed. Performing other installation steps.
Downloading ilspy
  from 'https://github.com/icsharpcode/ILSpy/releases/download/v2.4/ILSpy_Master_2.4.0.1963_Binaries.zip'
Progress: 100% - Completed download of c:\programdata\choco-cache\ilspy\2.4.0.1963\ILSpy_Master_2.4.0.1963_Binaries.zip (1.86 MB).
Download of ILSpy_Master_2.4.0.1963_Binaries.zip (1.86 MB) completed.
Hashes match.
Extracting c:\programdata\choco-cache\ilspy\2.4.0.1963\ILSpy_Master_2.4.0.1963_Binaries.zip to C:\ProgramData\chocolatey\lib\ilspy\tools...
ERROR: Exception calling "Start" with "0" argument(s): "The directory name is invalid"
The upgrade of ilspy was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\ilspy\tools\chocolateyInstall.ps1'.
 See log for details.

Chocolatey upgraded 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - ilspy (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\ilspy\tools\chocolateyInstall.ps1'.

@ferventcoder
Copy link
Member

@togakangaroo please provide a full gist of debug / verbose output. The log file actually captured this for your already, so we'll just need to see all the detailed output as it will be more helpful than the default informational output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants