Project

General

Profile

Bug #35128

Fix traceback caused by attribute name change in iocage

Added by Waqar Ahmed about 1 year ago. Updated about 1 year ago.

Status:
Done
Priority:
No priority
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Severity:
Low 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

While writing tests for Jails I came across the following traceback for exec call.
```[2018/06/17 21:29:32] (ERROR) aiohttp.server.log_exception():307 - Error handling request
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/local/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 119, in main_worker
res = loop.run_until_complete(coro)
File "/usr/local/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
return future.result()
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 79, in _run
return await self._call(f'{service_name}.{method}', serviceobj, methodobj, params=args, job=job)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 72, in _call
return methodobj(*params)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 72, in _call
return methodobj(*params)
File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 650, in nf
return f(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 393, in exec
msg = iocage.exec(command, host_user, jail_user, return_msg=True)
TypeError: exec() got an unexpected keyword argument 'return_msg'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 378, in start
resp = await self._request_handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 341, in handle
resp = await handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 88, in impl
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 78, in impl
return await handler(request)
File "/usr/local/lib/python3.6/site-packages/middlewared/restful.py", line 365, in on_method
return await do(method, req, resp, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/restful.py", line 504, in do
result = await self.middleware.call(methodname, *method_args)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1017, in call
return await self._call(name, serviceobj, methodobj, params, pipes=pipes)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 950, in _call
return await self._call_worker(serviceobj, name, *args)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 977, in _call_worker
job,
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 908, in run_in_proc
return await self.run_in_executor(self.
_procpool, method, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 902, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
TypeError: exec() got an unexpected keyword argument 'return_msg'```

The payload which I used while making this call was ``` payload = {
'jail': 'jail1',
'command': ['echo "Exec successful"']
}```

Kindly do let me know if this would've been a fault on my end while making the call.


Related issues

Related to FreeNAS - Bug #34870: Add APIv2 tests for JailsDone

Associated revisions

Revision 5a34f440 (diff)
Added by Brandon Schneider about 1 year ago

fix(jail/exec): Attribute name changed upstream, additional improvements

Fix a potential oddity if the user supplies a nested list.
Ticket: #35128

Revision f9ef293c (diff)
Added by Brandon Schneider about 1 year ago

fix(jail/exec): Attribute name changed upstream, additional improvements (#1393)

Fix a potential oddity if the user supplies a nested list.
Ticket: #35128

Revision 34995337 (diff)
Added by Brandon Schneider about 1 year ago

fix(jail/exec): Attribute name changed upstream, additional improvements (#1393)

Fix a potential oddity if the user supplies a nested list.
Ticket: #35128

History

#1 Updated by Dru Lavigne about 1 year ago

  • Related to Bug #34870: Add APIv2 tests for Jails added

#2 Updated by Brandon Schneider about 1 year ago

  • Status changed from Unscreened to Not Started

#3 Updated by Brandon Schneider about 1 year ago

  • Status changed from Not Started to In Progress

#4 Updated by Brandon Schneider about 1 year ago

  • Severity changed from New to Low Medium

#5 Updated by Brandon Schneider about 1 year ago

#6 Updated by Brandon Schneider about 1 year ago

  • Status changed from In Progress to Ready for Testing
  • Needs Merging changed from Yes to No

#7 Updated by Dru Lavigne about 1 year ago

  • Subject changed from Exception when making exec call in Jails Middlewared to Fix traceback caused by attribute name change in iocage
  • Target version changed from 11.2-RC2 to 11.2-BETA1
  • Needs Doc changed from Yes to No

#8 Updated by Rishabh Chauhan about 1 year ago

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

it responded like a gentleman to an exec call-
midclt call jail.exec 'jail35128' '["whoami"]'
root

#9 Updated by Dru Lavigne about 1 year ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF