Project

General

Profile

Actions

Bug #22250

closed

After upgrading hammer credentials are not migrated to new location - Invalid username or password

Added by Martin Bacovsky about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
High
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1526828

Description of problem:

Upgrading 6.2 -> 6.3 public beta does not migrate hammer login credentials from ~/.hammer/cli_config.yml (6.1, 6.2) to ~/.hammer/cli.modules.d/foreman.yml (new location in 6.3) which leads to error

  1. hammer organization list
    Invalid username or password

~/.hammer/cli.modules.d/foreman.yml contained some random string as a password

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

satellite 6.2.12 upgraded to 6.3 public beta

[root@provisioning ~]# rpm -qa | egrep "satellite|hammer"
satellite-cli-6.3.0-21.0.beta.el7sat.noarch
satellite-common-6.3.0-21.0.beta.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_admin-0.0.7-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_remote_execution-0.0.6-1.fm1_15.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3.3-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.11.0.3-1.el7sat.noarch
tfm-rubygem-foreman_theme_satellite-1.0.4.11-1.el7sat.noarch
tfm-rubygem-hammer_cli_csv-2.3.0-1.el7sat.noarch
satellite-6.3.0-21.0.beta.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.6-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_discovery-1.0.0-1.el7sat.noarch
satellite-installer-6.3.0.9-1.beta.el7sat.noarch
tfm-rubygem-hammer_cli-0.11.0.1-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_openscap-0.1.5-1.fm1_15.el7sat.noarch
tfm-rubygem-hammer_cli_katello-0.11.3.1-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.12-1.fm1_15.el7sat.noarch
satellite-capsule-6.3.0-21.0.beta.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_virt_who_configure-0.0.3-1.el7sat.noarch

How reproducible:

Steps to Reproduce:
1. Upgrade to 6.3 with stored hammer credentials
2. Run hammer command

Actual results:

  1. hammer organization list
    Invalid username or password

After satellite upgrade


Related issues 1 (0 open1 closed)

Copied to Katello - Bug #22431: After upgrading hammer credentials are not migrated to new location - Invalid username or passwordClosedMartin Bacovsky01/11/2018Actions
Actions #1

Updated by Martin Bacovsky about 6 years ago

  • Subject changed from After upgrading to 6.3 hammer credentials are not migrated to new location - Invalid username or password to After upgrading hammer credentials are not migrated to new location - Invalid username or password
  • Description updated (diff)
Actions #2

Updated by Martin Bacovsky about 6 years ago

The hammer configs are now installed by foreman-installer https://github.com/theforeman/puppet-foreman/blob/master/manifests/cli.pp. It uses value of admin_password from answer file. This value may become outdated when admin password is changed in the UI later.

In previous versions users had hammer credentials configured on various locations:
- /etc/hammer/cli_conig.yml
- /etc/hammer/cli.modules.d/foreman.yml
- /root/.hammer/cli_conig.yml
- /root/.hammer/cli.modules.d/foreman.yml

When upgrading and the password was changed in UI and the /root/.hammer/cli.modules.d/foreman.yml does not exist installer creates the config with the outdated value in password.

Actions #3

Updated by Martin Bacovsky about 6 years ago

To prevent this make sure the admin_password is set correctly in installer answerfile or run the upgrade with --admin-password <current pwd>.
To fix after the error happened just update /root/.hammer/cli.modules.d/foreman.yml with correct password

Actions #4

Updated by Martin Bacovsky about 6 years ago

  • Project changed from Foreman to Installer
Actions #5

Updated by The Foreman Bot about 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-installer/pull/260 added
Actions #6

Updated by Martin Bacovsky about 6 years ago

  • Copied to Bug #22431: After upgrading hammer credentials are not migrated to new location - Invalid username or password added
Actions #7

Updated by Martin Bacovsky about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF