Targetcli is able to run

[root@controller ~]# targetcli
targetcli shell version 2.1.fb34
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/> exit
Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json

After an update

[root@controller ~]# yum update targetcli -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.nluug.nl
 * epel: ftp.nluug.nl
 * extras: ftp.nluug.nl
 * updates: ftp.nluug.nl
Resolving Dependencies
--> Running transaction check
---> Package targetcli.noarch 0:2.1.fb34-1.el7 will be updated
---> Package targetcli.noarch 0:2.1.fb37-3.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

 Package            Arch            Version                  Repository     Size
 targetcli          noarch          2.1.fb37-3.el7           base           56 k

Transaction Summary
Upgrade  1 Package

Total download size: 56 k
Downloading packages:
No Presto metadata available for base
targetcli-2.1.fb37-3.el7.noarch.rpm                       |  56 kB  00:00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : targetcli-2.1.fb37-3.el7.noarch                               1/2
  Cleanup    : targetcli-2.1.fb34-1.el7.noarch                               2/2
  Verifying  : targetcli-2.1.fb37-3.el7.noarch                               1/2
  Verifying  : targetcli-2.1.fb34-1.el7.noarch                               2/2

  targetcli.noarch 0:2.1.fb37-3.el7


it does not start anymore

[root@controller ~]# targetcli
Traceback (most recent call last):
  File "/bin/targetcli", line 24, in <module>
    from targetcli import UIRoot
  File "/usr/lib/python2.7/site-packages/targetcli/__init__.py", line 18, in <module>
    from ui_root import UIRoot
  File "/usr/lib/python2.7/site-packages/targetcli/ui_root.py", line 25, in <module>
    from ui_target import UIFabricModule
  File "/usr/lib/python2.7/site-packages/targetcli/ui_target.py", line 24, in <module>
    from rtslib import Target, TPG, LUN, StorageObjectFactory
ImportError: cannot import name StorageObjectFactory

an email has been received once returned has been entered

[root@controller ~]#
You have mail in /var/spool/mail/root

the mail indicates that

[root@controller ~]# mail
Heirloom Mail version 12.5 7/5/10.  Type ? for help.
"/var/spool/mail/root": 1 message 1 new
>N  1 [email protected]  Sat Jun 20 12:24 223/10885 "[abrt] full crash repo"
& 1
Message  1:
From [email protected]  Sat Jun 20 12:24:47 2015
Return-Path: <[email protected]>
X-Original-To: root@localhost
Delivered-To: [email protected]
Date: Sat, 20 Jun 2015 12:24:47 +0000
From: [email protected]
To: [email protected]
Subject: [abrt] full crash report
User-Agent: Heirloom mailx 12.5 7/5/10
Content-Type: text/plain; charset=us-ascii
Status: R

abrt_version:   2.1.11
cmdline:        /usr/bin/python /bin/targetcli
executable:     /bin/targetcli
hostname:       controller
kernel:         3.10.0-123.el7.x86_64
last_occurrence: 1434803085
pid:            6839
pkg_arch:       noarch
pkg_epoch:      0
pkg_name:       targetcli
pkg_release:    3.el7
pkg_version:    2.1.fb37
runlevel:       unknown
time:           Sat 20 Jun 2015 12:24:45 PM UTC
uid:            0
username:       root

:ui_target.py:24:<module>:ImportError: cannot import name StorageObjectFactory
:Traceback (most recent call last):
:  File "/bin/targetcli", line 24, in <module>
:    from targetcli import UIRoot
:  File "/usr/lib/python2.7/site-packages/targetcli/__init__.py", line 18, in <mo
:    from ui_root import UIRoot
:  File "/usr/lib/python2.7/site-packages/targetcli/ui_root.py", line 25, in <mod
:    from ui_target import UIFabricModule
:  File "/usr/lib/python2.7/site-packages/targetcli/ui_target.py", line 24, in <m
:    from rtslib import Target, TPG, LUN, StorageObjectFactory
:ImportError: cannot import name StorageObjectFactory
:Local variables in innermost frame:
:TPG: None
:RTSLibBrokenLink: None
:Target: None
:NodeACL: None
:__builtins__: {'bytearray': <type 'bytearray'>, 'IndexError': <type 'exceptions.
IndexError'>, 'all': <built-in function all>, 'help': Type help() for interactive
 help, or help(object) for help about object., 'vars': <built-in function vars>,
'SyntaxError': <type 'exceptions.SyntaxError'>, 'unicode': <type 'unicode'>, 'Uni
codeDecodeError': <type 'exceptions.UnicodeDecodeError'>, 'memoryview': <type 'me
moryview'>, 'isinstance': <built-in function isinstance>, 'copyright': Copyright
(c) 2001-2013 Python Software Foundation.
:All Rights Reserved.
:Copyright (c) 2000 BeOpen.com.
:All Rights Reserved.
:Copyright (c) 1995-2001 Corporation for National Research Initiatives.
:All Rights Reserved.
:Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
:All Rights Reserved., 'NameError': <type 'exceptions.NameError'>, 'BytesWarning'
: <type 'exceptions.BytesWarning'>, 'dict': <type 'dict'>, 'input': <built-in fun
ction input>, 'oct': <built-in function oct>, 'bin': <built-in function bin>, 'Sy
stemExit': <type 'exceptions.SystemExit'>, 'StandardError': <type 'exceptions.Sta
ndardError'>, 'format': <built-in function format>, 'repr': <built-in function re
pr>, 'sorted': <built-in function sorted>, 'False': False, 'RuntimeWarning': <typ
e 'exceptions.RuntimeWarning'>, 'list': <type 'list'>, 'iter': <built-in function
 iter>, 'reload': <built-in function reload>, 'Warning': <type 'exceptions.Warnin
g'>, '__package__': None, 'round': <built-in function round>, 'dir': <built-in fu
nction dir>, 'cmp': <built-in function cmp>, 'set': <type 'set'>, 'bytes': <type
'str'>, 'reduce': <built-in function reduce>, 'intern': <built-in function intern
>, 'issubclass': <built-in function issubclass>, 'Ellipsis': Ellipsis, 'EOFError'
: <type 'exceptions.EOFError'>, 'locals': <built-in function locals>, 'BufferErro
r': <type 'exceptions.BufferError'>, 'slice': <type 'slice'>, 'FloatingPointError
': <type 'exceptions.FloatingPointError'>, 'sum': <built-in function sum>, 'getat
tr': <built-in function getattr>, 'abs': <built-in function abs>, 'exit': Use exi
t() or Ctrl-D (i.e. EOF) to exit, 'print': <built-in function print>, 'True': Tru
e, 'FutureWarning': <type 'exceptions.FutureWarning'>, 'ImportWarning': <type 'ex
ceptions.ImportWarning'>, 'None': None, 'hash': <built-in function hash>, 'Refere
nceError': <type 'exceptions.ReferenceError'>, 'len': <built-in function len>, 'c
redits':     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thou
:    for supporting Python development.  See www.python.org for more information.
, 'frozenset': <type 'frozenset'>, '__name__': '__builtin__', 'ord': <built-in fu
nction ord>, 'super': <type 'super'>, 'TypeError': <type 'exceptions.TypeError'>,
 'license': See http://www.python.org/2.7/license.html, 'KeyboardInterrupt': <typ
e 'exceptions.KeyboardInterrupt'>, 'UserWarning': <type 'exceptions.UserWarning'>
, 'filter': <built-in function filter>, 'range': <built-in function range>, 'stat
icmethod': <type 'staticmethod'>, 'SystemError': <type 'exceptions.SystemError'>,
 'BaseException': <type 'exceptions.BaseException'>, 'pow': <built-in function po
w>, 'RuntimeError': <type 'exceptions.RuntimeError'>, 'float': <type 'float'>, 'M
emoryError': <type 'exceptions.MemoryError'>, 'StopIteration': <type 'exceptions.
StopIteration'>, 'globals': <built-in function globals>, 'divmod': <built-in func
tion divmod>, 'enumerate': <type 'enumerate'>, 'apply': <built-in function apply>
, 'LookupError': <type 'exceptions.LookupError'>, 'open': <built-in function open
>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'basestring': <type 'basestri
ng'>, 'UnicodeError': <type 'exceptions.UnicodeError'>, 'zip': <built-in function
 zip>, 'hex': <built-in function hex>, 'long': <type 'long'>, 'next': <built-in f
unction next>, 'ImportError': <type 'exceptions.ImportError'>, 'chr': <built-in f
unction chr>, 'xrange': <type 'xrange'>, 'type': <type 'type'>, '__doc__': "Built
-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' ob
ject; Ellipsis represents `...' in slices.", 'Exception': <type 'exceptions.Excep
tion'>, 'tuple': <type 'tuple'>, 'UnicodeTranslateError': <type 'exceptions.Unico
deTranslateError'>, 'reversed': <type 'reversed'>, 'UnicodeEncodeError': <type 'e
xceptions.UnicodeEncodeError'>, 'IOError': <type 'exceptions.IOError'>, 'hasattr'
: <built-in function hasattr>, 'delattr': <built-in function delattr>, 'setattr':
 <built-in function setattr>, 'raw_input': <built-in function raw_input>, 'Syntax
Warning': <type 'exceptions.SyntaxWarning'>, 'compile': <built-in function compil
e>, 'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'str': <type 'str'>,
'property': <type 'property'>, 'GeneratorExit': <type 'exceptions.GeneratorExit'>
, 'int': <type 'int'>, '__import__': <built-in function __import__>, 'KeyError':
<type 'exceptions.KeyError'>, 'coerce': <built-in function coerce>, 'PendingDepre
cationWarning': <type 'exceptions.PendingDeprecationWarning'>, 'file': <type 'fil
e'>, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, 'unichr': <built-i
n function unichr>, 'id': <built-in function id>, 'OSError': <type 'exceptions.OS
Error'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'min': <bu
ilt-in function min>, 'UnicodeWarning': <type 'exceptions.UnicodeWarning'>, 'exec
file': <built-in function execfile>, 'any': <built-in function any>, 'complex': <
type 'complex'>, 'bool': <type 'bool'>, 'ValueError': <type 'exceptions.ValueErro
r'>, 'NotImplemented': NotImplemented, 'map': <built-in function map>, 'buffer':
<type 'buffer'>, 'max': <built-in function max>, 'object': <type 'object'>, 'TabE
rror': <type 'exceptions.TabError'>, 'callable': <built-in function callable>, 'Z
eroDivisionError': <type 'exceptions.ZeroDivisionError'>, 'eval': <built-in funct
ion eval>, '__debug__': True, 'IndentationError': <type 'exceptions.IndentationEr
ror'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'classmethod': <type
 'classmethod'>, 'UnboundLocalError': <type 'exceptions.UnboundLocalError'>, 'Not
ImplementedError': <type 'exceptions.NotImplementedError'>, 'AttributeError': <ty
pe 'exceptions.AttributeError'>, 'OverflowError': <type 'exceptions.OverflowError
:UIRTSLibNode: None
:__file__: None
:UINode: None
:__package__: None
:complete_path: None
:NetworkPortal: None
:LUN: None
:__name__: None
:RTSLibError: None
:__doc__: None
:utils: None
:MappedLUN: None

:LESSOPEN=||/usr/bin/lesspipe.sh %s

:NAME="CentOS Linux"
:VERSION="7 (Core)"
:ID_LIKE="rhel fedora"
:PRETTY_NAME="CentOS Linux 7 (Core)"


I thought that it is perhaps a bug. I have Googled but did not find anything. I decided to downgrade the package, but that does not seem to be possible.

[root@controller ~]# yum downgrade targetcli
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.nluug.nl
 * epel: ftp.nluug.nl
 * extras: ftp.nluug.nl
 * updates: ftp.nluug.nl
Nothing to do

Now I am really worried because I cannot access the iSCSI target anymore. How to fix the issue or downgrade the package so I can access the iSCSI again?

5 Answers 5


Hello I had the same problem, The following steps resolved it.

yum remove targetcli
yum update
yum install targetcli
  • This actually solved the issue for me (the newest version of targetcli is not affected by this problem). Note that you don't need to remove + install targetcli; a simple yum update will suffice.
    – dr_
    Dec 3, 2017 at 19:40

Having exactly the same problem I found the solution was installing the py-parsing module.

1) I would install easy_install


2) Get the parsing module with easy_install py-parsing


I had the same problem. The problem may be with the version, please check the version

[root@linux ~]# rpm -qi targetcli | grep -i version
Version     : 2.1.fb41

The fb41 describes the version is 41.

[root@linux ~]# yum -y remove targetcli
[root@linux ~]# wget -c ftp://bo.mirror.garr.it/1/slc/centos/7.1.1503/os/x86_64/Packages/targetcli-2.1.fb37-3.el7.noarch.rpm
[root@linux ~]# yum install targetcli-2.1.fb37-3.el7.noarch.rpm
[root@linux ~]# targetcli


Hoping that the above link will help you.


Install python-rtslib and try again. It resolved this issue in my CentOS 7 machine.

  • rtslib is obiously already installed, otherwise the OP would get a different error. Just installing will not work, upgrading or downgrading might be necessary and it is unclear how the OP should do that from your answer.
    – Anthon
    Aug 6, 2015 at 14:39
  • But rtslib may not be up to date, since the update was just done on targetcli. Make sure rtslib and configshell are up to date, and that py-parsing is installed.
    – Lee-Man
    Jun 10, 2016 at 17:54

execute below commend it will resolve

yum install  python-six  python
  • It's highly unlikely that this problem is related to differences between Python 2 and Python 3. You should include explanation for your code. In general, describing how and why certain commands or code solves a problem is more useful as it helps the OP and other readers to solve this and similar issues themselves. Sep 7, 2016 at 11:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .