I am hoping someone can point me to documentation for cleaning up databases on foreman. After upgrading from foreman 2.4/katello4.0 to foreman 2.5/katello 4.1 I cannot publish new content views and foreman-rake tasks generate a warning about permissions for /usr/share/foreman.
The production log shows ‘clean up your database’ entries when I attempt either tasks.
Thanks for your response @mcorr. Please see my update about 5 minutes ago. I attached the entries from the production.log file. If there other log files that would be helpful please let me know. I am very new to foreman so I am trying to ease myself into maintaining it. This system is actually meant to replace our older server so I am trying to figure it out as I go along.
You can then just type exit to get out of that prompt. It looks like the repo with ID 180 appears to be missing. When the upgrade completed, did the installer finish ok or error out?
Interestingly, it is missing the Upstream URL. That is an easy fix. Is that enough to cause the content-view publish failure for views that do not include that repo?
The Splunk_Forwarder/splunkforwarder-8_1_2 Sync status as ‘Not Synced’. Is Sync an expected state for a file based repo? The file was uploaded from a copy that is local to the foreman server.
I apologize, I mispoke. The Splunk_Forwarder/splunkforwarder-8_1_2 is actually in the content view that I attempted to publish for uploading to this issue. That said, the Splunk_Forwarder/splunkforwarder-8_1_2 repo does have the expected file listed. Is the file repo type not working in foreman 2.5?
I just attempted to publish a content view that does not include the Splunk_Forwarder/splunkforwarder-8_1_2 repo…and I get the same error I have been getting for all content views… (undefined method `id’ for nil:NilClass).
Can I use ‘hammer create repository --id 180’ to forcibly create a repo for ID 180 …which does not exist?
In my initial configuration I had splunkforwarder-8_1_2 in a product that did not make sense so I removed it to reorganize the structure of the products in foreman and created the Splunk_Forwarder product to contain the various files we need.
You @cintrix84 asked me about the upgrade, it appeared to run successfully. I am attaching a sanitized version of the katello.log that shows the results. It is pretty lengthy because I had debug logging enabled (still do).
This was the tail end of the output that was displayed in when it finished.
Upgrade Step 2/4: katello:clean_backend_objects. This may take a long while.
0 orphaned consumer id(s) found in candlepin.
Candlepin orphaned consumers: []
=============================================
Upgrade Step 3/4: katello:upgrades:4.1:sync_noarch_content. =============================================
Upgrade Step 4/4: katello:upgrades:4.1:fix_invalid_pools. I, 2021-06-10T10:15:56.016520 #131878 INFO – : Corrected 0 invalid pools
I, 2021-06-10T10:15:56.016561 #131878 INFO – : Removed 0 orphaned pools
Success!
Foreman is running at https://puppet.ensco.win
To install an additional Foreman proxy on separate machine continue by running:
foreman-proxy-certs-generate --foreman-proxy-fqdn "$FOREMAN_PROXY" --certs-tar "/root/$FOREMAN_PROXY-certs.tar"
Foreman Proxy is running at https://puppet.ensco.win:9090
The full log is at /var/log/foreman-installer/katello.log
I am still looking into this and checking with others if there is a way to recover the ID’s of the repos. The repo task during the upgrade should have caught it which I am surprised it didn’t.
I have a feeling the change I made to the repos that resulted in the missing repo occurred after the upgrade. I don’t recall which came first (upgrade or repo delete) but I don’t think the upgrade would have finished as cleanly based on what I am seeing now. I did make a backup before the upgrade but I suspect that is not helpful at this point.