ceph / ceph-iscsi

Ceph iSCSI tools
GNU General Public License v3.0
62 stars 59 forks source link

i got an error when use gwcli to create a rbd image #65

Open Allenscript opened 5 years ago

Allenscript commented 5 years ago

i test create rbd image in gwcli but i get this error. /disks> create pool=rbd image=rr size=100G Failed : disk create/update failed on node1. Unhandled exception: init() got an unexpected keyword argument 'control' my ceph cluster version is mimic 13.2.5 stable ceph-iscsi 3.0 wtih patch
https://github.com/ceph/ceph-iscsi/commit/e8550d74b5f01ae470cc03cb86dc14eb8890316d

my os version :3.10.0-957.1.3.el7.x86_64 ,centos 7.6.1810

dillaman commented 5 years ago

Initial guess is that your version of rtslib-fb is too old.

dillaman commented 5 years ago

... specifically it's missing this commit: https://github.com/open-iscsi/rtslib-fb/commit/9637223b9d8cee3abc527f58fc9e14a1bcbe4b29#diff-994836a456b8ff8e93d461b0e27b9adf

Allenscript commented 5 years ago

my rtslib-fb version is 2.1.fb69 i cat the tcm.py it patch that commit which you point

what others can i do ?

mikechristie commented 5 years ago

Can you attach the /var/log/rbd-target-api/rbd-target-api.log output for the node that hit the problem. In your example above it would be node1's rbd-target-api.log.

Allenscript commented 5 years ago

yes ,i get ther error log when i create the image , in fact ,it create success,but it can't add to lun.

1413 2019-04-12 09:15:46,908 DEBUG [lun.py:862:_add_dev_to_lio_user_rbd()] - control="hw_max_sectors=1024,max_data_area_mb=8" 1414 2019-04-12 09:15:46,908 ERROR [rbd-target-api:114:unhandled_exception()] - Unhandled Exception 1415 Traceback (most recent call last): 1416 File "/usr/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request 1417 rv = self.dispatch_request() 1418 File "/usr/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request 1419 return self.view_functionsrule.endpoint 1420 File "/usr/lib/python2.7/site-packages/ceph_iscsi-3.0-py2.7.egg/EGG-INFO/scripts/rbd-target-api", line 107, in decorated 1421 File "/usr/lib/python2.7/site-packages/ceph_iscsi-3.0-py2.7.egg/EGG-INFO/scripts/rbd-target-api", line 1162, in _disk 1422 File "build/bdist.linux-x86_64/egg/ceph_iscsi_config/lun.py", line 668, in allocate 1423 so = self.add_dev_to_lio() 1424 File "build/bdist.linux-x86_64/egg/ceph_iscsi_config/lun.py", line 836, in add_dev_to_lio 1425 new_lun = self._add_dev_to_lio_user_rbd(in_wwn) 1426 File "build/bdist.linux-x86_64/egg/ceph_iscsi_config/lun.py", line 881, in _add_dev_to_lio_user_rbd 1427 wwn=in_wwn, control=control_string) 1428 TypeError: init() got an unexpected keyword argument 'control' 1429 2019-04-12 09:15:46,911 INFO [_internal.py:87:_log()] - ::1 - - [12/Apr/2019 09:15:46] "PUT /api/_disk/cache/mm HTTP/1.1" 500 - 1430 2019-04-12 09:15:46,913 ERROR [rbd-target-api:2419:call_api()] - _disk change on localhost failed with 500 1431 2019-04-12 09:15:46,913 DEBUG [rbd-target-api:2441:call_api()] - failed on node1. Unhandled exception: init() got an unexpected keyword argument 'control' 1432 2019-04-12 09:15:46,914 INFO [_internal.py:87:_log()] - ::1 - - [12/Apr/2019 09:15:46] "PUT /api/disk/cache/mm HTTP/1.1" 500 -

mikechristie commented 5 years ago

That log output seems to confirm we are still missing that patch:

https://github.com/open-iscsi/rtslib-fb/commit/9637223b9d8cee3abc527f58fc9e14a1bcbe4b29#diff-994836a456b8ff8e93d461b0e27b9adf

referenced before.

Are you sure the rtslib with that patch is installed correctly? There is not some weird thing where you have multiple versions installed (maybe one in /usr/lib/python2.7/site-packages and one in /usr/lib/python3.6/site-packages) and are looking/using the wrong one?

Did you install rtslib using rpm one time but then used the upstream GH code another time and did not remove the rpm installed package?

Did you manually try to patch the code in /usr/lib/python*/site-packages and maybe did not remove the old tcm.pyc/tcm.pyo file so the old code is still being used?

mikechristie commented 5 years ago

Do you have a

/usr/lib/python/site-packages/rtslib-fb directory but then also have a /usr/lib/python/site-packages/rtslib-fb-2.1.fb69.egg or multiple rtslib .egg files?

Allenscript commented 5 years ago

yes , i hava /usr/lib/python2.7/site-packages/rtslib and rtslib_fb and rtslib_fb-2.1.fb69-py2.7.egg Is some thing wrong with tihs ?

mikechristie commented 5 years ago

Maybe. Did you install rtslib with rpm one time then install it by source using the "python setup.py install" command? The older one might be what is getting used so even if you are seeing a updated/patched tcm.py a older tcmy.py will be getting used.