Comments (11)
I dunno, seems kind of like a real corner case; if you do this "repointing" (presumably with Chef), wouldn't you do a yum clean
in that recipe?
yum clean
is a pretty big hammer to just throw unconditionally at this in the context of this provider.
from yum.
Don't get me wrong, this seems like dumb yum behavior. Ideally yum would provide a flag (--force
?) to say "I don't care that the new repomd.xml is older than what I had before," and I'd expect there to be a way for yum_repository
to use that flag (i.e. "I don't care what you need to do. Just make it so"). But since yum doesn't seem to have a flag to enable that behavior, I'm suggesting that yum_repository
should blow away the existing cache before building a new one, since there seems to be no other way to get around this problem. Yes, we could trigger a yum clean
ourselves every time we use yum_repository
. But why aren't we forced to manually call yum makecache
ourselves too? The answer is that it's obvious that you need to do that every time you reconfigure your repository, so yum_repository
does it for us.
Just to be clear, I'm not advocating calling yum clean
indiscriminately on all repositories. I'm advocating calling it on a single repository (using the --disablerepo
and --enablerepo
flags) exactly like yum makecache
is being called today, and only when the repository configuration is updated. I'm missing why you'd think that's a big hammer. If we have to rebuild the cache anyway (because we've pointed to a new repository which may have different packages, etc.), doesn't that imply that we're throwing the old cache away? What purpose do the old cache files serve at that point?
For what it's worth, I just did the following test and confirmed that it works:
- Edit
/var/cache/yum/x86_64/6/foo/repomd.xml
and change every value inside<timestamp></timestamp>
to some date in the future - Run
yum makecache --disablerepo=* --enablerepo=foo
to produce therepomd.xml
error above - Run
yum clean metadata --disablerepo=* --enablerepo=foo
to remove all repository metadata files for thefoo
repository - Re-run
yum makecache --disablerepo=* --enablerepo=foo
to confirm that theyum clean metadata
fix worked
from yum.
A colleague of mine just pointed out that we actually can't trigger a yum clean
ourselves because yum_repository
calls yum makecache
first and will fail before we have a chance.
from yum.
what is the lightest test you can think of to detect this condition?
from yum.
I figured out how we're hitting this bug and I've got a simple-ish test case. Basically we've got a race condition between our local yum repos and the upstream yum repos.
Our workflow is that we automatically provision a hardware appliance with cobbler, reboot, run the first run setup to set hostname (as we use chef vault and have to have our node registered with a known name) and then reboot and bootstrap the chef client.
When we run our chef converge, usually within five to ten minutes from when the appliance was first provisioned, our cookbook changes the location of the repositories to our local mirrors and sometimes those mirrors are behind the upstream yum repositories by up to an hour.
from yum.
It's been a while since I've looked at this, but to summarize my comments above, I believe the solution is to run yum clean metadata --disablerepo=* --enablerepo=foo
just before running yum makecache --disablerepo=* --enablerepo=foo
(presumably every time the foo
repository config file is changed).
from yum.
@someara I don't think this is something you'd want to "detect" per-se. What I'm suggesting is that the yum makecache
this cookbook currently does is only half of what needs to be done. I think you need to run yum clean metadata
first in order to delete the old cache files.
from yum.
I've added a "yum clean" before the "yum makecache" in the :create action.
Released as 3.6.0
from yum.
👍
from yum.
Awesome! Thanks @someara!
from yum.
I'm setting this on oracle linux 6.5, chef 12.4.1
from yum.
Related Issues (20)
- yum_repository doesn't support sensitive parameter
- Resolve Chef 13 deprecation warning HOT 2
- Yum cache should be purged before repository config file is deleted HOT 2
- Shouldn't README not include an example for EPEL? HOT 1
- baseurl should support multiple url per documentation HOT 3
- Installation of packages on centos HOT 1
- node['yum']['main']['exclude'] would be better as an array, no? HOT 3
- Tests failing due to repo choice HOT 1
- how to download yum rpm to intel's machine and install in another ARM64 machine HOT 1
- yum makecache in a recipe HOT 4
- [QUESTION] yum cookbook backward compatibility promises HOT 1
- enabling a yum repo should implicitly set the `manage` attribute to true HOT 1
- Locking Amazon Linux to a specific version via releasever
- 5.1.0 is not available from the supermarket HOT 1
- yum_globalconfig doesn't read attributes HOT 4
- where can i download chef client for rhel 8 HOT 1
- support globalconfig options available to newer versions of yum HOT 4
- Add support for install_weak_deps property used by DNF HOT 4
- Allow DNF best, skip_if_unavailable, and excludepkgs to be managed directly
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yum.