boxstarter icon indicating copy to clipboard operation
boxstarter copied to clipboard

chocolatey\chocolatey\chocolatey\.... temp download paths

Open flcdrg opened this issue 7 years ago • 49 comments

2.9.2 - seeing packages getting downloaded into weird folders (and then failing).

C:\Users\dgardiner\AppData\Local\Temp\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey\chocolatey.squirrel-lock-0205C670A9D776F56D17A8FB985A520ADEE61F89: System.IO.PathTooLongException: 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.

flcdrg avatar Mar 28 '17 01:03 flcdrg

Seems like each package is going one level deeper :-)

flcdrg avatar Mar 28 '17 01:03 flcdrg

You can never have to much chocolatey!

Ok, I will leave now...

😄

gep13 avatar Mar 28 '17 09:03 gep13

I have submitted https://github.com/chocolatey/choco/pull/1211 to fix this issue.

mwrock avatar Mar 28 '17 14:03 mwrock

Just released this fix on 2.9.5

mwrock avatar Mar 30 '17 15:03 mwrock

Still seeing this in 2.9.5 :-(

flcdrg avatar Apr 03 '17 03:04 flcdrg

Just guessing, but could it be that config.CacheLocation.EndsWith("chocolatey") would be false if CacheLocation had a trailing slash/backslash?

flcdrg avatar Apr 03 '17 04:04 flcdrg

Raised https://github.com/chocolatey/choco/issues/1231

flcdrg avatar Apr 03 '17 04:04 flcdrg

see https://github.com/chocolatey/choco/pull/1232. I tested this build against boxstarter and the nested directories appear to be gone.

mwrock avatar Apr 03 '17 07:04 mwrock

Reopening this until the above is released

mwrock avatar Apr 03 '17 19:04 mwrock

Ugg - sorry I missed this - and I looked at this one the other day and chuckled about

You can never have to much chocolatey!

KZeronimo avatar Apr 03 '17 21:04 KZeronimo

no worries. this issue was closed which is probably why you missed it :)

mwrock avatar Apr 03 '17 21:04 mwrock

https://github.com/chocolatey/choco/pull/1233 is the correct PR, just for reference.

batzen avatar Apr 27 '17 15:04 batzen

Confirmed that this is now resolved

flcdrg avatar Jun 20 '17 11:06 flcdrg

nope not resolved yet, boxstarter 2.10.3 + choco 0.10.7 still have this problem

amaau avatar Jul 27 '17 19:07 amaau

yes we had to revert to choco 0.10.5 which "rebroke" this but fixed larger problems.

mwrock avatar Jul 27 '17 20:07 mwrock

but current (2.10.3) boxstarter installs choco 0.10.7, at least that's what the log says

amaau avatar Jul 27 '17 20:07 amaau

boxstarter doesn't install chocolatey unless your script installs it. It just calls into a chocolatey dll.

mwrock avatar Jul 27 '17 20:07 mwrock

oh maybe you are referring to the bootstrapper which does install the latest choco if it is not installed in order to install boxstarter. That would install 0.10.7 but it does not use it in boxstarter runs.

mwrock avatar Jul 27 '17 20:07 mwrock

right, sorry, i did refer to the bootstrapper

amaau avatar Jul 27 '17 20:07 amaau

I thought I had seen this as well - should have linked the two. https://github.com/chocolatey/choco/pull/1233#issuecomment-318479205

ferventcoder avatar Jul 27 '17 20:07 ferventcoder

Matt, any idea when a new version of Boxstarter will be released that will have a version of Chocolatey which addresses this issue? We are unable to use boxstarter with this issue in it. :(

ghost avatar Sep 20 '17 19:09 ghost

Are there any known workarounds? Can i reset the cache path after each package install?

Sebbl22 avatar Oct 03 '17 11:10 Sebbl22

That did not work for me. If you try and it works let me know!

ghost avatar Oct 04 '17 20:10 ghost

@mwrock Hello Matt, I am using the latest version of Boxstarter bootstrapper, that installs the latest version of Chocolatey. I am seeing this issue as well when i try to install a series of packages using the text file on Git gist. Is there an easy way to workaround this issue?

kirannhegde avatar Oct 06 '17 10:10 kirannhegde

not that I am aware of @kirannhegde but have not had time to investigate

mwrock avatar Oct 09 '17 16:10 mwrock

I worked around this issue by using an alternative cache location, instead of the user temp directory. Basically , for each choco install, i explicitly use an alternative cache location as follows: cinst 7zip --version 9.22 --source https://abc.com/ --cacheLocation "$env:SystemDrive\TCAgentSetupCache"

Hope this helps.

@Sebbl22 @ericrlarson

kirannhegde avatar Oct 10 '17 05:10 kirannhegde

Thanks @kirannhegde. Your solution worked for me.

It seems, that the $env:temp Variable gets overwritten for the current PowerShell session, because I first tried cinst 7zip --cacheLocation "$env:temp\ChocoCache", wich also resulted in C:\Users\abc\AppData\Local\Temp\chocolatey\chocolatey\chocolatey\chocolatey after several installs.

cinst 7zip --cacheLocation "$env:userprofile\AppData\Local\ChocoCache" however worked just fine. Hint: The cache location must exist. I use the follwing command in my Boxstarter script: New-Item -Path "$env:userprofile\AppData\Local\ChocoCache" -ItemType directory -Force

Sebbl22 avatar Oct 12 '17 05:10 Sebbl22

This is still causing problems, and the workaround isn't working for me with the latest BoxStarter. Even though cacheLocation is being passed in, Chocolatey is still using %TEMP% which has the chocolatey\chocolatey\chocolatey problem :-(

flcdrg avatar Jul 14 '18 08:07 flcdrg

Looks like if you apply --cache-location to every choco call in your BoxStarter script, you might be ok. That includes choco pin, and windows features

flcdrg avatar Jul 14 '18 10:07 flcdrg

im stuck, help

Oxymoron290 avatar Oct 14 '18 17:10 Oxymoron290