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 0.16.0 (aeb20a4, PR#6426): KeyError When Installing Packages With Yum Through Salt #6427

Closed
tedops opened this issue Jul 30, 2013 · 3 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior
Milestone

Comments

@tedops
Copy link

tedops commented Jul 30, 2013

Receiving this error when referencing any packages available through yum. This example is when installing rpm-build, but I receive this error when trying to install git, tree, vim-enhanced, or any package like that. No errors when installing new directories, files from templates, or anything like that.

https://gist.github.com/tsheibar/6110103

@ghost ghost assigned terminalmage Jul 30, 2013
@terminalmage
Copy link
Contributor

@tsheibar What distro and version were you using? Also, please post a gist of the output from salt minion-id grains.items, taking care to sanitize any personally identifiable information. What looks like is happening is that the os detection used to determine the

Also, in the meantime, as a workaround you can use the providers key in the minion config (see here for documentation) to manually set the pkg provider.

Note that there are two providers for package management with yum. yumpkg uses the python interface for yum, which is not available in older RHEL-based distros, while yumpkg5 wraps the yum CLI command. An easy way to check if your system has the python interface for yum is to run python -c 'import yum' from the command line. If there is no output, then you have the needed python module, whereas if you get an ImportError, you do not.

@tedops
Copy link
Author

tedops commented Jul 30, 2013

@terminalmage I should have been more clear -- this error is happening with a standalone minion, so salt minion-id grains.items returns with an error: Could not access /var/cache/salt/master. Please give root read permissions. The directory doesn't actually exist -- only /var/cache/salt/minion.

Running `python -c 'import yum'`` returns with no output, so I have the needed module.

OS details (CentOS6):
Linux [snip] 2.6.32-279.14.1.el6.x86_64 #1 SMP Tue Nov 6 23:43:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Your workaround, however, is perfect -- worked like a charm. All I did was add the following to /etc/salt/minion:

providers:
  pkg: yumpkg

Thanks very much for your help!

@tedops tedops closed this as completed Jul 30, 2013
@tedops tedops reopened this Jul 30, 2013
@tedops
Copy link
Author

tedops commented Jul 30, 2013

Created pull request #6452 to eliminate the workaround:

#6452

tedops pushed a commit to tedops/salt that referenced this issue Jul 31, 2013
…to address CentOS boxes that may have custom content within /etc/centos-release
thatch45 added a commit that referenced this issue Jul 31, 2013
Issue #6427 fix : Choose Package Provider on CentOS Boxes with Custom /etc/centos-release Content
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
Projects
None yet
Development

No branches or pull requests

2 participants