Content view publish task fails with errors : description: size must be between 0 and 255 , Environment with id XXX could not be found.

Solution Verified - Updated -

Environment

  • Red Hat Satellite 6.4+

Issue

  • Content view publish task is stuck in the paused state with the following error :
Katello::Errors::CandlepinError
description: size must be between 0 and 255

Environment with id XXXXXXXX could not be found.
  • The content-view can not be published or deleted because of the previous errors.
  • After changing the description to contain characters less than 255, the publish will fail with the following error:
Environment with id XXXX could not be found.

Resolution

1) Clean the tasks in paused state to avoid the error "Required lock is already taken by other running tasks" when making any action to the content-view.

# foreman-rake foreman_tasks:cleanup:run TASK_SEARCH="*" STATES="paused" VERBOSE=true

2) Change the description in the content-view details to contain characters less than 255.

webUI -> Content -> Content Views -> [Content_View_Name] -> Details -> Description -> Submit.

3) Get the owner_id of the current used organization :

# su - postgres -c "psql candlepin -c \"select id from cp_owner where displayname = 'CURRENT_USED_ORGANIZATION_NAME';\""

                id                
----------------------------------
 8aac01e7670d9d1f01670d9db3990001

4) Insert the missing environment ID in cp_environment database table.
- Replace XXXXXXX with the ID from the error message.
- Replace CONTENT_VIEW_NAME with the content-view name.

# su - postgres -c "psql candlepin -c \"INSERT INTO cp_environment VALUES ('XXXXXXX','2019-06-21 11:36:56.07+02', '2019-06-21 11:36:56.07+02','','Library/CONTENT_VIEW_NAME','8aac01e7670d9d1f01670d9db3990001');\""

5) Now the content-view can continue the normal operations.

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

Root Cause

  • Creating a new content-view with more than 255 characters in the description will throw an error when publishing the content-view and will prevent the creation of the environment ID of the content-view in the database.

  • The is a work around until the bugzilla opened for this issue will be fixed.

Diagnostic Steps

  • Content view publish task fails with errors :
description: size must be between 0 and 255  , Environment with id XXX could not be found.
Environment with id XXXXXXXX could not be found.

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.

Comments