Skip to content

Unable to use psql-msgpack-decode inside foreman pod #498

@pmoravec

Description

@pmoravec

/usr/libexec/psql-msgpack-decode is used to decode dynflow data stored in PostgreSQL. If nothing else, foreman plugin in sos report relies on that, see https://github.com/sosreport/sos/blob/main/sos/report/plugins/foreman.py#L293-L300 .

But (see https://github.com/sosreport/sos/blob/main/sos/report/plugins/foreman.py#L213-L218):

# podman exec foreman /usr/libexec/psql-msgpack-decode --no-password -h localhost -p 5432 -U foreman -d foreman -c "COPY (select dynflow_execution_plans.* 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 '14 days' order by foreman_tasks_tasks.started_at asc) TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)"
/usr/libexec/psql-msgpack-decode: line 3: psql: command not found
#
# podman exec foreman cat /usr/libexec/psql-msgpack-decode
#!/usr/bin/sh

psql "$@" | /usr/libexec/dynflow-expand
# 

How to decode the data, when foreman pod doesnt have psql command and postgres pod doesnt have psql-msgpack-decode? (well, one can query postgres pod for the encoded data, and send the output to foreman pod to decode via /usr/libexec/dynflow-expand, but.. cant be there some simplier option?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions