Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot stop jails with dot in name/uuid after 1.2 -> 1.10 upgrade #57

Open
4 of 5 tasks
vedadkajtaz opened this issue Jan 1, 2025 · 2 comments
Open
4 of 5 tasks
Assignees
Labels
bug Something isn't working

Comments

@vedadkajtaz
Copy link
Contributor

Make sure to follow and check these boxes before submitting an issue! Thank you.

  • Supply iocage --version
  • Supply the commands used, along with any steps to recreate it.
  • Provide the output from the command you issued.
  • Supply what you expected the result or output to be
  • Checked that the problem has not already been fixed on master if using
    a stable release.

As stated in title, after upgrading from 1.2 (old upstream in ports) to 1.10, iocage fails to stop any running jail with host_hostuuid containing dots (.).

$ iocage --version
Version 1.10

$ iocage list
+-----+----------------------+-------+--------------+-----------------+
| JID |         NAME         | STATE |   RELEASE    |       IP4       |
+=====+======================+=======+==============+=================+
| 4   | ai0.infra.******.net | up    | 14.1-RELEASE | dhcp,10.67.0.29 |
+-----+----------------------+-------+--------------+-----------------+

$ iocage get host_hostuuid ai0
ai0.infra.******.net

$ jls -v
   JID  Hostname                      Path
        Name                          State
        CPUSetID
        IP Address(es)
     4  ai0.infra.******.net          /iocage/jails/ai0.infra.******.net/root
        ioc-ai0_infra_******_net      ACTIVE
        3

As seen above, the actual jail id from OS point of view is ioc-ai0_infra_******_net.

However, running iocage stop on the jail invokes jls -j ioc-ai0.infra.******.net devfs_ruleset (with dots not replaced by underscores), which doesn't match any jail:

$ iocage stop ai0
jls: jail "ioc-ai0.infra.******.net" not found
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/iocage_cli/stop.py", line 67, in cli
    ioc.IOCage(jail=jail, rc=rc).stop(
  File "/usr/local/lib/python3.11/site-packages/iocage_lib/iocage.py", line 1882, in stop
    ioc_stop.IOCStop(
  File "/usr/local/lib/python3.11/site-packages/iocage_lib/ioc_stop.py", line 62, in __init__
    raise e
  File "/usr/local/lib/python3.11/site-packages/iocage_lib/ioc_stop.py", line 59, in __init__
    self.__stop_jail__()
  File "/usr/local/lib/python3.11/site-packages/iocage_lib/ioc_stop.py", line 71, in __stop_jail__
    self.path, suppress_log=True).json_get_value('devfs_ruleset')
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/iocage_lib/ioc_json.py", line 1756, in json_get_value
    ruleset = su.check_output(
              ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['jls', '-j', 'ioc-ai0.infra.******.net', 'devfs_ruleset']' returned non-zero exit status 1.
vedadkajtaz added a commit to vedadkajtaz/iocage that referenced this issue Jan 2, 2025
@vedadkajtaz vedadkajtaz mentioned this issue Jan 2, 2025
2 tasks
@thehigherlife
Copy link

is there a workaround for this?

@dgeo dgeo self-assigned this Jan 4, 2025
@dgeo dgeo added the bug Something isn't working label Jan 4, 2025
@dgeo
Copy link
Contributor

dgeo commented Jan 4, 2025

yes, #58 fixed this and have been merged in master.
This is a 1 line patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants