Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1406989

Summary: [Patch]Traceback log when viewing the details of the last repo sync with rhui-manager is displayed vertically and hard to read
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Satoru SATOH <ssato>
Component: ToolsAssignee: RHUI Bug List <rhui-bugs>
Status: CLOSED ERRATA QA Contact: Radek Bíba <rbiba>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.0.0CC: bizhang
Target Milestone: ---   
Target Release: 3.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-01 22:15:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The session log to show the bug
none
The proposed fix and the log to show it works (1)
none
The proposed fix and the log to show it works (2) (maybe it's safer than the previous one, I think.)
none
The session log to show the fix (1) works none

Description Satoru SATOH 2016-12-22 02:16:45 UTC
Created attachment 1234590 [details]
The session log to show the bug

Description of problem:
When viewing the details of the last repo sync with rhui-manager,
traceback log is displayed vertically and hard to read the traceback log
if some errors occurred during the sync.

Here is an example session log:

[root@rhua-3-1 ~]# umount /var/lib/rhui/remote_share/   # To cause sync error on purpose
[root@rhua-3-1 ~]# pulp-admin login -u admin -p ******************************
Successfully logged in. Session certificate will expire at Dec 28 11:06:40 2016 GMT.

[root@rhua-3-1 ~]# pulp-admin rpm repo sync  status --repo-id rhel-6-server-rhui-rpms-6Server-x86_64
+----------------------------------------------------------------------+
       Repository Status [rhel-6-server-rhui-rpms-6Server-x86_64]
+----------------------------------------------------------------------+

The repository is not performing any operations

[root@rhua-3-1 ~]# pulp-admin rpm repo sync run --bg --repo-id rhel-6-server-rhui-rpms-6Server-x86_64
+----------------------------------------------------------------------+
   Synchronizing Repository [rhel-6-server-rhui-rpms-6Server-x86_64]
+----------------------------------------------------------------------+

The request has been queued on the server.

[root@rhua-3-1 ~]# cat << EOF | rhui-manager
> s
> vr
> 1
> q
> EOF


------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Home =-

   r   manage repositories
   c   manage content delivery servers (CDS)
   l   manage HAProxy load-balancer instances
   s   synchronization status and scheduling
   e   create entitlement certificates and client configuration RPMs
   n   manage Red Hat entitlement certificates
   u   manage RHUI users

   logout
       removes stored authentication credentials and exits

   <   move to the previous screen
   ^, home
       move to the home screen
   /, clear
       clears the screen
   ?, help
       display help
   q, quit, exit
       exit

                                                Connected: rhua-3-1.example.jp
------------------------------------------------------------------------------

rhui (home) =>
------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Synchronization Status =-

   dr  display repo sync summary
   vr  view the details of the last repository sync
   sr  sync an individual repository immediately

                                                Connected: rhua-3-1.example.jp
------------------------------------------------------------------------------
rhui (sync) =>
Select a repository:
  1  - Red Hat Enterprise Linux 6 Server - Optional from RHUI (RPMs) (6Server-x86_64)
  2  - Red Hat Enterprise Linux 6 Server from RHUI (RPMs) (6Server-x86_64)
  3  - Red Hat Enterprise Linux 7 Server - Optional from RHUI (RPMs) (7Server-x86_64)

                                                Connected: rhua-3-1.example.jp
------------------------------------------------------------------------------
rhui (sync) =>
Select a repository:
  1  - Red Hat Enterprise Linux 6 Server - Optional from RHUI (RPMs) (6Server-x8
6_64)
  2  - Red Hat Enterprise Linux 6 Server from RHUI (RPMs) (6Server-x86_64)
  3  - Red Hat Enterprise Linux 7 Server - Optional from RHUI (RPMs) (7Server-x8
6_64)
  4  - Red Hat Enterprise Linux 7 Server from RHUI (RPMs) (7Server-x86_64)
Enter value (1-4) or 'b' to abort:
  Start Time:     12-21-2016 15:33
  Finish Time:    12-21-2016 15:34
  Elapsed Time:   0:01:34
  Result:         Success
  Traceback:
T
r
a
c
e
b
a
c
k

(
m
o
s
t

r
e
c
e
n
t

c
a
l
l

l
a
s
t
)
:




F
i
l
e

"
/
u
s
r
/
l
i
b
/
p
y
t
h
o
n
2
.
7
/
s
i
t
e
-
p
a
c
k
a
g
e
s
/
c
e
l
e
r
y
/
a
p
p
/
t
r
a
c
e
.
p
y
"
,

l
i
n
e

2
4
0
,

i
n

t
r
a
c
e
_
t
a
s
k






R

=

r
e
t
v
a
l

=

f
u
n
(
*
a
r
g
s
,

*
*
k
w
a
r
g
s
)




F
i
l
e

"
/
u
s
r
/
l
i
b
/
p
y
t
h
o
n
2
.
7
/
s
i
t
e
-
p
a
c
k
a
g
e
s
/
p
u
l
p
/
s
e
r
v
e
r
/
a
s
y
n
c
/
t
a
s
k
s
.
p
y
"
,

l
i
n
e

4
7
3
,

i
y
"
,

l
i
n
e

4
7
3
,

i
n

_
_
c
a
l
l
_
_






r
e
t
u
r
n

s
u
p
e
r
(
T
a
s
k
,

s
e
l
f
)
.
_
_
c
a
l
l
_
_
(
*
a
r
g
s
,

*
*
k
w
a
r
g
s
)




F
i
l
e

"
/
u
s
r
/
l
i
b
/
p
y
t
h
o
n
2
.
7
/
s
i
t
e
-
p
a
c
k
a
g
e
s
/
p
u
l
p
/
s
e
r
v
e
r
/
a
s
y
n
c
/
t
a
s
k
s
.
p
y
"
,

l
i
n
e

1
0
3
,

i
n

_
_
c
a
l
l
_
_






r
e
t
u
r
n

s
u
p
e
r
(
P
u
l
p
T
a
s
k
,


[root@rhua-3-1 ~]#



Version-Release number of selected component (if applicable):
3.0 Beta.1 and the latest snapshot (20161220)

How reproducible:
Always if some errors occurred during the sync


Steps to Reproduce:
1. Do something (e.g. umount /var/lib/rhui/remote_share/) causing the repo sync error later
2. Sync the repo, e.g. pulp-admin rpm repo sync run --bg --repo-id rhel-6-server-rhui-rpms-6Server-x86_64 or sync a repo with rhui-manager (s, sr, ...)
3. View the details of the repo sync

Actual results:
Traceback log is displayed vertically.


Expected results:
Traceback log is displayed as it is.


Additional info:
I'll attach a log to show the bug [1], a log to show a couple of possible
fixes [2][3] and a log to prove any of fixes resolve this issue [4].

The root cause is that the code try to join traceback log (item.traceback)
with '\n' although its type may not be [str] but str ([char]), I guess. 

[1] rhui-3_rhui-manager_traceback_on_repo_sync_status_details_0.txt
[2] rhui-3_rhui-manager_traceback_on_repo_sync_status_details_fix_1.txt
[3] rhui-3_rhui-manager_traceback_on_repo_sync_status_details_fix_2.txt
[4] rhui-3_rhui-manager_traceback_on_repo_sync_status_details_1.txt

Comment 1 Satoru SATOH 2016-12-22 02:17:38 UTC
Created attachment 1234591 [details]
The proposed fix and the log to show it works (1)

Comment 2 Satoru SATOH 2016-12-22 02:18:21 UTC
Created attachment 1234592 [details]
The proposed fix and the log to show it works (2) (maybe it's safer than the previous one, I think.)

Comment 3 Satoru SATOH 2016-12-22 02:18:53 UTC
Created attachment 1234593 [details]
The session log to show the fix (1) works

Comment 7 Radek Bíba 2017-01-18 09:36:26 UTC
A correctly formatted traceback is printed with ISO 20170117, RHEL 6 & 7. Thanks.

  Start Time:     01-18-2017 04:32
  Finish Time:    01-18-2017 04:33
  Elapsed Time:   0:00:08
  Result:         Success
  Traceback:      Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
<snip>
  File "/usr/lib64/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
ImporterConduitException: [Errno 13] Permission denied: '/var/lib/pulp/importers'

Comment 8 errata-xmlrpc 2017-03-01 22:15:05 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, 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-2017:0367