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

AutoUninstaller runs every time in 0.9.9.x #134

Closed
marcinbojko opened this issue Jun 24, 2016 · 13 comments
Closed

AutoUninstaller runs every time in 0.9.9.x #134

marcinbojko opened this issue Jun 24, 2016 · 13 comments
Milestone

Comments

@marcinbojko
Copy link

marcinbojko commented Jun 24, 2016

Related to #133

Tested with choco 0.9.10.1/0.9.10.2/0.9.10.3
Despite choco_version being updated to the latest, versioncmp from config.pp returns values other than 0.
Next 'exec' with 'unless' is running on every puppet agent cycle because of wrong separator.

Debug: Executing 'cmd.exe /c C:\ProgramData\chocolatey\bin\choco.exe feature list -r | findstr /B /I /C:"autoUninstaller - [enabled]"'

@derek-robinson
Copy link

With Chocolatey v0.9.9.11 it also runs the incorrect exec, but it looks like it's trying to find use the findstr for the 0.9.10.x versions.

Debug: Exec[chocolatey_autouninstaller_enable](provider=windows): Executing check 'cmd.exe /c C:\ProgramData\chocolatey\bin\choco.exe feature list -r | findstr /B /I /C:"autoUninstaller|enabled|"'

Debug: Executing 'cmd.exe /c C:\ProgramData\chocolatey\bin\choco.exe feature list -r | findstr /B /I /C:"autoUninstaller|enabled|"'

Debug: Exec[chocolatey_autouninstaller_enable](provider=windows): Executing 'C:\ProgramData\chocolatey\bin\choco.exe feature -r enable -n autoUninstaller'

Debug: Executing 'C:\ProgramData\chocolatey\bin\choco.exe feature -r enable -n autoUninstaller'
Notice: /Stage[main]/Chocolatey::Config/Exec[chocolatey_autouninstaller_enable]/returns: executed successfully

@ferventcoder
Copy link
Contributor

Hmm, perhaps the logic is flipped?

@marcinbojko
Copy link
Author

I think not. I have almost 50 machines. Most of them are working fine, but few of them are stubborn.
Tested with notify, looks like server machines have this problem more often than others.

@ferventcoder
Copy link
Contributor

No, the logic is wrong. I just looked closer. The version comes from a fact. If the version is 0, we should do nothing. Only do the secondary check when there is a 0.9.9.x version.

@ferventcoder
Copy link
Contributor

Remember that facts go up to the server and come back down. Guess what that fact evaluates to on first install? 0, because it has just been provided up to the master for compilation before there is even a Chocolatey version.

If you are still seeing this after a few runs, I think there is another issue at play, possibly in how it gathers the version. This has been fixed over in puppetlabs-chocolatey, but puppetlabs-chocolatey doesn't yet contain these fixes.

@marcinbojko
Copy link
Author

Sorry Rob, I don't know much about puppet language. Just confirmed that all new host added today, with symptoms like in a subject are WIndows Server 2012 R2 hosts.

facter -p shows:

$ facter -p
architecture => x64
choco_install_path => C:\ProgramData\chocolatey
chocolateyversion => 0.9.10.3�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

@marcinbojko
Copy link
Author

There is no change after first 200 runs ;)

@ferventcoder
Copy link
Contributor

Okay. So definitely a continued bug then. :/

@marcinbojko
Copy link
Author

Rob, I feel stupid :(
After upgrading chocolatey module to 1.2.5, according to logic in config.pp - everything works as expected. I am terribly sorry for overlooking such important step in debugging.

@ferventcoder
Copy link
Contributor

@Koshersalt are you still seeing this with 1.2.5?

@ferventcoder ferventcoder reopened this Jul 5, 2016
@ferventcoder
Copy link
Contributor

Going to leave this open as it could still be an issue.

@derek-robinson
Copy link

Yes, I'm still seeing this with 1.2.5 and chocolatey version 0.9.9.11.
I don't see the issue on servers with 0.9.10.2 though.

ferventcoder added a commit to ferventcoder/puppet-chocolatey that referenced this issue Jul 8, 2016
In 0.9.10, auto uninstaller should be enabled by default, so there is
no need to run to enable it.
ferventcoder added a commit to ferventcoder/puppet-chocolatey that referenced this issue Jul 10, 2016
In 0.9.10, auto uninstaller should be enabled by default, so there is
no need to run to enable it.
ferventcoder added a commit to ferventcoder/puppet-chocolatey that referenced this issue Jul 10, 2016
In 0.9.10, auto uninstaller should be enabled by default, so there is
no need to run to enable it.
ferventcoder added a commit that referenced this issue Jul 10, 2016
…installer

(GH-134) Only Enable AutoUninstaller in 0.9.9.x
@ferventcoder ferventcoder changed the title Versioncmp from config.pp works erratic AutoUninstaller runs every time Jul 11, 2016
@ferventcoder ferventcoder changed the title AutoUninstaller runs every time AutoUninstaller runs every time in 0.9.9.x Jul 11, 2016
@ferventcoder
Copy link
Contributor

@Koshersalt I just released 1.2.6 that should handle this.

ferventcoder added a commit to ferventcoder/puppet-chocolatey that referenced this issue Jul 11, 2016
* master:
  (version) 1.2.6
  (MODULES-3536) modsync update
  (maint) Remove travis and metadata-json-lint gems
  (chocolatey-archiveGH-134) Only Enable AutoUninstaller in 0.9.9.x
  (version) 1.2.5
  (maint) prep for release of 1.2.5
  (chocolatey-archiveGH-128) PowerShell 1.x provider fixes for "else"
  (chocolatey-archiveGH-133) Feature list update for  0.9.10
  (version) 1.2.4
  (chocolatey-archiveGH-125) Compatible Up to PowerShell Provider 3.x
  (chocolatey-archiveGH-125) Wrap PowerShell Redirect in Try/Catch
  (chocolatey-archiveGH-69) Fix - default provider example
  (doc) make that text a bit more prominent
  (version) 1.2.3 for real
  (version) 1.2.3
  (doc) add editions of Chocolatey
  (chocolatey-archiveGH-100) Do not call choco with --debug --verbose
  (version) 1.2.2
  Sign the installer script template
  (chocolatey-archiveGH-119) Implement PowerShell Redirection Fix
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

3 participants