Subscription-manager command fails with error '%' must be followed by '%' or '(', found: '%password'

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 5.7 (and onwards)
  • Red Hat Subscription Management (RHSM)

Issue

  • In /etc/rhsm/rhsm.conf file the proxy password is not parsed properly.
  • If password of http proxy contains a special character '%' then subscription manager fails to run:
# subscription-manager refresh
  • Subscription manager commands fail if http proxy password contains special character % .

Resolution

  • Use %% instead of % and it should work fine.
  • For an example, if password for http proxy server is %abcd then enter % in front of % which will now become %%abcd.

Root Cause

  • The percent symbol has a special function when used in strings in Python, so it should be escaped.

Diagnostic Steps

  • Check if the value of proxy_password parameter in RHSM configuration file contains special character %.
# cat /etc/rhsm/rhsm.conf  | grep "proxy_password"
proxy_password = "%%abcd"
SBR
Components
Category

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.