Python3 - KeyError: 'pool' when 'refresh' is invoked
- Dominant language
- Python
- Stars
- 68
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Description
Hey Guys,
Creating a disk in `gwcli` succeeds with `ok` but then nosedives with a 'KeyError: pool'.
```
/disks> create rbd/esxi 100G
user provided pool/image format request
CMD: /disks/ create pool=rbd image=esxi size=100G count=1
pool 'rbd' is ok to use
Creating/mapping disk rbd/esxi
Issuing disk create request
- LUN(s) ready on all gateways
ok
Updating UI for the new disk(s)
Traceback (most recent call last):
File "/usr/local/bin/gwcli", line 4, in
__import__('pkg_resources').run_script('ceph-iscsi==3.0', 'gwcli')
File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1453, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/EGG-INFO/scripts/gwcli", line 194, in
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/EGG-INFO/scripts/gwcli", line 125, in main
File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 905, in run_interactive
self._cli_loop()
File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 734, in _cli_loop
self.run_cmdline(cmdline)
File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 848, in run_cmdline
self._execute_command(path, command, pparams, kparams)
File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 823, in _execute_command
result = target.execute_command(command, pparams, kparams)
File "/usr/lib/python3.7/site-packages/configshell_fb/node.py", line 1406, in execute_command
return method(*pparams, **kparams)
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/gwcli/storage.py", line 261, in ui_command_create
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/gwcli/storage.py", line 355, in create_disk
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/gwcli/storage.py", line 601, in __init__
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/gwcli/storage.py", line 605, in refresh
KeyError: 'pool'
```
The odd thing is that from that point on invoking `gwcli` immediately crashes with the same error.
```
[root@ceph-igw01 ~]# gwcli -d
Adding ceph cluster 'ceph' to the UI
Fetching ceph osd information
Querying ceph for state information
Refreshing disk information from the config object
- Scanning will use 8 scan threads
- rbd image scan complete: 0s
Traceback (most recent call last):
File "/usr/local/bin/gwcli", line 4, in
__import__('pkg_resources').run_script('ceph-iscsi==3.0', 'gwcli')
File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1453, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/EGG-INFO/scripts/gwcli", line 194, in
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/EGG-INFO/scripts/gwcli", line 105, in main
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/gwcli/gateway.py", line 65, in refresh
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/gwcli/storage.py", line 139, in refresh
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/gwcli/storage.py", line 601, in __init__
File "/usr/local/lib/python3.7/site-packages/ceph_iscsi-3.0-py3.7.egg/gwcli/storage.py", line 605, in refresh
KeyError: 'pool'
```
It's only fixable by completely destroying the pool and starting over.
Another snag I hit with python3 is the systemd files:
```
python3 setup.py install
```
installs the binaries under /usr/local/bin but the provides systemd units invoke binaries in /usr/bin. It's an easy manual fix just wanted to let you know
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with gwcli/storage.py at the refresh path around the reported KeyError, then trace the call from gwcli/gateway.py. Reproduce the disk creation and subsequent gwcli startup, and inspect the installed systemd units alongside the setup.py install location. Done means the refresh no longer crashes after creation and the units invoke the installed binaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100