Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Problem with service iocage start #968

Closed
yerrysherry opened this issue Jun 26, 2019 · 2 comments
Closed

Problem with service iocage start #968

yerrysherry opened this issue Jun 26, 2019 · 2 comments

Comments

@yerrysherry
Copy link

root@jail1:~ # iocage --version
Version 1.2 RC

I installed iocage using github

service iocage enable

iocage enabled in /etc/rc.conf

root@jail1:~ # iocage list -h

  • dns4 down 11.2-RELEASE 192.168.59.61
  • www1 down 11.2-RELEASE 192.168.59.60

root@jail1:~ # iocage get -rh boot
dns4 0
www1 1

root@jail1:~ # service iocage start --rc

  • [I|O|C] starting jails...
    Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/git/init.py", line 83, in
    refresh()
    File "/usr/local/lib/python3.6/site-packages/git/init.py", line 73, in refresh
    if not Git.refresh(path=path):
    File "/usr/local/lib/python3.6/site-packages/git/cmd.py", line 290, in refresh
    raise ImportError(err)
    ImportError: Bad git executable.
    The git executable must be specified in one of the following ways:
    • be included in your $PATH
    • be set via $GIT_PYTHON_GIT_EXECUTABLE
    • explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|none|n|0: for no warning or exception
- warn|w|warning|1: for a printed warning
- error|e|raise|r|2: for a raised exception

Example:
export GIT_PYTHON_REFRESH=quiet

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/iocage", line 10, in
sys.exit(cli())
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1132, in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1171, in resolve_command
cmd = self.get_command(ctx, cmd_name)
File "/usr/local/lib/python3.6/site-packages/iocage_cli/init.py", line 182, in get_command
mod = import(f"iocage_cli.{name}", None, None, ["cli"])
File "/usr/local/lib/python3.6/site-packages/iocage_cli/start.py", line 28, in
import iocage_lib.iocage as ioc
File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 42, in
import iocage_lib.ioc_plugin as ioc_plugin
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_plugin.py", line 32, in
import git
File "/usr/local/lib/python3.6/site-packages/git/init.py", line 85, in
raise ImportError('Failed to initialize: {0}'.format(exc))
ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
- be included in your $PATH
- be set via $GIT_PYTHON_GIT_EXECUTABLE
- explicitly set via git.refresh()

All git commands will error until this is rectified.

This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|none|n|0: for no warning or exception
- warn|w|warning|1: for a printed warning
- error|e|raise|r|2: for a raised exception

Example:
export GIT_PYTHON_REFRESH=quiet

root@jail1:~ # type git
git is /usr/local/bin/git

I add PATH en GIT_PYTHON_REFRESH variable to /usr/local/etc/rc.d/iocage

vi /usr/local/etc/rc.d/iocage

start_cmd="iocage_start"
stop_cmd="iocage_stop"
export LANG=$iocage_lang
export PATH=$PATH:/usr/local/bin/git
export GIT_PYTHON_REFRESH="quiet"

iocage_start()

root@jail1:~ # service iocage start --rc

  • [I|O|C] starting jails...
    Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/git/init.py", line 83, in
    refresh()
    File "/usr/local/lib/python3.6/site-packages/git/init.py", line 73, in refresh
    if not Git.refresh(path=path):
    File "/usr/local/lib/python3.6/site-packages/git/cmd.py", line 227, in refresh
    cls().version()
    File "/usr/local/lib/python3.6/site-packages/git/cmd.py", line 548, in
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/git/cmd.py", line 1014, in _call_process
    return self.execute(call, **exec_kwargs)
    File "/usr/local/lib/python3.6/site-packages/git/cmd.py", line 735, in execute
    **subprocess_kwargs
    File "/usr/local/lib/python3.6/subprocess.py", line 729, in init
    restore_signals, start_new_session)
    File "/usr/local/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
    NotADirectoryError: [Errno 20] Not a directory: 'git'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/iocage", line 10, in
sys.exit(cli())
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1132, in invoke
cmd_name, cmd, args = self.resolve_command(ctx, args)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1171, in resolve_command
cmd = self.get_command(ctx, cmd_name)
File "/usr/local/lib/python3.6/site-packages/iocage_cli/init.py", line 182, in get_command
mod = import(f"iocage_cli.{name}", None, None, ["cli"])
File "/usr/local/lib/python3.6/site-packages/iocage_cli/start.py", line 28, in
import iocage_lib.iocage as ioc
File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 42, in
import iocage_lib.ioc_plugin as ioc_plugin
File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_plugin.py", line 32, in
import git
File "/usr/local/lib/python3.6/site-packages/git/init.py", line 85, in
raise ImportError('Failed to initialize: {0}'.format(exc))
ImportError: Failed to initialize: [Errno 20] Not a directory: 'git'

From the docu: https://iocage.readthedocs.io/en/latest/install.html
root@jail1:~ # pkg install python36 git-lite libgit2 cython3 py36-pip
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'cython3' have been found in the repositories

From the docu: https://github.com/iocage/iocage

pkg install python36 git-lite py36-cython py36-pip

Did I something wrong? I followed the installtion guide ...

@sonicaj
Copy link
Member

sonicaj commented Jun 26, 2019

Can you please add following to /usr/local/etc/rc.d/iocage ?
PATH="${PATH}:/usr/local/sbin:/usr/local/bin"
This is most likely similar to #890

@yerrysherry
Copy link
Author

Indeed, now it works. Thx, sonicaj for the fast reaction.

vi /usr/local/etc/rc.d/iocage
..
start_cmd="iocage_start"
stop_cmd="iocage_stop"
export LANG=$iocage_lang
export PATH="${PATH}:/usr/local/sbin:/usr/local/bin"
..

Sonicaj, can you update this small change in git? Then, when 1.2 comes out, the iocage daemon starts up without any problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants