Bug 1254550 - Initial setup: Register using activation-key just hangs at attaching subscriptions page
Initial setup: Register using activation-key just hangs at attaching subscrip...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager (Show other bugs)
7.2
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Adrian Likins
Sean Toner
:
Depends On:
Blocks: 1264318 1266790
  Show dependency treegraph
 
Reported: 2015-08-18 07:36 EDT by Shwetha Kallesh
Modified: 2015-11-19 06:50 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1261177 (view as bug list)
Environment:
Last Closed: 2015-11-19 06:50:46 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Page where process gets hanged (124.01 KB, image/png)
2015-08-18 07:36 EDT, Shwetha Kallesh
no flags Details
already registered on initial-setup (65.17 KB, image/png)
2015-10-01 16:02 EDT, Sean Toner
no flags Details

  None (edit)
Description Shwetha Kallesh 2015-08-18 07:36:07 EDT
Created attachment 1064294 [details]
Page where process gets hanged

Description of problem:
When you try to register using activation-key register process just hangs at attaching subscriptions page 

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

subscription-manager-initial-setup-addon-1.16.1-1.git.5.6a174da.el7.x86_64

server type: Red Hat Subscription Management
subscription management server: 2.0.6-1
subscription management rules: 5.16
subscription-manager: 1.16.1-1.git.5.6a174da.el7
python-rhsm: 1.16.1-1.git.0.f12fbd1.el7

How reproducible:


Steps to Reproduce:
1.systemctl enable initial-setup-graphical.service
2.reboot
3.Click on register to rhsm icon
4. Enter the server details and select using activation key
5. Enter proper activation key credentials 

Actual results:

Register process just hangs at attaching subscriptions page
Expected results:
Process should not hang

Additional info:
Comment 4 Adrian Likins 2015-09-08 12:38:31 EDT
I think https://github.com/candlepin/subscription-manager/pull/1287 should fix this.
Comment 5 vritant 2015-09-08 17:31:38 EDT
While https://github.com/candlepin/subscription-manager/pull/1287  does allow registering via activation keys, I doubt if this was the error observed in this BZ , as prior to this PR we were seeing an error, and that does not match observations in this BZ.

I suspect the perceivably "hanging" effect could also be seen when the system is already registered, and we start initial-setup . please view BZ 1261177 for details.
Comment 6 Chris Rog 2015-09-10 16:00:47 EDT
commit e5796d3d6d493a2a8a8e7151eb58b89e9690e6e6
Author: Adrian Likins <alikins@redhat.com>
Date:   Tue Sep 8 11:12:17 2015 -0400

    1254550: Fix activation key usage in gui.
    
    The handler for activation key changes wasn't unsetting
    username/password.
Comment 8 John Sefler 2015-09-18 16:33:44 EDT
It sounds like the original problem occurred after a user began the registration workflow using an invalid username/password and then Cancelled (or when Back) to restart the registration process but decided to use an activation key on the second attempt.
Comment 9 John Sefler 2015-09-18 18:19:59 EDT
(In reply to John Sefler from comment #8)
Nope - that not the full story.

Testing Version...
[root@jsefler-rhel72-snap21 ~]# rpm -q subscription-manager-initial-setup-addon
subscription-manager-initial-setup-addon-1.15.9-10.el7.x86_64

Registering with a valid activation key through subscription-manager-initial-setup-addon works successfully for the normal use case.  However, if your system is already registered prior to starting initial-setup and you attempt to register using a valid activation key, you will get stuck and hang as shown in the original attachment 1064294 [details].

There is no trace to share from /var/log/rhsm/rhsm.log.  However there is a trace from /var/log/messages (notice the unhandled Python exception)...
[root@jsefler-rhel72-snap21 ~]# tail -f /var/log/messages
Sep 18 18:04:00 jsefler-rhel72-snap21 initial-setup: found 3 addon modules:
Sep 18 18:04:00 jsefler-rhel72-snap21 initial-setup: using kickstart from previous run for input
Sep 18 18:04:00 jsefler-rhel72-snap21 initial-setup: parsing input kickstart /root/initial-setup-ks.cfg
Sep 18 18:04:00 jsefler-rhel72-snap21 initial-setup: kickstart parsing done
Sep 18 18:04:00 jsefler-rhel72-snap21 initial-setup: starting the UI
Sep 18 18:04:02 jsefler-rhel72-snap21 anaconda: setting <pyanaconda.ui.gui.spokes.network.NetworkSpoke object at 0x4b8da10> status to: Connected: virbr0 (virbr0-nic), ens3
Sep 18 18:04:52 jsefler-rhel72-snap21 subscription-manager: Registered system with identity: 573b26c8-a860-46bf-9ce3-64ea73873f4b
Sep 18 18:04:53 jsefler-rhel72-snap21 subscription-manager: Registered system with identity: 573b26c8-a860-46bf-9ce3-64ea73873f4b
Sep 18 18:04:54 jsefler-rhel72-snap21 python: detected unhandled Python exception in '/usr/lib/python2.7/site-packages/initial_setup/__main__.py'
Sep 18 18:04:54 jsefler-rhel72-snap21 abrt-server: Duplicate: core backtrace
Sep 18 18:04:54 jsefler-rhel72-snap21 abrt-server: DUP_OF_DIR: /var/spool/abrt/Python-2015-09-18-16:50:25-26586
Sep 18 18:04:54 jsefler-rhel72-snap21 abrt-server: Deleting problem directory Python-2015-09-18-18:04:54-5204 (dup of Python-2015-09-18-16:50:25-26586)
Sep 18 18:04:54 jsefler-rhel72-snap21 dbus[672]: [system] Activating service name='org.freedesktop.problems' (using servicehelper)
Sep 18 18:04:54 jsefler-rhel72-snap21 dbus-daemon: dbus[672]: [system] Activating service name='org.freedesktop.problems' (using servicehelper)
Sep 18 18:04:54 jsefler-rhel72-snap21 dbus[672]: [system] Successfully activated service 'org.freedesktop.problems'
Sep 18 18:04:54 jsefler-rhel72-snap21 dbus-daemon: dbus[672]: [system] Successfully activated service 'org.freedesktop.problems'
Sep 18 18:04:54 jsefler-rhel72-snap21 gnome-session: abrt-applet: repeated problem in initial-setup-0.3.9.29-1.el7, not showing the notification
Sep 18 18:04:54 jsefler-rhel72-snap21 gnome-session: abrt-applet: repeated problem in initial-setup-0.3.9.29-1.el7, not showing the notification
Sep 18 18:04:54 jsefler-rhel72-snap21 abrt-server: Email address of sender was not specified. Would you like to do so now? If not, 'user@localhost' is to be used [y/N] 
Sep 18 18:04:54 jsefler-rhel72-snap21 abrt-server: Email address of receiver was not specified. Would you like to do so now? If not, 'root@localhost' is to be used [y/N] 
Sep 18 18:04:54 jsefler-rhel72-snap21 abrt-server: Sending an email...
Sep 18 18:04:55 jsefler-rhel72-snap21 abrt-server: Email was sent to: root@localhost


Here's the crash report sent to root....
From user@localhost.usersys.redhat.com  Fri Sep 18 18:04:55 2015
Return-Path: <user@localhost.usersys.redhat.com>
X-Original-To: root@localhost
Delivered-To: root@localhost.usersys.redhat.com
Date: Fri, 18 Sep 2015 18:04:54 -0400
From: user@localhost.usersys.redhat.com
To: root@localhost.usersys.redhat.com
Subject: [abrt] full crash report
User-Agent: Heirloom mailx 12.5 7/5/10
Content-Type: text/plain; charset=us-ascii
Status: R

time:           Fri 18 Sep 2015 04:50:25 PM EDT
cmdline:        python -m initial_setup
uid:            0 (root)
abrt_version:   2.1.11
dso_list:       subscription-manager-gui-1.15.9-10.el7.x86_64
event_log:      
executable:     /usr/lib/python2.7/site-packages/initial_setup/__main__.py
hostname:       jsefler-rhel72-snap21.usersys.redhat.com
kernel:         3.10.0-316.el7.x86_64
last_occurrence: 1442613894
pid:            26586
pkg_arch:       x86_64
pkg_epoch:      0
pkg_name:       initial-setup
pkg_release:    1.el7
pkg_version:    0.3.9.29
runlevel:       N 5
username:       root

backtrace:
:registergui.py:1463:_watch_thread:TypeError: _on_refresh_cb() got multiple values for keyword argument 'error'
:
:Traceback (most recent call last):
:  File "/usr/share/rhsm/subscription_manager/gui/registergui.py", line 1463, in _watch_thread
:    callback(retval, error=error)
:TypeError: _on_refresh_cb() got multiple values for keyword argument 'error'
:
:Local variables in innermost frame:
:callback: <bound method RefreshSubscriptionsScreen._on_refresh_cb of <RefreshSubscriptionsScreen object at 0x55c54b0 (
subscription_manager+gui+registergui+RefreshSubscriptionsScreen at 0x2f33780)>>
:self: <subscription_manager.gui.registergui.AsyncBackend object at 0x55081d0>
:retval: None
:error: (<class 'rhsm.connection.RestlibException'>, RestlibException(), <traceback object at 0x7fcc9c132a70>)

environ:
:GNOME_DESKTOP_SESSION_ID=this-is-deprecated
:GJS_DEBUG_OUTPUT=stderr
:LESSOPEN=||/usr/bin/lesspipe.sh %s
:QT_IM_MODULE=ibus
:LOGNAME=root
:USER=root
:HOME=/root
:XDG_VTNR=2
:PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/root/bin
:WINDOWPATH=1:2
:SSH_AGENT_PID=24356
:LANG=en_US.UTF-8
:TERM=xterm-256color
:SHELL=/bin/bash
:XAUTHORITY=/run/gdm/auth-for-root-mCoffi/database
:SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/24129,unix/unix:/tmp/.ICE-unix/24129
:SHLVL=3
:HISTSIZE=1000
:WINDOWID=35651591
:IMSETTINGS_INTEGRATE_DESKTOP=yes
:GPG_AGENT_INFO=/run/user/0/keyring/gpg:0:1
:USERNAME=root
:IMSETTINGS_MODULE=none
:XDG_RUNTIME_DIR=/run/user/0
:SSH_AUTH_SOCK=/run/user/0/keyring/ssh
:VTE_VERSION=3803
:GDMSESSION=gnome-classic
:XMODIFIERS=@im=ibus
:GNOME_SHELL_SESSION_MODE=classic
:MAIL=/var/spool/mail/root
:XDG_CURRENT_DESKTOP=GNOME-Classic:GNOME
:XDG_SESSION_ID=192
:DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-y3QYRJz3wv,guid=0764638773b42bcd4435541255fc406d
:_=/usr/bin/python
:DESKTOP_SESSION=gnome-classic
:DISPLAY=:1
:HOSTNAME=jsefler-rhel72-snap21.usersys.redhat.com
:GDM_LANG=en_US.UTF-8
:HISTCONTROL=ignoredups
:PWD=/root
:XDG_MENU_PREFIX=gnome-
:XDG_SESSION_DESKTOP=gnome-classic
:LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;
38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10
;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;
5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5
;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38
;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5
;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13
:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm
=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5
;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*
.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38
;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.c
gm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5
;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.a
xa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
:GJS_DEBUG_TOPICS=JS ERROR;JS LOG
:XDG_SEAT=seat0

machineid:
:systemd=7ef63f0033370a48ba9f710c403e0189
:sosreport_uploader-dmidecode=f067c3426af566a66121991daa4f1667dc1ed6b91cf04e2d187ce6a08d1a82e8

os_info:
:NAME="Red Hat Enterprise Linux Server"
:VERSION="7.2 (Maipo)"
:ID="rhel"
:ID_LIKE="fedora"
:VERSION_ID="7.2"
:PRETTY_NAME="Red Hat Enterprise Linux"
:ANSI_COLOR="0;31"
:CPE_NAME="cpe:/o:redhat:enterprise_linux:7.2:beta:server"
:HOME_URL="https://www.redhat.com/"
:BUG_REPORT_URL="https://bugzilla.redhat.com/"
:
:REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
:REDHAT_BUGZILLA_PRODUCT_VERSION=7.2
:REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
:REDHAT_SUPPORT_PRODUCT_VERSION="7.2 Beta"



Moving back to NEW/FailedQA
Comment 11 Adrian Likins 2015-09-24 13:15:29 EDT
(In reply to John Sefler from comment #9)
> (In reply to John Sefler from comment #8)
> Nope - that not the full story.
> 
> Testing Version...
> [root@jsefler-rhel72-snap21 ~]# rpm -q
> subscription-manager-initial-setup-addon
> subscription-manager-initial-setup-addon-1.15.9-10.el7.x86_64
> 
> Registering with a valid activation key through
> subscription-manager-initial-setup-addon works successfully for the normal
> use case.  However, if your system is already registered prior to starting
> initial-setup and you attempt to register using a valid activation key, you
> will get stuck and hang as shown in the original attachment 1064294 [details]
> [details].

> backtrace:
> :registergui.py:1463:_watch_thread:TypeError: _on_refresh_cb() got multiple
> values for keyword argument 'error'
> :
> :Traceback (most recent call last):
> :  File "/usr/share/rhsm/subscription_manager/gui/registergui.py", line
> 1463, in _watch_thread
> :    callback(retval, error=error)
> :TypeError: _on_refresh_cb() got multiple values for keyword argument 'error'
> :

in https://github.com/candlepin/subscription-manager/pull/1296
commit 3db904439b3038bd8e42f4d68f7910ca65f3a910
Author: Adrian Likins <alikins@redhat.com>
Date:   Thu Aug 27 14:22:15 2015 -0400

    Populate gui with info from kickstart (mostly).
    
    Add a Screen.populate() method in registergui for
    populating the screens widgets with defaults or
    the values from a kickstart.
    
    Change _on_refresh_cb to accept an unused msg arg
    for consistency.
Comment 12 Chris Rog 2015-09-28 14:13:05 EDT
commit 44e1a74aa6c6bd2ccfa0ea3819b9177b684debcf
Author: Adrian Likins <alikins@redhat.com>
Date:   Thu Aug 27 14:22:15 2015 -0400

    1242998, 1254550: Fix "already reg'ed" in initial-setup
    
    Handle initial-setup running on a system that is potentially
    already registered and/or attached to subscriptions better.
    
    The RegisterWidget as used in initial-setup now detects
    if the system is already registered. Current behavior is
    to automatically move ahead to 'attach' stage of registration
    if needed, or to the done screen if already registered and
    attached.
    
    RegisterWidget now runs choose_initial_screen as an idle_add
    callback, so initial setup idle_add's it, then the callback
    decides which screen to immedidetly move to from
    initial_screen, and emit's signals to do it.
    
    Refactor RegisterDialog so AutoBindWizard can subclass it easier.
    
    Give AutoAttachWidget it's own choose_initial_screen
    since it doesn't need to detect if a system is registered.
    
    Populate gui with info from kickstart (mostly).
    
    Add a Screen.populate() method in registergui for
    populating the screens widgets with defaults or
    the values from a kickstart.
    
    Change _on_refresh_cb to accept an unused msg arg
    for consistency. (1254550)
    
    Add 'register-message' signal for non error info (for
    example, displaying the info that a system is already
    registered and attached).
    
    Move to having RegisterWidget driven by RegInfo
    
    Add a pre() to ChooseServerPage() that it can use to
    decide if it should start there are go to attach, etc.
    
    Some screen bookeeping simplified.
    
    Add a RegisterWidget.current_screen python prop
    
    Rearrange the methods in this class to make some sense
    
    Cleanup, refactoring, docs, test fixes, etc.
Comment 14 Sean Toner 2015-10-01 16:02 EDT
Created attachment 1079248 [details]
already registered on initial-setup

If the system has already been registered previously, and initial-setup is run again, it detects that the system has been registered and the user is presented with this screen (see screenshot)

System does not hang in the usual case where the system is not already registered and user is registering via an activation key
Comment 15 errata-xmlrpc 2015-11-19 06:50:46 EST
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, 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://rhn.redhat.com/errata/RHBA-2015-2122.html

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