Bug 2043097
| Summary: | sql dump of dynflow data is encoded, what breaks sosreport | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Pavel Moravec <pmoravec> |
| Component: | Dynflow | Assignee: | Adam Ruzicka <aruzicka> |
| Status: | CLOSED ERRATA | QA Contact: | Lukáš Hellebrandt <lhellebr> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.11.0 | CC: | aruzicka, pcreech |
| Target Milestone: | 6.11.0 | Keywords: | Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | dynflow-utils-1.6.3 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-07-05 14:32:15 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2043102 | ||
|
Description
Pavel Moravec
2022-01-20 15:47:05 UTC
The tool will be delivered in a new package dynflow-utils, it will get pulled in as a dependency of tfm-rubygem-dynflow. Upstream packaging PR[1] is opened. [1] - https://github.com/theforeman/foreman-packaging/pull/7501 Verified with Sat 6.11 snap 15.0. # export PGPASSWORD=$(grep password /etc/foreman/database.yml | cut -d\" -f2) # timeout 600s psql --no-password -h localhost -p 5432 -U foreman -d foreman -c "COPY (select encode(dynflow_execution_plans.execution_history, 'escape') from foreman_tasks_tasks join dynflow_execution_plans on (foreman_tasks_tasks.external_id = dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval '1 months') TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)" | tail -n 2 \223\203\244time\316b\244name\245delay\250world_id\331$32f7e466-d6d8-4e55-b2db-7ec1f7642951\203\244time\316bSo\221\244name\257start execution\250world_id\331$b7b400c3-11e0-4cf6-af5b-0a18e89e571d\203\244time\316bSo\333\244name\260finish execution\250world_id\331$b7b400c3-11e0-4cf6-af5b-0a18e89e571d \223\203\244time\316bP\314\222\244name\245delay\250world_id\331$32f7e466-d6d8-4e55-b2db-7ec1f7642951\203\244time\316bR\244name\257start execution\250world_id\331$b7b400c3-11e0-4cf6-af5b-0a18e89e571d\203\244time\316bR\244name\260finish execution\250world_id\331$b7b400c3-11e0-4cf6-af5b-0a18e89e571d # timeout 600s psql --no-password -h localhost -p 5432 -U foreman -d foreman -c "COPY (select dynflow_execution_plans.execution_history from foreman_tasks_tasks join dynflow_execution_plans on (foreman_tasks_tasks.external_id = dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval '1 months') TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)" | tail -n 2 \x9383a474696d65ce62521e08a46e616d65a564656c6179a8776f726c645f6964d92433326637653436362d643664382d346535352d623264622d37656331663736343239353183a474696d65ce62536f91a46e616d65af737461727420657865637574696f6ea8776f726c645f6964d92462376234303063332d313165302d346366362d616635622d30613138653839653537316483a474696d65ce62536fdba46e616d65b066696e69736820657865637574696f6ea8776f726c645f6964d92462376234303063332d313165302d346366362d616635622d306131386538396535373164 \x9383a474696d65ce6250cc92a46e616d65a564656c6179a8776f726c645f6964d92433326637653436362d643664382d346535352d623264622d37656331663736343239353183a474696d65ce62521e05a46e616d65af737461727420657865637574696f6ea8776f726c645f6964d92462376234303063332d313165302d346366362d616635622d30613138653839653537316483a474696d65ce62521e05a46e616d65b066696e69736820657865637574696f6ea8776f726c645f6964d92462376234303063332d313165302d346366362d616635622d306131386538396535373164 Last entry converted (https://toolslick.com/conversion/data/messagepack-to-json) is: [ { "time": 1649462418, "name": "delay", "world_id": "32f7e466-d6d8-4e55-b2db-7ec1f7642951" }, { "time": 1649548805, "name": "start execution", "world_id": "b7b400c3-11e0-4cf6-af5b-0a18e89e571d" }, { "time": 1649548805, "name": "finish execution", "world_id": "b7b400c3-11e0-4cf6-af5b-0a18e89e571d" } ] Now, let's use the tool provided: # timeout 600s psql --no-password -h localhost -p 5432 -U foreman -d foreman -c "COPY (select dynflow_execution_plans.execution_history from foreman_tasks_tasks join dynflow_execution_plans on (foreman_tasks_tasks.external_id = dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval '1 months') TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)" | /usr/libexec/dynflow-expand | tail -n 2 "[{""name"":""delay"",""time"":1649548808,""world_id"":""32f7e466-d6d8-4e55-b2db-7ec1f7642951""},{""name"":""start execution"",""time"":1649635217,""world_id"":""b7b400c3-11e0-4cf6-af5b-0a18e89e571d""},{""name"":""finish execution"",""time"":1649635291,""world_id"":""b7b400c3-11e0-4cf6-af5b-0a18e89e571d""}]" "[{""name"":""delay"",""time"":1649462418,""world_id"":""32f7e466-d6d8-4e55-b2db-7ec1f7642951""},{""name"":""start execution"",""time"":1649548805,""world_id"":""b7b400c3-11e0-4cf6-af5b-0a18e89e571d""},{""name"":""finish execution"",""time"":1649548805,""world_id"":""b7b400c3-11e0-4cf6-af5b-0a18e89e571d""}]" And let's use it according to OP: # timeout 600s psql --no-password -h localhost -p 5432 -U foreman -d foreman -c "COPY (select dynflow_actions.* from foreman_tasks_tasks join dynflow_actions on (foreman_tasks_tasks.external_id = dynflow_actions.execution_plan_uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval '1 months') TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)" | /usr/libexec/dynflow-expand | tail -n 2 d0240620-e490-4f18-a6c1-9aa8edcda836,1,,,InsightsCloud::Async::InsightsScheduledSync,1,,,,"{""current_location_id"":null,""current_organization_id"":null,""current_request_id"":""05726dc3-cde4-4c24-ae7a-3ddc45f42327"",""current_timezone"":""UTC"",""current_user_id"":1}", a5a49bc4-cbb4-4270-9d9d-aad64b428276,1,,,InsightsCloud::Async::InsightsClientStatusAging,1,2,,,"{""current_location_id"":null,""current_organization_id"":null,""current_request_id"":""0d27a29b-4569-4b56-8e64-44c1533ed3fb"",""current_timezone"":""UTC"",""current_user_id"":1}",{} I have discovered some issues in /usr/share/doc/dynflow-utils-1.6.3/README.md , I'll file a new BZ about those. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:5498 |