1

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
=================================================================================
Updating:
 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

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

Complete!

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

backtrace:
: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
dule>
:    from ui_root import UIRoot
:  File "/usr/lib/python2.7/site-packages/targetcli/ui_root.py", line 25, in <mod
ule>
:    from ui_target import UIFabricModule
:  File "/usr/lib/python2.7/site-packages/targetcli/ui_target.py", line 24, in <m
odule>
:    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
sands
:    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

environ:
:USERNAME=root
:LANG=en_US.UTF-8
:TERM=xterm
:SHELL=/bin/bash
:SUDO_COMMAND=/bin/bash
:SHLVL=1
:HOSTNAME=controller
:SUDO_UID=1000
:SUDO_GID=1000
:HISTSIZE=1000
:HISTCONTROL=ignoredups
:PWD=/root
:LOGNAME=root
:USER=root
:MAIL=/var/spool/mail/root
:PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
:SUDO_USER=vagrant
:LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd
=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42
:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.
lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;3
1:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*
.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:
*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;3
1:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01
;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pg
m=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:
*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01
;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m
4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:
*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;3
5:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01
;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid
=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.
wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
:HOME=/root
:LESSOPEN=||/usr/bin/lesspipe.sh %s
:_=/bin/targetcli

os_info:
:NAME="CentOS Linux"
:VERSION="7 (Core)"
:ID="centos"
:ID_LIKE="rhel fedora"
:VERSION_ID="7"
:PRETTY_NAME="CentOS Linux 7 (Core)"
:ANSI_COLOR="0;31"
:CPE_NAME="cpe:/o:centos:centos:7"
:HOME_URL="https://www.centos.org/"
:BUG_REPORT_URL="https://bugs.centos.org/"
:

&

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

2

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

yum remove targetcli
yum update
yum install targetcli
1
  • 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
0

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

1) I would install easy_install

https://pypi.python.org/pypi/setuptools#downloads)

2) Get the parsing module with easy_install py-parsing

0

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

http://rpm.pbone.net/index.php3/stat/4/idpl/26647205/dir/centos_7/com/targetcli-2.1.fb34-1.el7.noarch.rpm.html

Hoping that the above link will help you.

-2

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

2
  • 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
-3

execute below commend it will resolve

yum install  python-six  python
1
  • 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 .