Project

General

Profile

Bug #56781

Changing UUID of plugin jail causes CallError

Added by Daniel Griswold almost 3 years ago. Updated almost 3 years ago.

Status:
Done
Priority:
No priority
Assignee:
Brandon Schneider
Category:
Middleware
Seen in:
Severity:
New
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

When attempting to rename transmission to transmission_1 or subsonic to subsonic_1 a CallError is returned.

report_problem CallError
[EFAULT] No settings.json exists in /mnt/disk1/iocage/jails/subsonic/plugin!

remove_circle_outline More info...

Error: concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_json.py", line 1348, in json_plugin_load
with open(f"{self.location}/plugin/settings.json", "r") as \
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/disk1/iocage/jails/subsonic/plugin/settings.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 240, in do_update
iocage.set(p, plugin)
File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 1377, in set
iocjson.json_plugin_set_value(_prop)
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_json.py", line 1416, in json_plugin_set_value
settings = self.json_plugin_load()
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_json.py", line 1360, in json_plugin_load
silent=self.silent)
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_common.py", line 81, in logit
_callback(content, exception)
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_common.py", line 64, in callback
raise callback_exception(message)
RuntimeError: No settings.json exists in /mnt/disk1/iocage/jails/subsonic/plugin!

During handling of the above exception, another exception occurred:

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 122, 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 82, 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 75, in _call
return methodobj(*params)
File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
return methodobj(*params)
File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 668, in nf
return f(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 242, in do_update
raise CallError(err)
middlewared.service_exception.CallError: [EFAULT] No settings.json exists in /mnt/disk1/iocage/jails/subsonic/plugin!
"""

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

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 161, in call_method
result = await self.middleware.call_method(self, message)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1043, 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 980, in call
return await self._call_worker(serviceobj, name, *args)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1007, in _call_worker
job,
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 938, 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 923, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
middlewared.service_exception.CallError: [EFAULT] No settings.json exists in /mnt/disk1/iocage/jails/subsonic/plugin!


Related issues

Related to FreeNAS - Bug #57492: Fix incorrect middleware usage when editing a jail's properties in the new UIDone
Copied to FreeNAS - Bug #57555: Do not allow changing UUID of iocage plugin jail Done

Associated revisions

Revision f96cc256 (diff)
Added by Brandon Schneider almost 3 years ago

fix(jail/do_update): Throw validation error if plugin and rename are set The plugin bool for options is meant to be used only for setting plugin properties. Those exposed by the settings.json of the plugin. Trying to rename and set those will fail as the new location does not exist. We shouldn't allow this behavior. The UI also needs a ticket to not send plugin = True when calling do_update until it implements setting plugin properties. Ticket: #56781

Revision 03c9fbb8 (diff)
Added by Brandon Schneider almost 3 years ago

fix(jail/do_update): Throw validation error if plugin and rename are set (#2087) The plugin bool for options is meant to be used only for setting plugin properties. Those exposed by the settings.json of the plugin. Trying to rename and set those will fail as the new location does not exist. We shouldn't allow this behavior. The UI also needs a ticket to not send plugin = True when calling do_update until it implements setting plugin properties. Ticket: #56781

Revision eb6e9577 (diff)
Added by Brandon Schneider almost 3 years ago

fix(jail/do_update): Throw validation error if plugin and rename are set The plugin bool for options is meant to be used only for setting plugin properties. Those exposed by the settings.json of the plugin. Trying to rename and set those will fail as the new location does not exist. We shouldn't allow this behavior. The UI also needs a ticket to not send plugin = True when calling do_update until it implements setting plugin properties. Ticket: #56781 (cherry picked from commit f96cc2568db42cda8dbc6f0989c11ecaaeac144e)

Revision 09107982 (diff)
Added by Bug Clerk almost 3 years ago

fix(jail/do_update): Throw validation error if plugin and rename are set (#2091) The plugin bool for options is meant to be used only for setting plugin properties. Those exposed by the settings.json of the plugin. Trying to rename and set those will fail as the new location does not exist. We shouldn't allow this behavior. The UI also needs a ticket to not send plugin = True when calling do_update until it implements setting plugin properties. Ticket: #56781 (cherry picked from commit f96cc2568db42cda8dbc6f0989c11ecaaeac144e)

History

#1 Updated by Daniel Griswold almost 3 years ago

  • Subject changed from Changing UUID of jail causes CallError to Changing UUID of plugin jail causes CallError

Tested with a standard BSD jail and rename works correctly. Seems to only affect jails created by a plugin.

#2 Updated by Dru Lavigne almost 3 years ago

  • Category changed from GUI (new) to Hardware
  • Assignee changed from Release Council to William Grzybowski

#3 Updated by William Grzybowski almost 3 years ago

  • Category changed from Hardware to Middleware
  • Assignee changed from William Grzybowski to Brandon Schneider
  • Target version changed from Backlog to 11.2-U2

Brancon, seems like a fallout from the warden migrated jails?

#4 Updated by Brandon Schneider almost 3 years ago

  • Status changed from Unscreened to Not Started

Hmm seems like a stale variable. Shouldn’t be the case.

#5 Updated by Brandon Schneider almost 3 years ago

  • Status changed from Not Started to Blocked
  • Reason for Blocked set to Need additional information from Author

Daniel: I cannot replicate this via the CLI or the GUI. Can you try these steps below?

root@freenas[~]# iocage fetch -P -n transmission -r 11.2-RELEASE dhcp=on bpf=yes vnet=on
Plugin: Transmission
  Official Plugin: True     
  Using RELEASE: 11.2-RELEASE                                                                                                     
  Using Branch: 11.2-RELEASE
  Post-install Artifact: https://github.com/freenas/iocage-plugin-transmission.git
-- snip --

Admin Portal:
http://192.168.122.28:9091

root@freenas[~]# iocage rename transmission transmission_1
Jail: transmission renamed to transmission_1

Does the same work for you on the CLI?

#6 Updated by Daniel Griswold almost 3 years ago

I started by deleting all of the transmission jails using the new UI. (I had three)

I do have em0 and em1 aggregated to lagg0. FreeNAS has a static IP on vlan100 using lagg0 as the parent. The jails have static IPs configured on vlan256. The copy/paste from your message didn't work. I did rework the iocage fetch and included both outputs.

root@freenas[~]# iocage fetch -P -n transmission -r 11.2-RELEASE dhcp=on bpf=yes vnet=on
Plugin: Transmission
  Official Plugin: True
  Using RELEASE: 11.2-RELEASE
  Using Branch: 11.2-RELEASE
  Post-install Artifact: https://github.com/freenas/iocage-plugin-transmission.git
  These pkgs will be installed:
    - net-p2p/transmission-daemon
    - www/transmission-web

Stopped transmission due to VNET failure
Exception: SystemExit:1 occured, destroyed transmission.
root@freenas[~]#

I modified the command to generate the jail for my network. The jail created and renamed properly from the CLI.

root@freenas[~]# iocage fetch -P -n transmission -r 11.2-RELEASE ip4_addr="vlan256|192.168.2.251/27" defaultrouter="192.168.2.225" 
Plugin: Transmission
  Official Plugin: True
  Using RELEASE: 11.2-RELEASE
  Using Branch: 11.2-RELEASE
  Post-install Artifact: https://github.com/freenas/iocage-plugin-transmission.git
  These pkgs will be installed:
    - net-p2p/transmission-daemon
    - www/transmission-web

Testing SRV response to iocage-plugins
Testing DNSSEC response to iocage-plugins

Installing plugin packages:
  - net-p2p/transmission-daemon... 
  - www/transmission-web... 

Fetching artifact... 

Branch 11.2-RELEASE does not exist at https://github.com/freenas/iocage-plugin-transmission.git!
Using "master" branch for plugin, this may not work with your RELEASE

Running post_install.sh

Command output:
transmission_enable:  -> YES
transmission_download_dir:  -> /usr/local/etc/transmission/home/Downloads
Starting transmission.
Stopping transmission.
Waiting for PIDS: 6378.
Disabling RPC whitelist, you may want to reenable it with the specific IP's you will access transmission with by editing /usr/local/etc/transmission/home/settings.json
Starting transmission.

Admin Portal:
http://192.168.2.251:9091
root@freenas[~]# iocage rename transmission transmission_1
Jail: transmission renamed to transmission_1

So I tried to rename transmission_1 to transmission_2 using the new UI, and received another call error.

Error: concurrent.futures.process._RemoteTraceback: 
""" 
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_json.py", line 1348, in json_plugin_load
    with open(f"{self.location}/plugin/settings.json", "r") as \
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/disk1/iocage/jails/transmission_1/plugin/settings.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 240, in do_update
    iocage.set(p, plugin)
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 1377, in set
    iocjson.json_plugin_set_value(_prop)
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_json.py", line 1416, in json_plugin_set_value
    settings = self.json_plugin_load()
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_json.py", line 1360, in json_plugin_load
    silent=self.silent)
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_common.py", line 81, in logit
    _callback(content, exception)
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_common.py", line 64, in callback
    raise callback_exception(message)
RuntimeError: No settings.json exists in /mnt/disk1/iocage/jails/transmission_1/plugin!

During handling of the above exception, another exception occurred:

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 122, 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 82, 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 75, in _call
    return methodobj(*params)
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
    return methodobj(*params)
  File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 668, in nf
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 242, in do_update
    raise CallError(err)
middlewared.service_exception.CallError: [EFAULT] No settings.json exists in /mnt/disk1/iocage/jails/transmission_1/plugin!
""" 

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 161, in call_method
    result = await self.middleware.call_method(self, message)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1043, 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 980, in _call
    return await self._call_worker(serviceobj, name, *args)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1007, in _call_worker
    job,
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 938, 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 923, in run_in_executor
    return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
middlewared.service_exception.CallError: [EFAULT] No settings.json exists in /mnt/disk1/iocage/jails/transmission_1/plugin!

Not sure if this helps either, but I did search the jail for settings.json. It is located in a different location than the error message indicated.

root@freenas[~]# find /mnt/disk1/iocage/jails/transmission_1/plugin -name settings.json
root@freenas[~]# find /mnt/disk1/iocage/jails/transmission_1/ -name settings.json      
/mnt/disk1/iocage/jails/transmission_1/root/usr/local/etc/transmission/home/settings.json
root@freenas[~]# 

#7 Updated by Brandon Schneider almost 3 years ago

  • Status changed from Blocked to In Progress
  • Reason for Blocked deleted (Need additional information from Author)

Great, that helps narrow things down. That settings.json you posted is actually transmissions, we just name them the same :D

Thanks for the detailed reply.

#8 Updated by Brandon Schneider almost 3 years ago

  • Related to Bug #57492: Fix incorrect middleware usage when editing a jail's properties in the new UI added

#9 Updated by Bug Clerk almost 3 years ago

  • Status changed from In Progress to Ready for Testing

#10 Updated by Bug Clerk almost 3 years ago

  • Target version changed from 11.2-U2 to 11.3

#11 Updated by Bug Clerk almost 3 years ago

  • Copied to Bug #57555: Do not allow changing UUID of iocage plugin jail added

#12 Updated by Dru Lavigne almost 3 years ago

  • Status changed from Ready for Testing to Done
  • Target version changed from 11.3 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

Also available in: Atom PDF