Project

General

Profile

Bug #41320

Increment number in plugin name to support multiple installations

Added by Disk Didler over 1 year ago. Updated over 1 year ago.

Status:
Done
Priority:
No priority
Assignee:
Brandon Schneider
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

I manually created a qbittorrent jail on my system when experimenting with learning iocage and testing BETA1 and 2.
I would like to switch now, to a plugin based jail for qbittorrent and let the freshport / freenas plugin developers handle my updates, automatically from now on, like the good old days of Warden! :)

However: I can not install qbittorrent plugin due to

"Jail: qbittorrent already exists!"

Error: 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 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 662, in nf
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 248, in fetch
    iocage.fetch(**options)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 909, in fetch
    props, accept_license=accept, official=official)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 690, in fetch_plugin_index
    props, 0, accept_license)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 125, in fetch_plugin
    props, jail_name)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 306, in __fetch_plugin_create__
    exit_on_error=self.exit_on_error).create_jail()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_create.py", line 88, in create_jail
    return self._create_jail(jail_uuid, location)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_create.py", line 104, in _create_jail
    raise RuntimeError(f"Jail: {jail_uuid} already exists!")
RuntimeError: Jail: qbittorrent already exists!
""" 

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/job.py", line 332, in run
    await self.future
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
    return self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.6/site-packages/middlewared/job.py", line 356, in __run_body
    rv = await self.middleware._call_worker(self.serviceobj, self.method_name, *self.args, job={'id': self.id})
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
    return self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 977, in _call_worker
    job,
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
    return self.gen.throw(type, value, traceback)
  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/asyncio/coroutines.py", line 129, in throw
    return self.gen.throw(type, value, traceback)
  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))
RuntimeError: Jail: qbittorrent already exists!

I personally believe we should go back to the _1 _2 _3 _4 jail name creation system used in Warden under 11.1 and earlier.
Also (not sure if we can do this yet?) I could manually fix this problem, if I can just rename my existing jail to "qbittorrent_old" and then try again.

Low priority, obviously, but yes, there's a definite need for multiple jails and plugins of the same type on a system (jail goes corrupt, but you want to pull out what data you can, for example)

History

#1 Updated by Disk Didler over 1 year ago

This job caused a major problem, see here:

https://redmine.ixsystems.com/issues/41324

#2 Updated by Dru Lavigne over 1 year ago

  • Category changed from OS to Middleware
  • Assignee changed from Release Council to William Grzybowski

#4 Updated by William Grzybowski over 1 year ago

  • Assignee changed from William Grzybowski to Brandon Schneider
  • Target version changed from Backlog to 11.2-BETA3
  • Severity changed from New to Medium

Brandon, how much work would that be?

#5 Updated by Brandon Schneider over 1 year ago

This doesn't make a lot of sense to me. Is there a reason to have multiple of the same plugin installed?

#6 Updated by Brandon Schneider over 1 year ago

  • Status changed from Unscreened to Not Started

#7 Updated by Disk Didler over 1 year ago

Brandon Schneider wrote:

This doesn't make a lot of sense to me. Is there a reason to have multiple of the same plugin installed?

Firstly this isn’t 2 plugins of the same type installed.
You can create a manual jail called qbittorrent, that jail could have nothing to do with qbittorrent.

Once you do attempt to install an actual plugin which shares the same name, currently the second gets destroyed.

Also, warden allowed multiple jails of the same type.
Regardless of this, sometimes a jail goes “odd” and it’s best to make a new one and import what you can out of the file system of the old dead one.

Some users, oddly, run 2 plex servers, one for 4K content, one for 1080p

End of the day, even if it’s a temporary measure, there is a use for 2 of the same plugin, you used to support it, AND in current builds you can accidentally destroy data due to how the plugin system is working with naming conventions.

#8 Updated by Brandon Schneider over 1 year ago

  • Status changed from Not Started to In Progress

#9 Updated by Brandon Schneider over 1 year ago

Disk: Fair enough, I wasn't trying to demerit the suggestion, rather was asking for a usecase.

iocage PR: https://github.com/freenas/iocage/pull/15
DESC: Create a plugin with a _2, ... name when the original already exists
RISK: Low
ACCEPTANCE: Run iocage fetch -P --name btsync dhcp=on bpf=yes vnet=on twice

#10 Updated by Disk Didler over 1 year ago

No worries Brandon, just wanted to make sure I explained clearly.

For what it's worth I'd even set jail / plugin number 1 to have an _1 for consistency, but that's me.

#11 Updated by Brandon Schneider over 1 year ago

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

#12 Updated by Dru Lavigne over 1 year ago

  • Subject changed from Plugin install fails, if a jail already exists with the preferred jailname to Increment number in plugin name to support multiple installations
  • Needs Doc changed from Yes to No

#13 Updated by Disk Didler over 1 year ago

Brandon, just some more confirmation on another reason why people may want multiple plugins.

https://redmine.ixsystems.com/issues/42185

(I'd love to install a brand new qbittorrent jail, for testing, to see if, infact a brand new one is automatically 4.1.2? and if simply the 'update button' is missing, etc)

#14 Updated by Bonnie Follweiler over 1 year ago

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

Passed Testing in FreeNAS-11.2-MASTER-201809040858

#15 Updated by Dru Lavigne over 1 year ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF