Bug #52641
closedsnap scheduler: Traceback seen when snapshot schedule remove command is passed without required parameters
0%
Description
- ceph fs snap-schedule remove
Error EINVAL: Traceback (most recent call last):
File "/usr/share/ceph/mgr/mgr_module.py", line 1347, in _handle_command
return CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf)
File "/usr/share/ceph/mgr/mgr_module.py", line 390, in call
return self.func(mgr, **kwargs)
File "/usr/share/ceph/mgr/snap_schedule/module.py", line 150, in snap_schedule_rm
self.client.rm_snap_schedule(use_fs, abs_path, repeat, start)
File "/usr/share/ceph/mgr/snap_schedule/fs/schedule_client.py", line 51, in f
func(self, fs, schedule_or_path, *args)
File "/usr/share/ceph/mgr/snap_schedule/fs/schedule_client.py", line 271, in rm_snap_schedule
Schedule.rm_schedule(db, path, schedule, start)
File "/usr/share/ceph/mgr/snap_schedule/fs/schedule.py", line 278, in rm_schedule
if len(row) == 0:
TypeError: object of type 'NoneType' has no len()
Actual results:
----------------
Seeing Traceback error when required parameters are not provided.
Expected results:
------------------
Should warn the user with the missing parameters with the options required to pass.
Updated by Patrick Donnelly over 2 years ago
- Status changed from New to Triaged
- Assignee set to Milind Changire
Updated by Venky Shankar about 2 years ago
- Assignee changed from Milind Changire to Nikhilkumar Shelke
Nikhil, please take a look.
Updated by Nikhilkumar Shelke about 2 years ago
Tried command provided in tracker. Not seen any Traceback if command is passed without required parameters
[nshelke@fedora build]$ ./bin/ceph fs snap-schedule remove
DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH
2022-02-15T10:20:05.782+0530 7f1d438dc640 -1 WARNING: all dangerous and experimental features are enabled.
2022-02-15T10:20:05.788+0530 7f1d438dc640 -1 WARNING: all dangerous and experimental features are enabled.
Invalid command: missing required parameter path(<string>)
fs snap-schedule remove <path> [<repeat>] [<start>] [<subvol>] [<fs>] : Remove a snapshot schedule for <path>
Error EINVAL: invalid command
Updated by Nikhilkumar Shelke about 2 years ago
Also tried to reproduce issue after adding snap-schedule. Still no traceback observed.
[nshelke@fedora build]$ ./bin/ceph fs snap-schedule add / 1h
DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH
2022-02-15T10:40:32.091+0530 7fd34f4f5640 -1 WARNING: all dangerous and experimental features are enabled.
2022-02-15T10:40:32.099+0530 7fd34f4f5640 -1 WARNING: all dangerous and experimental features are enabled.
Schedule set for path /
[nshelke@fedora build]$ ./bin/ceph fs snap-schedule list /
DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH
2022-02-15T10:40:38.243+0530 7f926aab9640 -1 WARNING: all dangerous and experimental features are enabled.
2022-02-15T10:40:38.250+0530 7f926aab9640 -1 WARNING: all dangerous and experimental features are enabled.
/ 1h
[nshelke@fedora build]$ ./bin/ceph fs snap-schedule status
DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH
2022-02-15T10:40:46.004+0530 7f9083d30640 -1 WARNING: all dangerous and experimental features are enabled.
2022-02-15T10:40:46.010+0530 7f9083d30640 -1 WARNING: all dangerous and experimental features are enabled.
{"fs": "a", "subvol": null, "path": "/", "rel_path": "/", "schedule": "1h", "retention": {}, "start": "2022-02-15T00:00:00", "created": "2022-02-15T05:10:32", "first": null, "last": null, "last_pruned": null, "created_count": 0, "pruned_count": 0, "active": true}
[nshelke@fedora build]$ ./bin/ceph fs snap-schedule remove
DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH
2022-02-15T10:42:48.077+0530 7fa42543e640 -1 WARNING: all dangerous and experimental features are enabled.
2022-02-15T10:42:48.083+0530 7fa42543e640 -1 WARNING: all dangerous and experimental features are enabled.
Invalid command: missing required parameter path(<string>)
fs snap-schedule remove <path> [<repeat>] [<start>] [<subvol>] [<fs>] : Remove a snapshot schedule for <path>
Error EINVAL: invalid command
Updated by Nikhilkumar Shelke about 2 years ago
- Status changed from Triaged to Resolved