Project

General

Profile

Bug #45875

Fix traceback when creating iSCSI extent with wrong file path

Added by William Grzybowski almost 2 years ago. Updated almost 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
Waqar Ahmed
Category:
Middleware
Target version:
Seen in:
Severity:
Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

[2018/09/10 19:30:01] (WARNING) application.call_method():182 - Exception while calling iscsi.extent.create(*[{'name': 'Exchange', 'type': 'FILE', 'disk': '', 'serial': '2c59e54a957000', 'path': 'exchange', 'filesize': 4398046511104, 'blocksize': 512, 'pblocksize': False, 'avail_threshold': 90, 'comment': 'Volumen para Exchange', 'insecure_tpc': True, 'xen': False, 'rpm': 'SSD', 'ro': False}])
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 155, in call_method
    result = await self.middleware.call_method(self, message)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1033, in call_method
    return await self._call(message['method'], serviceobj, methodobj, params, app=app, io_thread=False)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 973, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.6/site-packages/middlewared/service.py", line 278, in create
    f'{self._config.namespace}.create', self, self.do_create, [data]
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 973, in _call
    return await methodobj(*args)
  File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 664, in nf
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/iscsi.py", line 405, in do_create
    await self.clean(data, 'iscsi_extent_create', verrors)
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/iscsi.py", line 527, in clean
    await self.clean_type_and_path(data, schema_name, verrors)
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/iscsi.py", line 586, in clean_type_and_path
    schema_name, path)
  File "/usr/local/lib/python3.6/site-packages/middlewared/async_validators.py", line 12, in check_path_resides_within_volume
    if not any(os.path.commonpath([parent]) == os.path.commonpath([parent, path]) for parent in vol_paths):
  File "/usr/local/lib/python3.6/site-packages/middlewared/async_validators.py", line 12, in <genexpr>
    if not any(os.path.commonpath([parent]) == os.path.commonpath([parent, path]) for parent in vol_paths):
  File "/usr/local/lib/python3.6/posixpath.py", line 507, in commonpath
    raise ValueError("Can't mix absolute and relative paths") from None
ValueError: Can't mix absolute and relative paths

Associated revisions

Revision 8e29fd5f (diff)
Added by Waqar Ahmed almost 2 years ago

Bug fix for validating paths This commit fixes a bug which resulted in a traceback when an incorrect path was specified to check_path_resides_within_volume async validator. An incorrect path is defined as a path which didn't start off with /mnt/. Ticket: #45875

History

#1 Updated by Waqar Ahmed almost 2 years ago

  • Status changed from Unscreened to In Progress

#2 Updated by Bug Clerk almost 2 years ago

  • Status changed from In Progress to Ready for Testing

#3 Updated by Dru Lavigne almost 2 years ago

  • Subject changed from Traceback when trying to create iscsi extent with wrong file path to Fix traceback when creating iSCSI extent with wrong file path
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#4 Updated by Bonnie Follweiler almost 2 years ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

#6 Updated by Dru Lavigne almost 2 years ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF