Project

General

Profile

Bug #32067

Fix error in jail.create call

Added by Lola Yang over 1 year ago. Updated over 1 year ago.

Status:
Done
Priority:
Important
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Severity:
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

There is an error returned by jail.create call.

payload:
```{"id":"076e1752-3e40-6e17-7521-b006b6e1b4f6","msg":"method","method":"jail.create","params":[{"uuid":"testjail","release":"11.1-RELEASE","props":[]}]}```

response:
```{"msg": "result", "id": "ccd16381-09ac-5cda-b5dc-994b6c8051e7", "error": {"error": 22, "type": null, "reason": "No module named 'jail'", "trace": {"class": "ModuleNotFoundError", "frames": [{"filename": "/usr/local/lib/python3.6/site-packages/middlewared/main.py", "lineno": 174, "method": "call_method", "line": " self.send_error(message, errno.EINVAL, str(e), sys.exc_info())\n", "argspec": ["self", "message"], "locals": {"e": "ModuleNotFoundError(\"No module named 'jail'\",)", "message": "{'id': 'ccd16381-09ac-5cda-b5dc-994b6c8051e7', 'msg': 'method', 'method': 'jail.create', 'params': [{'uuid': 'testjail', 'release': '11.1-RELEASE', 'props': []}]}", "self": "<middlewared.main.Application object at 0x81f520400>"}}, {"filename": "/usr/local/lib/python3.6/asyncio/coroutines.py", "lineno": 129, "method": "throw", "line": " return self.gen.throw(type, value, traceback)\n", "argspec": ["self", "type", "value", "traceback"], "locals": {"traceback": "None", "value": "None", "type": "ModuleNotFoundError(\"No module named 'jail'\",)", "self": "<CoroWrapper Middleware.call_method() done, defined at /usr/local/lib/python3.6/site-packages/middlewared/main.py:975, created at /usr/local/lib/python3.6/asyncio/coroutines.py:85>"}}, {"filename": "/usr/local/lib/python3.6/site-packages/middlewared/main.py", "lineno": 984, "method": "call_method", "line": " return await self._call(message['method'], serviceobj, methodobj, params, app=app)\n", "argspec": ["self", "app", "message"], "locals": {"methodobj": "<bound method CRUDService.create of <jail.JailService object at 0x818321470>>", "serviceobj": "<jail.JailService object at 0x818321470>", "params": "[{'uuid': 'testjail', 'release': '11.1-RELEASE', 'props': []}]", "message": "{'id': 'ccd16381-09ac-5cda-b5dc-994b6c8051e7', 'msg': 'method', 'method': 'jail.create', 'params': [{'uuid': 'testjail', 'release': '11.1-RELEASE', 'props': []}]}", "app": "<middlewared.main.Application object at 0x81f520400>", "self": "<middlewared.main.Middleware object at 0x80b053898>"}}, {"filename": "/usr/local/lib/python3.6/asyncio/coroutines.py", "lineno": 129, "method": "throw", "line": " return self.gen.throw(type, value, traceback)\n", "argspec": ["self", "type", "value", "traceback"], "locals": {"traceback": "None", "value": "None", "type": "ModuleNotFoundError(\"No module named 'jail'\",)", "self": "<CoroWrapper Middleware._call() done, defined at /usr/local/lib/python3.6/site-packages/middlewared/main.py:890, created at /usr/local/lib/python3.6/asyncio/coroutines.py:85>"}}, {"filename": "/usr/local/lib/python3.6/site-packages/middlewared/main.py", "lineno": 920, "method": "_call", "line": " return await self._call_worker(serviceobj, name, args)\n", "argspec": ["self", "name", "serviceobj", "methodobj", "params", "app", "pipes", "spawn_thread"], "locals": {"job": "None", "job_options": "None", "args": "[{'uuid': 'testjail', 'release': '11.1-RELEASE', 'props': []}]", "spawn_thread": "True", "pipes": "None", "app": "<middlewared.main.Application object at 0x81f520400>", "params": "[{'uuid': 'testjail', 'release': '11.1-RELEASE', 'props': []}]", "methodobj": "<bound method CRUDService.create of <jail.JailService object at 0x818321470>>", "serviceobj": "<jail.JailService object at 0x818321470>", "name": "'jail.create'", "self": "<middlewared.main.Middleware object at 0x80b053898>"}}, {"filename": "/usr/local/lib/python3.6/asyncio/coroutines.py", "lineno": 129, "method": "throw", "line": " return self.gen.throw(type, value, traceback)\n", "argspec": ["self", "type", "value", "traceback"], "locals": {"traceback": "None", "value": "None", "type": "ModuleNotFoundError(\"No module named 'jail'\",)", "self": "<CoroWrapper Middleware._call_worker() done, defined at /usr/local/lib/python3.6/site-packages/middlewared/main.py:940, created at /usr/local/lib/python3.6/asyncio/coroutines.py:85>"}}, {"filename": "/usr/local/lib/python3.6/site-packages/middlewared/main.py", "lineno": 948, "method": "_call_worker", "line": " job,\n", "argspec": ["self", "serviceobj", "name", "job"], "varargspec": "args", "locals": {"args": "('**',)", "job": "None", "name": "'jail.create'", "serviceobj": "<jail.JailService object at 0x818321470>", "self": "<middlewared.main.Middleware object at 0x80b053898>"}}, {"filename": "/usr/local/lib/python3.6/asyncio/coroutines.py", "lineno": 129, "method": "throw", "line": " return self.gen.throw(type, value, traceback)\n", "argspec": ["self", "type", "value", "traceback"], "locals": {"traceback": "None", "value": "None", "type": "ModuleNotFoundError(\"No module named 'jail'\",)", "self": "<CoroWrapper Middleware.run_in_proc() done, defined at /usr/local/lib/python3.6/site-packages/middlewared/main.py:877, created at /usr/local/lib/python3.6/asyncio/coroutines.py:85>"}}, {"filename": "/usr/local/lib/python3.6/site-packages/middlewared/main.py", "lineno": 878, "method": "run_in_proc", "line": " return await self.run_in_executor(self.__procpool, method, args, kwargs)\n", "argspec": ["self", "method"], "varargspec": "args", "keywordspec": "kwargs", "locals": {"kwargs": "{}", "args": "('', '***', '***', '***', '***')", "method": "<function main_worker at 0x80c5f87b8>", "self": "<middlewared.main.Middleware object at 0x80b053898>"}}, {"filename": "/usr/local/lib/python3.6/asyncio/coroutines.py", "lineno": 129, "method": "throw", "line": " return self.gen.throw(type, value, traceback)\n", "argspec": ["self", "type", "value", "traceback"], "locals": {"traceback": "None", "value": "None", "type": "ModuleNotFoundError(\"No module named 'jail'\",)", "self": "<CoroWrapper Middleware.run_in_executor() done, defined at /usr/local/lib/python3.6/site-packages/middlewared/main.py:864, created at /usr/local/lib/python3.6/asyncio/coroutines.py:85>"}}, {"filename": "/usr/local/lib/python3.6/site-packages/middlewared/main.py", "lineno": 872, "method": "run_in_executor", "line": " return await loop.run_in_executor(pool, functools.partial(method, args, kwargs))\n", "argspec": ["self", "pool", "method"], "varargspec": "args", "keywordspec": "kwargs", "locals": {"loop": "<_UnixSelectorEventLoop running=True closed=False debug=True>", "kwargs": "{}", "args": "('', '***', '***', '***', '***')", "method": "<function main_worker at 0x80c5f87b8>", "pool": "<middlewared.worker.ProcessPoolExecutor object at 0x80c6087b8>", "self": "<middlewared.main.Middleware object at 0x80b053898>"}}], "formatted": "concurrent.futures.process._RemoteTraceback: \n\"\"\"\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.6/concurrent/futures/process.py\", line 175, in process_worker\n r = call_item.fn(*call_item.args, **call_item.kwargs)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/worker.py\", line 116, in main_worker\n res = loop.run_until_complete(coro)\n File \"/usr/local/lib/python3.6/asyncio/base_events.py\", line 468, in run_until_complete\n return future.result()\n File \"/usr/local/lib/python3.6/site-packages/middlewared/worker.py\", line 75, in _call\n return methodobj(*args)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/worker.py\", line 73, in _call\n return await methodobj(*args)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/service.py\", line 250, in create\n f'{self._config.namespace}.create', self, self.do_create, [data]\n File \"/usr/local/lib/python3.6/site-packages/middlewared/worker.py\", line 75, in _call\n return methodobj(*args)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/worker.py\", line 65, in _call\n module = importlib.import_module(service_mod)\n File \"/usr/local/lib/python3.6/importlib/_init__.py\", line 126, in import_module\n return bootstrap._gcd_import(name[level:], package, level)\n File \"<frozen importlib._bootstrap>\", line 994, in _gcd_import\n File \"<frozen importlib._bootstrap>\", line 971, in _find_and_load\n File \"<frozen importlib._bootstrap>\", line 941, in _find_and_load_unlocked\n File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\n File \"<frozen importlib._bootstrap>\", line 994, in _gcd_import\n File \"<frozen importlib._bootstrap>\", line 971, in _find_and_load\n File \"<frozen importlib._bootstrap>\", line 953, in _find_and_load_unlocked\nModuleNotFoundError: No module named 'jail'\n\"\"\"\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.6/site-packages/middlewared/main.py\", line 151, in call_method\n result = await self.middleware.call_method(self, message)\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 129, in throw\n return self.gen.throw(type, value, traceback)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/main.py\", line 984, in call_method\n return await self._call(message['method'], serviceobj, methodobj, params, app=app)\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 129, in throw\n return self.gen.throw(type, value, traceback)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/main.py\", line 920, in _call\n return await self._call_worker(serviceobj, name, *args)\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 129, in throw\n return self.gen.throw(type, value, traceback)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/main.py\", line 948, in _call_worker\n job,\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 129, in throw\n return self.gen.throw(type, value, traceback)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/main.py\", line 878, in run_in_proc\n return await self.run_in_executor(self._procpool, method, *args, **kwargs)\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 129, in throw\n return self.gen.throw(type, value, traceback)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/main.py\", line 872, in run_in_executor\n return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))\nModuleNotFoundError: No module named 'jail'\n"}, "extra": null}}```


Related issues

Related to FreeNAS - Bug #31419: (New UI) Jails/Add: Update form to have automatically configured options displayed properlyDone2018-04-06

Associated revisions

Revision 4052134d (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared): make process worker function again for CRUD services

Ticket: #32067

Revision 869cb5bf (diff)
Added by William Grzybowski over 1 year ago

fix(middlewared): make process worker function again for CRUD services

Ticket: #32067

History

#1 Updated by Lola Yang over 1 year ago

  • Related to Bug #31419: (New UI) Jails/Add: Update form to have automatically configured options displayed properly added

#2 Updated by William Grzybowski over 1 year ago

  • Status changed from Unscreened to In Progress
  • Target version set to 11.2-BETA1
  • Seen in changed from 11.2-BETA1 to Master - FreeNAS Nightlies
  • Needs QA changed from Yes to No
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#3 Updated by Dru Lavigne over 1 year ago

  • Subject changed from jail.create call not works to Fix error in jail.create call
  • Status changed from In Progress to Done

Also available in: Atom PDF