Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2135355

Summary: No way to enable a disabled Recurring Logic
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: Tasks PluginAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: aruzicka, peter.vreman
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-12-01 18:26:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Moravec 2022-10-17 11:07:27 UTC
Description of problem:
When I disable a recurring logic (say, "Inventory scheduled sync", id=5), there is no way to successfully re-enable it.

WebUI offers Enable button, but it is a no-op (production.log does not log anything).

hammer does not have the capabilities to even enable or disable a recurring logic.

API does not work for me, since:
- per apidoc, "PUT /foreman_tasks/api/recurring_logics/:id" should work - but neither below command does work:

curl -H "content-type: application/json" -u admin:$PASS -X PUT -d "{\"id\": 5, \"enabled\": 1}" https://$(hostname -f)/foreman_tasks/api/recurring_logics/5

curl -H "content-type: application/json" -u admin:$PASS -X PUT -d "{\"id\": 5, \"enabled\": \"true\"}" https://$(hostname -f)/foreman_tasks/api/recurring_logics/5

Both logs ForemanTasks::Api::RecurringLogicsController#update but with no real change.

Since WebUI disable triggered /foreman_tasks/recurring_logics/5/disable endpoint and ForemanTasks::RecurringLogicsController#disable method, I also tried:

curl -H "content-type: application/json" -u admin:$PASS -X PUT -d "{\"id\": 5, \"enabled\": \"true\"}" https://$(hostname -f)/foreman_tasks/api/recurring_logics/5/enable

which failed with "No route matches" error.


So I see no way in enabling a disabled recurring logic.


Version-Release number of selected component (if applicable):
Sat 6.11


How reproducible:
100%


Steps to Reproduce:
1. Disable a recurring logic
2. Try to enable it by any mean.


Actual results:
2. No way found.


Expected results:
2. Ideally both API and WebUI does work.


Additional info:

Comment 1 Pavel Moravec 2022-10-17 11:53:57 UTC
This is mostly fixed in 6.12 where WebUI Enable button does work.

Still no way (known to me) to let it enabled via API, where the outcome is the same.

Comment 2 Adam Ruzicka 2022-10-17 11:56:52 UTC
> per apidoc, "PUT /foreman_tasks/api/recurring_logics/:id" should work - but neither below command does work:

The apidoc seems to be wrong, the accepted format should be { "id: $ID, "recurring_logic": { "enabled": $enabled } }


> Since WebUI disable triggered /foreman_tasks/recurring_logics/5/disable endpoint and ForemanTasks::RecurringLogicsController#disable method, I also tried:
> curl -H "content-type: application/json" -u admin:$PASS -X PUT -d "{\"id\": 5, \"enabled\": \"true\"}" https://$(hostname -f)/foreman_tasks/api/recurring_logics/5/enable

Webui hits the non-api controller, the following could work, but as it is a non-api controller, it should not be considered stable interface

curl -u admin:$pass -X PUT -d '{"id": $id}' https://$(hostname -f)/foreman_tasks/recurring_logics/5/enable

Comment 3 Pavel Moravec 2022-10-17 12:14:41 UTC
(In reply to Adam Ruzicka from comment #2)
> > per apidoc, "PUT /foreman_tasks/api/recurring_logics/:id" should work - but neither below command does work:
> 
> The apidoc seems to be wrong, the accepted format should be { "id: $ID,
> "recurring_logic": { "enabled": $enabled } }

That does not work either (on 6.12 beta/testathlon):

# cat enable.json
{ 
	"id": "5",
	"recurring_logic": { 
		"enabled": "true"
	}
}
[root@pmoravec-sat612-rhel8-beta ~]# curl -H "content-type: application/json" -u admin:$pass -X PUT -d @enable.json https://$(hostname -f)/foreman_tasks/recurring_logics/5
<!DOCTYPE html>
<html>
..
<body>
  <!-- This file lives in public/404.html -->
  <div class="dialog">
    <div>
      <h1>The page you were looking for doesn't exist.</h1>
..


> > Since WebUI disable triggered /foreman_tasks/recurring_logics/5/disable endpoint and ForemanTasks::RecurringLogicsController#disable method, I also tried:
> > curl -H "content-type: application/json" -u admin:$PASS -X PUT -d "{\"id\": 5, \"enabled\": \"true\"}" https://$(hostname -f)/foreman_tasks/api/recurring_logics/5/enable
> 
> Webui hits the non-api controller, the following could work, but as it is a
> non-api controller, it should not be considered stable interface
> 
> curl -u admin:$pass -X PUT -d '{"id": $id}' https://$(hostname
> -f)/foreman_tasks/recurring_logics/5/enable

This seems to fail on ActionController::InvalidAuthenticityToken all the time (but I guess prepending the command by getting auth token would make it work).


Anyway, it seems "just" apidoc needs to be updated (to something that really does work). At least WebUI does work in 6.12 \o/ .

Comment 4 Adam Ruzicka 2022-10-17 12:17:15 UTC
> That does not work either (on 6.12 beta/testathlon):

> # cat enable.json
> ...
> [root@pmoravec-sat612-rhel8-beta ~]# curl -H "content-type: application/json" -u admin:$pass -X PUT -d @enable.json https://$(hostname -f)/foreman_tasks/recurring_logics/5

But that's the ui controller again

Comment 5 Adam Ruzicka 2023-08-02 14:49:46 UTC
For reference, this seems to work for me, the apidoc should be updated to match this

curl -u $username:$password \
    -X PUT \
    -H 'Content-Type: application/json' \
    -d '{"recurring_logic": { "enabled": true } }'
    https://$sat_fqdn/foreman_tasks/api/recurring_logics/$recurring_logic_id

Comment 6 Brad Buckingham 2023-11-02 17:44:31 UTC
Upon review of our valid but aging backlog the Satellite Team has concluded that this Bugzilla does not meet the criteria for a resolution in the near term, and are planning to close in a month. This message may be a repeat of a previous update and the bug is again being considered to be closed. If you have any concerns about this, please contact your Red Hat Account team.  Thank you.

Comment 7 Brad Buckingham 2023-12-01 18:26:35 UTC
Thank you for your interest in Red Hat Satellite. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this feel free to contact your Red Hat Account Team. Thank you.