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

Updated file in winrepo isn't refreshed on minion #10597

Closed
eliasp opened this issue Feb 19, 2014 · 5 comments · Fixed by #11697
Closed

Updated file in winrepo isn't refreshed on minion #10597

eliasp opened this issue Feb 19, 2014 · 5 comments · Fixed by #11697
Labels
Bug broken, incorrect, or confusing behavior Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-low 4th level, cosemtic problems, work around exists Windows

Comments

@eliasp
Copy link
Contributor

eliasp commented Feb 19, 2014

Master: 0.17.4
Minion: 0.17.5-2 amd64

When updating a file in the winrepo, it isn't refreshed on the minion.

How to reproduce:

  1. In win/repo/mozilla/thunderbird/init.sls:
mozilla.thunderbird:
    24.3.0:
        installer: salt://win/repo/mozilla/thunderbird/Thunderbird Setup 24.3.0.exe
        full_name: Mozilla Thunderbird 24.3.0 (x86 en-US)
        reboot: False
        install_flags: ' -ms'
        msiexec: False
        uninstaller: '%PROGRAMFILES(x86)%\Mozilla Thunderbird\uninstall\helper.exe'
        uninstall_flags: ' -ms'
  1. Accidentally download wrong installer language (sq instead of en-US):

    wget 'https://download.mozilla.org/?product=thunderbird-24.3.0&os=win&lang=sq' -O 'win/repo/mozilla/thunderbird/Thunderbird Setup 24.3.0.exe'
    
  2. Regenerate Win-Repo:

    salt-run winrepo.genrepo
    
  3. Install package mozilla.thunderbird on minion:

    salt minion-001 pkg.install mozilla.thunderbird
    
  4. Launch Mozilla Thunderbird on the minion and notice the wrong version has been installed

  5. Uninstall the wrong version from the affected minion:

    salt minion-001 pkg.remove mozilla.thunderbird
    
  6. Download the correct version:

    wget 'https://download.mozilla.org/?product=thunderbird-24.3.0&os=win&lang=en-US' -O 'win/repo/mozilla/thunderbird/Thunderbird Setup 24.3.0.exe'
    
  7. Regenerate Win-Repo:

    salt-run winrepo.genrepo
    
  8. Install the correct version:

    salt minion-001 pkg.install mozilla.thunderbird
    
  9. Realise it is still the sq version because the file in C:\şalt\var\cache.... wasn't updated after it changed on the master.

@basepi basepi added this to the Outstanding Bugs milestone Feb 19, 2014
@UtahDave
Copy link
Contributor

@eliasp after executing the "genrepo" can you try executing

salt minion-001 pkg.refresh_db

That should cause the minion to updated its local copy of the package database.

http://docs.saltstack.com/ref/modules/all/salt.modules.win_pkg.html#salt.modules.win_pkg.refresh_db

@UtahDave
Copy link
Contributor

@eliasp Did pkg.refresh_db fix this issue?

@eliasp
Copy link
Contributor Author

eliasp commented Apr 1, 2014

@UtahDave No, pkg.refresh_db doesn't help to fix this :(

@UtahDave
Copy link
Contributor

UtahDave commented Apr 1, 2014

OK, I'm guessing we're not checking the file hash. I'll dive into this today.

@UtahDave
Copy link
Contributor

UtahDave commented Apr 1, 2014

@eliasp Hey, could you drop this file: https://raw.githubusercontent.com/UtahDave/salt/develop/salt/modules/win_pkg.py

into your modules directory in your windows salt-minion install. Delete the win_pkg.pyc that's already there and then see if it will update your installer?

I think this hash check was what was missing.

@jfindlay jfindlay added the Platform Relates to OS, containers, platform-based utilities like FS, system based apps label May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-low 4th level, cosemtic problems, work around exists Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants