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

Salt is reporting as failed to install package even if the package is installed #59992

Open
subrata-1984 opened this issue Apr 8, 2021 · 9 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior info-needed waiting for more info severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Windows
Milestone

Comments

@subrata-1984
Copy link

subrata-1984 commented Apr 8, 2021

Hello,

I have a setup of one Salt master (Linux) and one Salt minion (Windows). In the Salt master I have created /srv/salt/chrome/init.sls file (Screenshot 1). I have also configured package repo for Windows under /srv/salt/win/repo-ng/salt-repo-ng/chrome.sls. (Screenshot 2) When I did pkg.refresh_db the repos gets updated inside the Cache directory of Minion.

Now when I am running salt "minion" state.apply chrome it is actually installing the package but returning as Failed to install package.( Screenshot 3). When I am running pkg.remove it is saying the package is not installed.

So I guess some how Salt is not able to detect the package though I have verified the registry keys as well and everything looks normal.

Screenshot 1:
image

Screenshot 2:
image

Screenshot 3:
image

Screenshot of Salt master version report:
image

Screenshot of Salt minion version report:
image

Pillar information:
image

Also attached the minion log file in Debug mode.
salt_minion.log

@subrata-1984 subrata-1984 added Bug broken, incorrect, or confusing behavior needs-triage labels Apr 8, 2021
@welcome
Copy link

welcome bot commented Apr 8, 2021

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@xeacott xeacott added severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around and removed needs-triage labels Apr 16, 2021
@twangboy
Copy link
Contributor

The Chrome installer is unique in that the version reported by Salt immediately after the installer completes is not the same as the actual version installed. There must be some processes still completing that eventually set the correct version in the registry.

Additionally, you're also never sure exactly which version of Chrome you're going to get as they don't make older versions available. The same url always points you to the latest release. That is why in the public winrepo we use latest as the version.

It looks like you're trying to pin Chrome to a specific version. This may cause problems if the minions have access to the internet and chrome is allowed to update itself.

The reason I think this is failing for you is that the version is not matching exactly. Salt does a pkg.list_pkgs at the end of the installation and checks that the version is present. If it is not, is says it failed. I would be interested to see the output of pkg.list_pkgs after a failed pkg.installed to see what version is being reported.

@twangboy twangboy added this to the Blocked milestone Apr 16, 2021
@twangboy twangboy added info-needed waiting for more info needs-triage labels Apr 16, 2021
@subrata-1984
Copy link
Author

Hi, I have executed the chrome installation with version latest. But same issue persists. Applied a retry logic as well with pkg.install thinking if the installation takes some time to update the registry keys and salt is reading the keys before that and throwing the message as failed to install. But same error...

Below is the list_pkgs after chrome is installed.

image

Attached is the chrome installation log by pkg.installed.

chrome.log

@twangboy
Copy link
Contributor

twangboy commented Apr 22, 2021

It doesn't look like chrome was installed. It's not showing up in pkg.list_pkgs. Can you make sure it actually installed? Maybe even install it manually and then do a pkg.list_pkgs to see what version is being reported.

@twangboy
Copy link
Contributor

So, the problem you're trying to solve then is installing chrome from an installer hosted on S3? If I'm reading the salt code correctly, s3 should be a supported file protocol for the winrepo installer. So, you should be able to specify the s3 url in the installer property.

chrome:
  latest:
    full_name: 'Google Chrome'
    installer: 's3:https://rec-sssalt-test/win_packages/GoogleChromeStandaloneEnterprise64.msi'
    uninstaller: 's3:https://rec-sssalt-test/win_packages/GoogleChromeStandaloneEnterprise64.msi'
    install_flags: '/qn /norestart'
    uninstall_flags: '/qn /norestart'
    msiexec: True
    locale: en_US
    reboot: False

Then you shouldn't need the file.managed part of the state.

@subrata-1984
Copy link
Author

subrata-1984 commented Apr 23, 2021

Google Chrome package is getting installed through Salt, as you can see on top I have pasted a screenshot saying installation is success. I see it in the minion's add/remove program as well. Also in the salt-minion.log attached above you can see logs with installation success but printed with level Error ( This is a point to be noted ).

image

Even though package is installed successfully the minion is returning the installation as False and I have checked the same with minion version 3002 and 3003 both.

The list_pkgs is not detecting the package installed by Salt master and if I run pkg.remove chrome it will will say the package is not installed (Another point to be noted). But list_available will say that the package is available with version details.

Another point to be noted is that the same issue ( Though package is getting installed actually, salt is reporting that it is not installed based on the minion return as False) is happening for all other software like DotNet, TreeSize, 7Zip, VeraCrypt etc. I just gave example of Google Chrome here.

We can use the S3 URL directly also, I have checked initially with that but same issue was reported. Once the actual issue is resolved we will fine tune this thing.

@subrata-1984
Copy link
Author

If possible, can you replicate the state files, pillar info and win repo packages mentioned above in your local system with Salt version 3002 or above and try to reproduce the issue. I am not actually a Windows guy so not sure if I am missing anything in the whole process.

@subrata-1984
Copy link
Author

subrata-1984 commented Apr 26, 2021

Also I enabled Trace log today and I found two suspicious information which might have some relation to this whole issue. Though the installation is successful as I said previously I see the return code from the minion after installation is 2 which is False ('Success': False).

image

image

The above screenshot tells that Salt is trying to find something in the windows registry but it is not able to. Not sure if these two contain any valueable information.

@twangboy
Copy link
Contributor

twangboy commented Apr 27, 2021

pkg.list_available tells you the package is available to be installed. Not that it is installed. The fact that it is not present in pkg.list_pkgs tells me that the installation failed regardless of the logs or state return values.

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 info-needed waiting for more info severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Windows
Projects
None yet
Development

No branches or pull requests

4 participants