Hi all, currently running Foreman 3.15 with Katello 4.17 and have a cron on the master that runs a new sync across all products each month, followed by a content view (x3) publish the next day
Have noticed some content missing here and there and think it’s because each time we run the below cv publish, it runs an optimized sync, not full
#EL8
03 04 28 * * root hammer content-view publish --organization ‘Main’ --name ‘EL8’ --lifecycle-environments dev,prod --description “New EL8 content as of $(date ‘+%F’) for Monthly Patching” --async
To force a complete sync on the repository itself use the --skip-metadata-check=true flag during repository sync when you call hammer repository synchronize in your cron. The complete sync has to be run before you publish a new version of the content view. The next publish will pick up the changes and publish a new version with the latest content on the repository. CV publish itself doesn’t have an optimized/complete option.
If you’re using a smart proxy as the linked post covers, the smart proxy sync also uses the --skip-metadata-check=true flag to force a complete sync.
Although if new content gets added to upstream repo, I’d expect an optimized sync on the repo to identify the change and fetch the new content. If you’re noticing content missing, you can check the task output of the relevant repository sync in the UI and see if the output contains a section called “Added content” listing the content you expect to see?
You may have hit the same issue as me with katello 4.17, some repositories are not available on the smart proxy until they are completely re-synced and no error is reported.
So you are saying to add " --skip-metadata-check=true" to this command and it trigger the full sync?
Also, do you know what --async is doing in both our product sync and publish commands. I copied it from here, prob should have questioned it at the time, but hasn’t caused any issues
thanks - good to know - so it would be:
03 18 27 * * root hammer product synchronize --name “OEL8_Upstream” --organization-label Main --async --skip-metadata-check=true to start a full sync? The publish as normal
Just noticed you’re calling sync on the product. Product sync doesn’t support the --skip-metadata-check and all syncs on product level will be optimized. Complete sync is only available on a repository level so you’ll need to update your sync to hammer repository synchronize ...
I do believe this is a functionality gap with product syncs and complete syncs should be allowed on a product level. This would be a valid RFE.
Ah, I wasn’t aware of this, thanks. We have only 3 products but MANY repos within them. Can I issue hammer repository synchronize with a wildcard, such as OEL8-* ? Otherwise I’ll have to copy the command over 20 times for each repo sync
I’ve just released you are on about initial product/reps sync. This isn’t my issue as that appears to work well using part 1 of my cron (03 18 27 * * root hammer product synchronize --name “OEL8_Upstream” --organization-label Main --async)
The issue I have is when I kick on part 2 of the cron (03 04 28 * * root hammer content-view publish --organization ‘Main’ --name ‘EL8’ --lifecycle-environments dev,prod --description “New EL8 content as of $(date ‘+%F’) for Monthly Patching” --async) to publish the new content views. After it completes this, Foreman automatically triggers a proxy sync. It’s this sync I am talking about. Last month’s content didnt get synced properly to one of the locations, so I needed to run a full sync (under infrastructure) and it was OK again. I would like to run this full sync option when publishing the content view, if possible…
If someone could point me in the right direction so I can follow @sajha advice and put in a feature request to allow wildcards when synchronizing at repository lebel OR allowing full syncs at product level OR both, that would be great.