Getting '{"publication":["Invalid hyperlink - Object does not exist."]}' error when publishing a content-view on connected Satellite or when importing contents to a disconnected Satellite
Environment
- Red Hat Satellite 6.10+
Issue
-
Publish content-view task (on connected Satellite) or Import task (on disconnected Satellite) failed with following error and ended in paused/error state.
- Satellite 6.10:
PulpRpmClient::ApiError Error message: the server returns an error HTTP status code: 400 Response headers: {"Date"=>"xxxxxxxxxxxx", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"GET, PUT, PATCH, DELETE, HEAD, OPTIONS", "X-Frame-Options"=>"SAMEORIGIN", "Content-Length"=>"62", "Correlation-ID"=>"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"XXX satellite.example.com", "Connection"=>"close"} Response body: {"publication":["Invalid hyperlink - Object does not exist."]}- Satellite 6.11:
The repository's publication is missing. Please run a 'complete sync' on <REPOSITORY_NAME>.
Resolution
-
Download the attached
fix_publications.rakefile. -
Copy it to the
/usr/share/foreman/lib/tasks/directory on the Satellite server. -
Use the following command to scan for missing publications:
# foreman-rake katello:fix_publications -
If any missing publication is detected then run the following command to fix it:
# foreman-rake katello:fix_publications COMMIT=true -
If the script fails on Sat6.10 with error
"The Dynflow world was not initialized yet. If your plugin uses it, make sure to call Rails.application.dynflow.require! in some initializer", then update one line in imported/opt/theforeman/tfm/root/usr/share/gems/gems/katello-*/lib/katello/tasks/reimport.rakefrom something like:task :check_ping => ["dynflow:client", :environment] do
to:
task :check_ping => ["environment", "dynflow:client"] do
-
The script will trigger some "Actions::Katello::Repository::MetadataGenerate" tasks in the background. Wait until all tasks are finished successfully. You can monitor the tasks in
Web UI -> Monitor -> Taskspage. -
In Web UI, go to the paused import task page and click the
resumebutton to resume the task.
Note:
If the script run fails, please check ['foreman-rake katello:fix_publications' fails on Red Hat Satellite 6.10+](https://access.redhat.com/solutions/6969772) for a possible solution.
For more KB articles/solutions related to Red Hat Satellite 6.x Content View Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Content View Issues
For more KB articles/solutions related to Red Hat Satellite 6.x Pulp 3.0 Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Pulp 3.0-related Issues
Root Cause
-
The incremental import task didn't create a new publication for the Default Organization View Library repositories after increasing the repository versions, so those repositories were still pointing to the publications of the previous or orphaned repository versions.
-
The orphaned repository versions were deleted by the weekly scheduled "Delete Orphaned Content" task which would eventually delete their respective publications.
-
When user performs the next incremental import, the missing publication errors are raised.
-
This issue has been fixed as a part of This content is not included.bugzilla 2173756 in Satellite 6.13. The fix only for preventive. For existing issue, users need to follow the Resolution steps to re-create the missing publications.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.