RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1964255 - libpcp/pmproxy: authentication is unsuccessful if the password contains special characters
Summary: libpcp/pmproxy: authentication is unsuccessful if the password contains speci...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcp
Version: 8.4
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: beta
: 8.6
Assignee: Andreas Gerstmayr
QA Contact: Jan Kurik
Apurva Bhide
URL:
Whiteboard:
Depends On:
Blocks: 1991763
TreeView+ depends on / blocked
 
Reported: 2021-05-25 06:29 UTC by Mark Keir
Modified: 2022-05-10 13:49 UTC (History)
4 users (show)

Fixed In Version: pcp-5.3.4-1.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 13:30:36 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
bpftrace.conf (1009 bytes, text/plain)
2021-05-25 09:40 UTC, Mark Keir
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2022:1765 0 None None None 2022-05-10 13:30:51 UTC

Description Mark Keir 2021-05-25 06:29:41 UTC
Description of problem:
Unable to configure PCP bpftrace Grafana Datasource, authentication or other failure

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

How reproducible:

Always

Steps to Reproduce:
1. Follow steps at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/monitoring_and_managing_system_status_and_performance/setting-up-graphical-representation-of-pcp-metrics_monitoring-and-managing-system-status-and-performance#creating-panel-and-alerts-in-pcp-redis-data-source_setting-up-graphical-representation-of-pcp-metrics or https://grafana-pcp.readthedocs.io/en/latest/datasources/authentication.html
2. Test credential access from command line
3. Try to use same credentials in configuring the Datasource

Actual results:
Command line succeeds, eg:
pminfo -f -h "pcp://127.0.0.1?username=metrics" disk.dev.read
Password: 

disk.dev.read
    inst [0 or "nvme0n1"] value 97607

Datasource save and test fails:
cannot connect to PMCD: Authentication - bad protocol / cancel. To use this data source, please configure the URL in the query editor.

Expected results:

Command line succeeds, Datasource save and test succeeds

Additional info:

Comment 1 Jan Kurik 2021-05-25 09:13:29 UTC
Hi Mark,

I was trying to reproduce the issue, but everything works for me. Can you please share content of your /etc/pcp/bpftrace/bpftrace.conf file ?

Comment 2 Mark Keir 2021-05-25 09:40:58 UTC
Created attachment 1786781 [details]
bpftrace.conf

Requested configuration file attached.

Comment 3 Andreas Gerstmayr 2021-05-25 10:08:43 UTC
Can you check the datasource settings if only "Basic Auth" is selected in the Auth section?
And please check /var/log/pcp/pmproxy/pmproxy.log for anything unusual.

Also, can you try creating another user with an "easy" password, as in just letters and digits (the error you're seeing also shows up when the username/password doesn't match)? Possibly some special character gets lost.


fwiw, I also couldn't reproduce this, just fishing for things which could get wrong.

Comment 4 Mark Keir 2021-05-26 05:34:24 UTC
A failed "Save & Test" created a log entry in /var/log/pcp/pmproxy/pmproxy.log such as the following event.

[Wed May 26 15:32:16] pmproxy(110882) Error: opening input terminal for read

Moving on to try a user/password with less complexity.

Comment 5 Mark Keir 2021-05-26 05:48:25 UTC
Creating a password with this command, the Datasource could be configured.

mkpasswd -s 0 -l 15

Using the following also worked for a fresh value.

mkpasswd -s 3 -l 15

By substituting the special characters in the starting password, I was able to determine that a special character of "=" broke the Datasource configuration for any attempted location in the string.

Comment 6 Andreas Gerstmayr 2021-05-26 13:17:56 UTC
Thanks a lot for your analysis!

I'll fix this bug in RHEL 8.5.

Comment 7 Andreas Gerstmayr 2021-05-26 16:07:27 UTC
I thought it's a quick and easy fix in pmproxy or grafana-pcp, but after diving down to the root cause, I realized that the issue is in a core part of PCP (the handling of hostspecs [1]), so I moved the component to pcp.

I cannot guarantee that I've the time to properly implement and test this for 8.5, so I cleared the DTM/ITM. Sorry for the hasty triaging.


[1] https://github.com/performancecopilot/pcp/issues/1305

Comment 9 Andreas Gerstmayr 2021-10-01 17:10:25 UTC
fixed upstream and will be part of the next rebase of PCP:

commit 2ff22e302de22f62cbd6cee1bf8f2aad775da866
Author: Andreas Gerstmayr <agerstmayr>
Date:   Tue Sep 14 19:55:28 2021 +0200
 
    libpcp: use urlencoding for hostspec parameter values
    
    Resolves: #1305

Comment 14 errata-xmlrpc 2022-05-10 13:30:36 UTC
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 (pcp bug fix and enhancement update), 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/RHBA-2022:1765


Note You need to log in before you can comment on or make changes to this bug.