Original Title: Uninstall backup files path too long - The fully qualified file name must be less than 260 characters
choco uninstall -y SitefinityCMS
Chocolatey uninstalled 1/1 packages. 0 packages failed.
"C:ProgramDatachocolateychoco.exe" install -y SitefinityCMS -source C:Nuget -force -pre -params "/Environment:Cleanup /InstallRoot:D:Solution"
Yesterday worked fine with 0.9.8 version. Nothing was changed in scripts, just updated choco version and it failed.
2016-08-30 07:37:36,752 [INFO ] - Chocolatey v0.10.0
2016-08-30 07:37:36,752 [DEBUG] - Chocolatey is running on Windows v 6.3.9600.0
2016-08-30 07:37:36,752 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2016-08-30 07:37:36,752 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2016-08-30 07:37:36,767 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" uninstall -y Company.Web.SitefinityCMS
2016-08-30 07:37:36,767 [DEBUG] - Received arguments: uninstall -y Company.Web.SitefinityCMS
2016-08-30 07:37:36,814 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2016-08-30 07:37:36,830 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2016-08-30 07:37:36,830 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2016-08-30 07:37:36,955 [DEBUG] - The source 'https://chocolatey.org/api/v2/' evaluated to a 'normal' source type
2016-08-30 07:37:36,955 [DEBUG] -
NOTE: Hiding sensitive configuration data! Please double and triple
check to be sure no sensitive data is shown, especially if copying
output to a gist for review.
2016-08-30 07:37:36,970 [DEBUG] - Configuration: CommandName='uninstall'|
CacheLocation='C:\Users\S_JNKNS_SLAVE\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
Debug='False'|Verbose='False'|Force='False'|Noop='False'|
HelpRequested='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='False'|AcceptLicense='True'|
AllowUnofficialBuild='False'|Input='Company.Web.SitefinityCMS'|
AllVersions='False'|SkipPackageInstallProvider='False'|
PackageNames='Company.Web.SitefinityCMS'|Prerelease='False'|
ForceX86='False'|OverrideArguments='False'|NotSilent='False'|
IgnoreDependencies='False'|AllowMultipleVersions='False'|
AllowDowngrade='False'|ForceDependencies='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='6.3.9600.0'|
Information.PlatformName='Windows Server 2012 R2'|
Information.ChocolateyVersion='0.10.0.0'|
Information.ChocolateyProductVersion='0.10.0'|
Information.FullName='choco, Version=0.10.0.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|
Information.Is64Bit='True'|Information.IsInteractive='False'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Features.AutoUninstaller='True'|
Features.ChecksumFiles='True'|Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseFipsCompliantChecksums='False'|
ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|FeatureCommand.Command='unknown'|
ConfigCommand.Command='unknown'|PinCommand.Command='unknown'|
2016-08-30 07:37:36,970 [DEBUG] - _ Chocolatey:ChocolateyUninstallCommand - Normal Run Mode _
2016-08-30 07:37:36,986 [INFO ] - Uninstalling the following packages:
2016-08-30 07:37:36,986 [INFO ] - Company.Web.SitefinityCMS
2016-08-30 07:37:37,033 [DEBUG] - Running list with the following filter = ''
2016-08-30 07:37:37,033 [DEBUG] - --- Start of List ---
2016-08-30 07:37:37,330 [DEBUG] - Company.Web.SitefinityCMS 2.0.122-pre
2016-08-30 07:37:37,330 [DEBUG] - chocolatey 0.10.0
2016-08-30 07:37:37,330 [DEBUG] - notepadplusplus 6.7.4
2016-08-30 07:37:37,330 [DEBUG] - redis-64 2.8.2101
2016-08-30 07:37:37,330 [DEBUG] - sqlserverdatatools2012 11.1.41025
2016-08-30 07:37:37,330 [DEBUG] - --- End of List ---
2016-08-30 07:37:37,767 [DEBUG] - Backing up existing Company.Web.SitefinityCMS prior to upgrade.
2016-08-30 07:37:37,767 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\Company.Web.SitefinityCMS'
to 'C:\ProgramData\chocolatey\lib-bkp\Company.Web.SitefinityCMS'
/*Deleted all package content*/
2016-08-30 07:38:08,798 [INFO ] -
Company.Web.SitefinityCMS v2.0.122-pre
2016-08-30 07:38:08,876 [DEBUG] - Removing shim for WebConfigTransformRunner.exe at 'C:\ProgramData\chocolatey\bin\WebConfigTransformRunner.exe
2016-08-30 07:38:08,876 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\bin\WebConfigTransformRunner.exe".
2016-08-30 07:38:08,876 [DEBUG] - Removing shim for WebConfigTransformRunner.vshost.exe at 'C:\ProgramData\chocolatey\bin\WebConfigTransformRunner.vshost.exe
2016-08-30 07:38:08,892 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\bin\WebConfigTransformRunner.vshost.exe".
2016-08-30 07:38:08,923 [INFO ] - Skipping auto uninstaller - No registry snapshot.
2016-08-30 07:38:08,923 [DEBUG] - Calling command ['"C:\Windows\System32\shutdown.exe" /a']
2016-08-30 07:38:08,954 [DEBUG] - Command ['"C:\Windows\System32\shutdown.exe" /a'] exited with '1116'
2016-08-30 07:38:08,954 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\.chocolatey\Company.Web.SitefinityCMS.2.0.122-pre".
2016-08-30 07:38:08,954 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bkp\Company.web.sitefinitycms".
2016-08-30 07:38:16,173 [ERROR] - Company.Web.SitefinityCMS not uninstalled. An error occurred during uninstall:
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
2016-08-30 07:38:16,204 [WARN ] -
Chocolatey uninstalled 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2016-08-30 07:38:16,219 [INFO ] -
2016-08-30 07:38:16,219 [ERROR] - Failures
2016-08-30 07:38:16,235 [ERROR] - - Company.web.sitefinitycms (exited 1) - Company.Web.SitefinityCMS not uninstalled. An error occurred during uninstall:
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
2016-08-30 07:38:16,235 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2016-08-30 07:38:17,298 [DEBUG] - Exiting with 1
2016-08-30 07:38:17,563 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.10.0.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
2016-08-30 07:38:17,563 [DEBUG] - Configured chocolatey.infrastructure.logging.log4net.config.xml from assembly choco, Version=0.10.0.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb
2016-08-30 07:38:17,594 [DEBUG] - XmlConfiguration is now operational
2016-08-30 07:38:17,813 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\config\chocolatey.config.update".
2016-08-30 07:38:17,829 [INFO ] - ============================================================
2016-08-30 07:38:17,829 [INFO ] - Chocolatey v0.10.0
2016-08-30 07:38:17,844 [DEBUG] - Chocolatey is running on Windows v 6.3.9600.0
2016-08-30 07:38:17,844 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2016-08-30 07:38:17,844 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2016-08-30 07:38:17,844 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" install -y Company.Web.SitefinityCMS -source C:\Nuget -force -pre -params "/Environment:Cleanup /InstallRoot:D:\Solution\"
2016-08-30 07:38:17,844 [DEBUG] - Received arguments: install -y Company.Web.SitefinityCMS -source C:\Nuget -force -pre -params /Environment:Cleanup /InstallRoot:D:\Solution"
NOTE: Hiding sensitive configuration data! Please double and triple
check to be sure no sensitive data is shown, especially if copying
output to a gist for review.
2016-08-30 13:08:29,551 [DEBUG] - Configuration: CommandName='install'|
CacheLocation='C:\Users\%user%\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='C:\Nuget'|SourceType='normal'|Debug='False'|Verbose='False'|
Force='True'|Noop='False'|HelpRequested='False'|RegularOutput='True'|
QuietOutput='False'|PromptForConfirmation='False'|AcceptLicense='True'|
AllowUnofficialBuild='False'|Input='SitefinityCMS'|
AllVersions='False'|SkipPackageInstallProvider='False'|
PackageNames='SitefinityCMS'|Prerelease='True'|
ForceX86='False'|OverrideArguments='False'|NotSilent='False'|
PackageParameters='/Environment:Cleanup /InstallRoot:D:\Solution"'|
IgnoreDependencies='False'|AllowMultipleVersions='False'|
AllowDowngrade='False'|ForceDependencies='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='6.3.9600.0'|
Information.PlatformName='Windows Server 2012 R2'|
Information.ChocolateyVersion='0.10.0.0'|
Information.ChocolateyProductVersion='0.10.0'|
Information.FullName='choco, Version=0.10.0.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|
Information.Is64Bit='True'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Features.AutoUninstaller='True'|
Features.ChecksumFiles='True'|Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseFipsCompliantChecksums='False'|
ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|FeatureCommand.Command='unknown'|
ConfigCommand.Command='unknown'|PinCommand.Command='unknown'|
Hello @dmitrijs-rjazanovs - we need to see full output log please (minus any sensitive data). It will help us see what is running and what the script looks like so we can provide support.
@ferventcoder Hi Rob. Updated output log. It is all i can get. Thanks.
Okay, the problem appears to be that there are some files inside the package that have a path much longer than the .NET framework (and by extension Chocolatey) can deal with. So we'll need to find a way around that.
Slightly OT- I did notice this issue for install:
PackageParameters='/Environment:Cleanup /InstallRoot:D:\Solution"'| Note the extra double quote here.
choco install -y Company.Web.SitefinityCMS -source C:\Nuget -force -pre -params "/Environment:Cleanup /InstallRoot:D:\Solution\"
Should be passed as:
choco install -y Company.Web.SitefinityCMS -source C:\Nuget -force -pre -params "'/Environment:Cleanup /InstallRoot:D:\Solution\'" - see https://chocolatey.org/docs/commands-reference#how-to-pass-options-switches (quote values)
This is fixed for 0.10.1
Leaving this here for people to find:
Chocolatey NuGet.Core first unzips the package to a temp folder as follows:
C:Usersxxxxx.xxxxxxxAppDataLocalTemp2chocolateyNuGetScratch49722c8a-b74e-4980-a050-39817cee99655vptb40r.ne1 .....your package path here...
That is a 120 path characters that you can't use in side the package.
Path lengths in the package are limited to 140 unless you change the cacheLocation like so
"choco config set cachelocation c:temp"
for example.
This has been closed and labelled as fixed. However I still get errors with applications with paths longer than 260 characters.
@nmulvihill Chocolatey supports longer paths, but that doesn't mean that Windows or other things do. If you have a log, can you show the relevant parts of the error message (along with other messages surrounding it)? There may be an issue where it sees an error, but handles it without issue by flipping over to long paths.
Chocolatey v0.10.7
Installing the following packages:
bmc
By installing you accept licenses for the packages.
Progress: Downloading bmc 9.0... 100%
bmc not installed. An error occurred during installation:
The specified path, file name, or both are too long. The fully qualified file n
ame must be less than 260 characters, and the directory name must be less than 2
48 characters.
bmc package files install completed. Performing other installation steps.
The install of bmc was NOT successful.
bmc not installed. An error occurred during installation:
The specified path, file name, or both are too long. The fully qualified file n
ame must be less than 260 characters, and the directory name must be less than 2
48 characters.
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:ProgramDatachocolateylogschocolatey.log).
Failures
@nmulvihill That is likely in the NuGet.Core codebase. We'll need to get in there and fix it to support this as well. Would it be too much trouble to have you open a new issue with that log?
Not at all!
Here is the issue: https://github.com/chocolatey/choco/issues/1361
I was curious where this stands because we are internally about to get into a situation where this might matter. We have some custom packages with grotesque filenames to contain very specific information about the nature of the files inside. The current sample of filenames won't currently exceed 260 characters, but the combination of the filename with their path probably would.
Most helpful comment
Leaving this here for people to find:
ChocolateyNuGet.Core first unzips the package to a temp folder as follows:C:Usersxxxxx.xxxxxxxAppDataLocalTemp2chocolateyNuGetScratch49722c8a-b74e-4980-a050-39817cee99655vptb40r.ne1 .....your package path here...
That is a 120 path characters that you can't use in side the package.
Path lengths in the package are limited to 140 unless you change the cacheLocation like so
"choco config set cachelocation c:temp"
for example.