Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

[BUG] Chocolatey install command (not update command) uses an older cached installer even when upgrading #522

Closed
AnthonyMastrean opened this issue Jul 14, 2014 · 19 comments

Comments

@AnthonyMastrean
Copy link
Contributor

I have pandoc 1.11 installed and I'm developing/testing an update to 1.12. But you can see that it's not downloading the new installer at all (related to #428).

PS> choco install pandoc -source $pwd -force
Chocolatey (v0.9.8.27) is installing 'pandoc' and dependencies. By installing you accept the license for 'pandoc' and each dependency you are installing.

pandoc v1.12
Installing Pandoc...
Pandoc has been installed.
Pandoc has finished successfully! The chocolatey gods have answered your request!
Finished installing 'pandoc' and dependencies - if errors not shown in console, none detected. Check log for errors if unsure.

The only installer in %TEMP% is the old 1.11. The installed version reported in Control Panel is still 1.11. But, Chocolatey thinks 1.12 is installed.

PS> choco version pandoc

found         : 1.12
name          : pandoc
latest        : 1.11.1

I'm definitely using the latest, local package. The contents of the install scripts are

$id = "pandoc"
$url = "https://github.com/jgm/pandoc/releases/download/1.12.4.2/pandoc-1.12.4.2-1-windows.msi"
$kind = "MSI"
$silent = "/Q"

Install-ChocolateyPackage $id $kind $silent $url

So, install is using the old package's cached installer even though it finds a newer package. That's bad, right? A fix might start by including the version in the %TEMP% directory's name.


FYI, I cleaned up all my 1.12 files/state, got back to just 1.11, and tried update and it did work:

PS> choco update pandoc -source $pwd
Updating pandoc from 1.11.1 to 1.12
Chocolatey (v0.9.8.27) is installing 'pandoc' and dependencies. By installing you accept the license for 'pandoc' and each dependency you are installing.

pandoc v1.12
Downloading pandoc 32 bit
  from 'https://github.com/jgm/pandoc/releases/download/1.12.4.2/pandoc-1.12.4.2-1-windows.msi'
Installing pandoc...
pandoc has been installed.
pandoc has finished successfully! The chocolatey gods have answered your request!
Finished installing 'pandoc' and dependencies - if errors not shown in console, none detected. Check log for errors if unsure.
@ferventcoder
Copy link
Contributor

Perhaps. This should only leave the installer alone if it finds the checksum to be the same, but it could be I introduced something else into the mix fixing what was thought to be an issue.

@ferventcoder
Copy link
Contributor

Adding checksums to your package would also be helpful.

@ferventcoder
Copy link
Contributor

When you say you cleaned up all the files, do you mean you deleted the %TEMP% files?

@AnthonyMastrean
Copy link
Contributor Author

It's not my package yet, but I'm looking to take it over, which is why I am testing :)

I updated the "cleaned up" statement in the description above. I'm trying to say that I was being thorough. I reverted to a 1.11-only state: Chocolatey lib, Control Panel, %TEMP%... all 1.11. No trace of 1.12.

@ferventcoder
Copy link
Contributor

What is wonky then?

@AnthonyMastrean
Copy link
Contributor Author

The choco install command for a newer package is using the cached installer for the old package. Sorry, was that not clear?


I could test the same scenario with specific older versions of an existing, public package to remove any local source variability (though, I don't suspect that's part of the problem).

@AnthonyMastrean AnthonyMastrean changed the title The download file cache feature does not work on install, only update Chocolatey install uses an older cached installer when it shouldn't Jul 14, 2014
@ferventcoder
Copy link
Contributor

Definitely not clear as you said it worked in the end with a file in the temp folder (as I was attempting to clear that up).

So did it work in the end or did it fail?

@AnthonyMastrean
Copy link
Contributor Author

Chocolatey install is using the older package's cached installer even though Chocolatey finds a newer package (in this case, in my local -source). That's a bug. FYI, update works in this scenario and skips the installer cache.

What's the intended behavior of install when you already have an older version of the package installed? I don't think it's reasonable to expect the user to list installed packages before choosing between install or update. It's not correct either way to use the old installer and then say the new version is successfully installed.

@ferventcoder
Copy link
Contributor

Now I understand. Yes, big bug.

@ferventcoder ferventcoder changed the title Chocolatey install uses an older cached installer when it shouldn't [BUG] Chocolatey install command (not update command) uses an older cached installer even when upgrading Jul 15, 2014
@ferventcoder
Copy link
Contributor

I think I understand what might be causing this - are pandoc 1.11 and 1.12 installer files the exact same size (get-contentlength)?

@AnthonyMastrean
Copy link
Contributor Author

Not even close, 1.11 is about 5,664 KB and 1.12 is about 11,644 KB.

@ferventcoder
Copy link
Contributor

super big bug then :(

@ferventcoder
Copy link
Contributor

Help me out here - I'm trying to reproduce - https://gist.github.com/ferventcoder/d928b61f69d65ac7bd4e

@ferventcoder
Copy link
Contributor

Going to have to close this as not reproducible unless we get to the bottom of this. I'll need full debug output to understand what is wrong.

@AnthonyMastrean
Copy link
Contributor Author

I'll try to repro it with a published package. But, you should still try it with a local package... I can send you my local pandoc 1.12 package for exact repro.

@ferventcoder
Copy link
Contributor

That would be super helpful.

@ferventcoder
Copy link
Contributor

I tried this with a local package and it appears to work just fine.

C:\> choco install pandoc
Chocolatey (v0.9.8.28-alpha2) is installing 'pandoc' and dependencies. By installing you accept the license for 'pandoc' and each dependency you are installing.

pandoc v1.11.1
Downloading Pandoc 32 bit
  from 'https://pandoc.googlecode.com/files/pandoc-1.11.1.msi'
Installing Pandoc...
Pandoc has been installed.
Pandoc has finished successfully! The chocolatey gods have answered your request!
Finished installing 'pandoc' and dependencies - if errors not shown in console, none detected. Check log for errors if unsure. 

C:\> choco install pandoc -source c:\temp
Chocolatey (v0.9.8.28-alpha2) is installing 'pandoc' and dependencies. By installing you accept the license for 'pandoc' and each dependency you are installing.

pandoc v1.12
Downloading pandoc 32 bit
  from 'https://github.com/jgm/pandoc/releases/download/1.12.4.2/pandoc-1.12.4.2-1-windows.msi'
Installing pandoc...
pandoc has been installed.
pandoc has finished successfully! The chocolatey gods have answered your request!
Finished installing 'pandoc' and dependencies - if errors not shown in console, none detected. Check log for errors if unsure. 

Interestingly enough, this is weird:
image

@ferventcoder
Copy link
Contributor

Could this just be a misunderstanding of -force? If you have a package in chocolateyinstall + lib, force doesn't remove what is already there (yet).

@ferventcoder
Copy link
Contributor

Closing as non-repro

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

No branches or pull requests

2 participants