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

chocolatey\chocolatey\chocolatey\.... temp download paths #241

Open
flcdrg opened this Issue Mar 28, 2017 · 42 comments

Comments

Projects
None yet
@flcdrg
Copy link
Contributor

flcdrg commented Mar 28, 2017

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

This comment has been minimized.

Copy link
Contributor Author

flcdrg commented Mar 28, 2017

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

@gep13

This comment has been minimized.

Copy link
Member

gep13 commented Mar 28, 2017

You can never have to much chocolatey!

Ok, I will leave now...

😄

@mwrock

This comment has been minimized.

Copy link
Member

mwrock commented Mar 28, 2017

I have submitted chocolatey/choco#1211 to fix this issue.

@mwrock

This comment has been minimized.

Copy link
Member

mwrock commented Mar 30, 2017

Just released this fix on 2.9.5

@mwrock mwrock closed this Mar 30, 2017

@flcdrg

This comment has been minimized.

Copy link
Contributor Author

flcdrg commented Apr 3, 2017

Still seeing this in 2.9.5 :-(

@flcdrg

This comment has been minimized.

Copy link
Contributor Author

flcdrg commented Apr 3, 2017

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

@flcdrg

This comment has been minimized.

Copy link
Contributor Author

flcdrg commented Apr 3, 2017

@mwrock

This comment has been minimized.

Copy link
Member

mwrock commented Apr 3, 2017

see chocolatey/choco#1232. I tested this build against boxstarter and the nested directories appear to be gone.

@mwrock mwrock reopened this Apr 3, 2017

@mwrock

This comment has been minimized.

Copy link
Member

mwrock commented Apr 3, 2017

Reopening this until the above is released

@KZeronimo

This comment has been minimized.

Copy link

KZeronimo commented Apr 3, 2017

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

You can never have to much chocolatey!

@mwrock

This comment has been minimized.

Copy link
Member

mwrock commented Apr 3, 2017

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

@batzen

This comment has been minimized.

Copy link

batzen commented Apr 27, 2017

chocolatey/choco#1233 is the correct PR, just for reference.

@flcdrg

This comment has been minimized.

Copy link
Contributor Author

flcdrg commented Jun 20, 2017

Confirmed that this is now resolved

@flcdrg flcdrg closed this Jun 20, 2017

@amaau

This comment has been minimized.

Copy link

amaau commented Jul 27, 2017

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

@mwrock

This comment has been minimized.

Copy link
Member

mwrock commented Jul 27, 2017

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

@mwrock mwrock reopened this Jul 27, 2017

@amaau

This comment has been minimized.

Copy link

amaau commented Jul 27, 2017

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

@mwrock

This comment has been minimized.

Copy link
Member

mwrock commented Jul 27, 2017

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

@mwrock

This comment has been minimized.

Copy link
Member

mwrock commented Jul 27, 2017

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.

@amaau

This comment has been minimized.

Copy link

amaau commented Jul 27, 2017

right, sorry, i did refer to the bootstrapper

@ferventcoder

This comment has been minimized.

Copy link
Member

ferventcoder commented Jul 27, 2017

I thought I had seen this as well - should have linked the two. chocolatey/choco#1233 (comment)

@ericrlarson

This comment has been minimized.

Copy link

ericrlarson commented Sep 20, 2017

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. :(

@Sebbl22

This comment has been minimized.

Copy link

Sebbl22 commented Oct 3, 2017

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

@ericrlarson

This comment has been minimized.

Copy link

ericrlarson commented Oct 4, 2017

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

@kirannhegde

This comment has been minimized.

Copy link

kirannhegde commented Oct 6, 2017

@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?

@mwrock

This comment has been minimized.

Copy link
Member

mwrock commented Oct 9, 2017

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

@kirannhegde

This comment has been minimized.

Copy link

kirannhegde commented Oct 10, 2017

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

@Sebbl22

This comment has been minimized.

Copy link

Sebbl22 commented Oct 12, 2017

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

@flcdrg

This comment has been minimized.

Copy link
Contributor Author

flcdrg commented Jul 14, 2018

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

This comment has been minimized.

Copy link
Contributor Author

flcdrg commented Jul 14, 2018

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

@Oxymoron290

This comment has been minimized.

Copy link

Oxymoron290 commented Oct 14, 2018

im stuck, help

@pauby

This comment has been minimized.

Copy link
Member

pauby commented Oct 14, 2018

@Oxymoron290 What are you stuck with?

@Oxymoron290

This comment has been minimized.

Copy link

Oxymoron290 commented Oct 14, 2018

This problem with infinite chocolatey folders in cache. I've tried adding --cacheLocation "$env:userprofile\AppData\Local\ChocoCache" at the end of all cinst statements and the problem persists
image

@pauby

This comment has been minimized.

Copy link
Member

pauby commented Oct 14, 2018

@Oxymoron290 What happens when you use c:\temp as the --cacheLocation? What is the value of $env:userprofile and what is your cinst line?

@Oxymoron290

This comment has been minimized.

Copy link

Oxymoron290 commented Oct 14, 2018

image

@Oxymoron290

This comment has been minimized.

Copy link

Oxymoron290 commented Oct 14, 2018

So it appears using c:\temp will work for now. Let me try updating my powershell scripts for boxstarter

@Oxymoron290

This comment has been minimized.

Copy link

Oxymoron290 commented Oct 14, 2018

Yes, it is working now.

neilkidd added a commit to neilkidd/windows-dev-box-setup-scripts that referenced this issue Oct 28, 2018

@ctmcisco

This comment has been minimized.

Copy link

ctmcisco commented Jan 16, 2019

thing only began to happen when I repaved my machine using Boxstarter. Is this a boxstarter issue as I don't seem to have this issue when running Chocolatey only?

@flcdrg

This comment has been minimized.

Copy link
Contributor Author

flcdrg commented Jan 16, 2019

It was a bug in Chocolatey that has been fixed, but for unrelated reasons Boxstarter hasn't been able to upgrade to that newer version of Chocolatey yet.

@ctmcisco

This comment has been minimized.

Copy link

ctmcisco commented Jan 16, 2019

I see, so best thing to do is either run with the work around for now as suggested by @neilkidd or only use Chocolatey?

@flcdrg

This comment has been minimized.

Copy link
Contributor Author

flcdrg commented Jan 16, 2019

Yes. (Credit to @kirannhegde)..

It only becomes a problem if you exceed a certain number of packages. Some of my Boxstarter scripts get by without it, but the longer ones require the workaround for now.

https://gist.github.com/flcdrg/87802af4c92527eb8a30

@ctmcisco

This comment has been minimized.

Copy link

ctmcisco commented Jan 16, 2019

great catch @kirannhegde !

The below is what I am doing for now and every time I this the fails are happen randomly between packages. So I think adding the Temp cache to all is the safest bet.

I like your cleaner look of dropping the cache location in a variable.

Thanks. Now I have to clean up the script a bit. Arg I should have checked in before trying to trouble on my own. Lost some time.

Thanks again!

choco upgrade --cacheLocation="$ChocoCachePath" googlechrome -dy
choco upgrade --cacheLocation="$ChocoCachePath" firefox -dy
choco upgrade --cacheLocation="$ChocoCachePath" skype -dy
choco upgrade --cacheLocation="$ChocoCachePath" ditto -dy
choco upgrade --cacheLocation="$ChocoCachePath" keepass.install -dy
choco upgrade --cacheLocation="$ChocoCachePath" flashplayerplugin -dy
choco upgrade --cacheLocation="$ChocoCachePath" sysinternals -dy
choco upgrade --cacheLocation="$ChocoCachePath" winrar -dy
choco upgrade --cacheLocation="$ChocoCachePath" teamviewer -dy
choco upgrade --cacheLocation="$ChocoCachePath" notepadplusplus -dy
choco upgrade --cacheLocation="$ChocoCachePath" filezilla -dy
choco upgrade --cacheLocation="$ChocoCachePath" angryip -dy
choco upgrade --cacheLocation="$ChocoCachePath" putty -dy
choco upgrade --cacheLocation="$ChocoCachePath" winscp -dy
choco upgrade --cacheLocation="$ChocoCachePath" nmap -dy
choco upgrade --cacheLocation="$ChocoCachePath" mRemoteNG -dy
choco upgrade --cacheLocation="$ChocoCachePath" openssh -dy
choco upgrade --cacheLocation="$ChocoCachePath" vnc-viewer-plus -dy
choco upgrade --cacheLocation="$ChocoCachePath" powershell-core -dy
choco upgrade --cacheLocation="$ChocoCachePath" markdownmonster -dy
choco upgrade --cacheLocation="$ChocoCachePath" git -dy
choco upgrade --cacheLocation="$ChocoCachePath" vscode -dy
@pauby

This comment has been minimized.

Copy link
Member

pauby commented Mar 18, 2019

Need to upgrade chocolatey lib to a later version - need to determine which one. This comment suggests it's fixed in 0.10.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.