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

codec can't decode byte 0xb3 in position 193: ordinal not in range(128) #153

Closed
5 tasks done
26O0 opened this issue May 28, 2017 · 46 comments
Closed
5 tasks done

codec can't decode byte 0xb3 in position 193: ordinal not in range(128) #153

26O0 opened this issue May 28, 2017 · 46 comments
Assignees

Comments

@26O0
Copy link

26O0 commented May 28, 2017

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.

Version 0.9.8.1 05/23/2017

ioage list

% iocage list
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 1063, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/main.py", line 102, in cli
    ioc_check.IOCCheck()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_check.py", line 19, in __init__
    self.__check_datasets__()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_check.py", line 33, in __check_datasets__
    list(pool.root.datasets)))) > 0
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_check.py", line 32, in <lambda>
    has_duplicates = len(list(filter(lambda x: x.mountpoint == "/iocage",
  File "libzfs.pyx", line 2280, in libzfs.ZFSDataset.mountpoint.__get__ (libzfs.c:50748)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb3 in position 193: ordinal not in range(128)

Expected results:
I expect to have a list of jails returned


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@26O0
Copy link
Author

26O0 commented May 28, 2017

Your template doesn't ask for how iocage is installed. This is how it was installed.

  1. git clone https://github.com/trueos/freebsd /usr/src
  2. pkg install python36 libgit2
  3. git clone --recursive https://github.com/iocage/iocage
  4. make install as root
  5. To install subsequent updates: run make install as root.

@26O0
Copy link
Author

26O0 commented May 28, 2017

Here's more:

% cat .login_conf 
# $FreeBSD: src/share/skel/dot.login_conf,v 1.3 2001/06/10 17:08:53 ache Exp $
#
# see login.conf(5)
#
me:\
        :charset=UTF-8:\
        :lang=en_US.UTF-8:\
        :setenv=LC_COLLATE=C:
% locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE=C
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

@skarekrow
Copy link
Member

Can you post a zfs list as well? I have a feeling there's a special character or something. Since I don't recall decoding UTF8 anywhere in this code.

@26O0
Copy link
Author

26O0 commented May 28, 2017 via email

@skarekrow
Copy link
Member

Damn, I don't see anything that's sticking out. I can't replicate it currently, but I'll keep trying. So you were able to create a jail though? Because this same routine would have been called, odd it didn't die for you then as well.

@26O0
Copy link
Author

26O0 commented May 28, 2017

Hi @skarekrow,

I was previously using an iocage (also from git src), so a jail already created and that's why I want to list it now. I'll see if I can create a new jail with the latest iocage.

@skarekrow
Copy link
Member

Creating a new jail should fail the same way as list then. Do you recall the last version you used?

@26O0
Copy link
Author

26O0 commented May 28, 2017

Yes, failing in idential way.

I don't reall version but the /usr/local/bin/ioage date was from either the 8th or 18th of May. Probably the earlier date, but I don't know for certain.

@skarekrow
Copy link
Member

That would be before the file was converted to libzfs if the 8th was the right date, so I'll summon @gronke and see if he has any ideas as well.

@26O0
Copy link
Author

26O0 commented May 28, 2017

okay, I just updated trueOS base and packages and now getting a SO error.

% iocage list
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 6, in <module>
    from iocage.main import cli
  File "/usr/local/lib/python3.6/site-packages/iocage/main.py", line 13, in <module>
    import iocage.lib.ioc_check as ioc_check
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_check.py", line 6, in <module>
    import iocage.lib.ioc_common
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_common.py", line 12, in <module>
    import pygit2
  File "/usr/local/lib/python3.6/site-packages/pygit2/__init__.py", line 32, in <module>
    from _pygit2 import *
ImportError: Shared object "libgit2.so.24" not found, required by "_pygit2.so"

@skarekrow
Copy link
Member

Just for fun @26O0, can you try editing /usr/local/lib/python3.6/site-packages/iocage/lib/ioc_check.py and changing the line has_duplicates = len(list(filter(lambda x: x.mountpoint == "/iocage", to has_duplicates = len(list(filter(lambda x: x.mountpoint == u"/iocage",? Make sure to remove the pyc file if it exists, rm /usr/local/lib/python3.6/site-packages/iocage/lib/ioc_check.pyc

The SO error is because you need to rebuild pygit2, since you upgraded libgit2 to 0.25.1 I'd imagine.

@26O0
Copy link
Author

26O0 commented May 28, 2017

The SO error is because you need to rebuild pygit2, since you upgraded libgit2 to 0.25.1 I'd imagine.

Yes, I now have libgit2-0.25.1_1

I cd into py-libzfs ran `python3.6 setup.py install, which installed but generated errors.

I went back to iocage dir and installed without issues, but running ioage still generating errors.

Do you recommend I still edit the files you listed above?

@skarekrow
Copy link
Member

You're still getting the SO errors? You could try just upgrading pygit2 as well with pip install -U pygit2.

Yes, please try editing that file and add the u before /iocage, I'm interested to see what it says. Please post the stack trace if it occurs too 👍

@26O0
Copy link
Author

26O0 commented May 28, 2017

Actually, if I make in ioage dir, I get this:

make
echo -e "import os\ntry:\n  if not os.listdir('/usr/src'): exit('/usr/src must be populated!')\nexcept FileNotFoundError:\n  exit('/usr/src must be populated!')" | python3.6
git pull
Already up-to-date.
python3.6 -m ensurepip
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: pip in /usr/local/lib/python3.6/site-packages
pip3.6 install -U Cython
Requirement already up-to-date: Cython in /usr/local/lib/python3.6/site-packages
cd py-libzfs && python3.6 setup.py build && python3.6 setup.py install
running build
running build_py
running build_ext
skipping 'libzfs.c' Cython extension (up-to-date)
building 'libzfs' extension
cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -I/usr/src/cddl/lib/libumem -I/usr/src/sys/cddl/compat/opensolaris/ -I/usr/src/sys/cddl/compat/opensolaris -I/usr/src/cddl/compat/opensolaris/include -I/usr/src/cddl/compat/opensolaris/lib/libumem -I/usr/src/cddl/contrib/opensolaris/lib/libzpool/common -I/usr/src/sys/cddl/contrib/opensolaris/common/zfs -I/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -I/usr/src/sys/cddl/contrib/opensolaris/uts/common/sys -I/usr/src/cddl/contrib/opensolaris/head -I/usr/src/sys/cddl/contrib/opensolaris/uts/common -I/usr/src/cddl/contrib/opensolaris/lib/libnvpair -I/usr/src/cddl/contrib/opensolaris/lib/libuutil/common -I/usr/src/cddl/contrib/opensolaris/lib/libzfs/common -I/usr/src/cddl/contrib/opensolaris/lib/libzfs_core/common -I/usr/local/include/python3.6m -c libzfs.c -o build/temp.freebsd-12.0-CURRENT-amd64-3.6/libzfs.o -DNEED_SOLARIS_BOOLEAN -D_XPG6 -g -O0
libzfs.c:14747:13: warning: code will never be executed [-Wunreachable-code]
  __pyx_r = 0;
            ^
libzfs.c:19649:73: warning: incompatible pointer to integer conversion passing 'PyObject *' (aka 'struct _object *') to parameter of type 'zfs_type_t' [-Wint-conversion]
  __pyx_v_handle = zfs_path_to_zhandle(__pyx_v_self->handle, __pyx_t_1, __pyx_t_2);
                                                                        ^~~~~~~~~
/usr/src/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:704:79: note: passing argument to parameter here
extern zfs_handle_t *zfs_path_to_zhandle(libzfs_handle_t *, char *, zfs_type_t);
                                                                              ^
libzfs.c:37575:13: warning: code will never be executed [-Wunreachable-code]
  __pyx_r = 0;
            ^
libzfs.c:47906:89: error: too few arguments to function call, expected 4, have 3
        __pyx_v_ret = lzc_send_space(__pyx_v_c_name, __pyx_v_cfromname, (&__pyx_v_space));
                      ~~~~~~~~~~~~~~                                                    ^
/usr/src/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h:72:1: note: 'lzc_send_space' declared here
int lzc_send_space(const char *, const char *, enum lzc_send_flags, uint64_t *);
^
libzfs.c:50839:74: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_v_ret = zfs_destroy_snaps(__pyx_v_self->__pyx_base.handle, __pyx_v_c_name, 1);
                                                                         ^~~~~~~~~~~~~~
/usr/src/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:564:52: note: passing argument to parameter here
extern int zfs_destroy_snaps(zfs_handle_t *, char *, boolean_t);
                                                   ^
4 warnings and 1 error generated.
error: command 'cc' failed with exit status 1
*** Error code 1

Stop.
make: stopped in /usr/home/sean/bin/iocage

If I pip3.6 install -U ., it installs.

@skarekrow
Copy link
Member

Interesting, but since you just updated TrueOS, you may have an old and incompatible source tree now unless you also updated that.

@26O0
Copy link
Author

26O0 commented May 28, 2017

gahhh! what's wrong with my system?!

% sudo pip3.6 install -U pygit2
The directory '/usr/home/sean/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/usr/home/sean/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pygit2
  Downloading pygit2-0.25.1.tar.gz (456kB)
    100% |████████████████████████████████| 460kB 1.5MB/s 
    Complete output from command python setup.py egg_info:
    
    Installed /tmp/pip-build-71z_sv35/pygit2/.eggs/cffi-1.9.1-py3.6-freebsd-12.0-CURRENT-amd64.egg
    /usr/local/lib/python3.6/site-packages/setuptools/extern/__init__.py:1: UserWarning: Module cffi was already imported from /usr/local/lib/python3.6/site-packages/cffi/__init__.py, but /tmp/easy_install-1_u9fk77/cffi-1.9.1 is being added to sys.path
      from pkg_resources.extern import VendorImporter
    /usr/local/lib/python3.6/site-packages/setuptools/dist.py:364: UserWarning: Module cffi was already imported from /usr/local/lib/python3.6/site-packages/cffi/__init__.py, but /tmp/pip-build-71z_sv35/pygit2/.eggs/cffi-1.9.1-py3.6-freebsd-12.0-CURRENT-amd64.egg is being added to sys.path
      pkg_resources.working_set.add(dist, replace=True)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-71z_sv35/pygit2/setup.py", line 210, in <module>
        **extra_args)
      File "/usr/local/lib/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 318, in __init__
        _Distribution.__init__(self, attrs)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 281, in __init__
        self.finalize_options()
      File "/usr/local/lib/python3.6/site-packages/setuptools/dist.py", line 376, in finalize_options
        ep.load()(self, ep.name, value)
      File "/usr/local/lib/python3.6/site-packages/cffi/setuptools_ext.py", line 188, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/usr/local/lib/python3.6/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/usr/local/lib/python3.6/site-packages/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "pygit2/_run.py", line 67, in <module>
        ffi = FFI()
      File "/usr/local/lib/python3.6/site-packages/cffi/api.py", line 54, in __init__
        backend.__version__, backend.__file__))
    Exception: Version mismatch: this is the 'cffi' package version 1.10.0, located in '/usr/local/lib/python3.6/site-packages/cffi/api.py'.  When we import the top-level '_cffi_backend' extension module, we get version 1.9.1, located in '/tmp/pip-build-71z_sv35/pygit2/.eggs/cffi-1.9.1-py3.6-freebsd-12.0-CURRENT-amd64.egg/_cffi_backend.so'.  The two versions should be equal; check your installation.
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-71z_sv35/pygit2/

@skarekrow
Copy link
Member

There's nothing wrong ;), I had a brain fart, you can safely remove cffi as well. pygit2 will bring that back in.

So to recap:

pip3.6 uninstall cffi ; pip3.6 install -U pygit2`

@26O0
Copy link
Author

26O0 commented May 28, 2017

unless you also updated that.

yeah, unfortunately that's not it. I checked out the src and there hasn't been any updates since.

@26O0
Copy link
Author

26O0 commented May 28, 2017

I had a brain fart

that's understandable, it's the middle of the night!

Now I'm getting the original error and will edit the files you recommended.

@skarekrow
Copy link
Member

Hmm @kmoore134 may not have updated the tree or something. I typically see that error when I have an old source tree. You can try opening up a libzfs ticket on @jceel's tracker, he's very responsive and will likely get to the bottom of it faster then myself.

He may even have an idea of this UTF-8 issue, as it may stem from libzfs instead of iocage as well.

@skarekrow
Copy link
Member

@26O0 looks like other users have done this jceel/py-libzfs#18

@26O0
Copy link
Author

26O0 commented May 28, 2017

edited the file and the few lines around it look like this:

        zfs = libzfs.ZFS(history=True, history_prefix="<iocage>")                                                                                                                                                                                                      
        pool = zfs.get(self.pool)                                                                                                                                                                                                                                      
        has_duplicates = len(list(filter(lambda x: x.mountpoint == u"/iocage",                                                                                                                                                                                         
                                         list(pool.root.datasets)))) > 0  

pyc file doesn't exist.

pip3 install -U . results in this:

   generating cffi module 'build/temp.freebsd-12.0-CURRENT-amd64-3.6/pygit2._libgit2.c'
    creating build/temp.freebsd-12.0-CURRENT-amd64-3.6
    building '_pygit2' extension
    creating build/temp.freebsd-12.0-CURRENT-amd64-3.6/src
    cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -I/usr/local/include -I/usr/local/include/python3.6m -c src/blob.c -o build/temp.freebsd-12.0-CURRENT-amd64-3.6/src/blob.o
    In file included from src/blob.c:30:
    In file included from src/blob.h:34:
    src/types.h:36:2: error: You need a compatible libgit2 version (v0.24.x)
    #error You need a compatible libgit2 version (v0.24.x)
     ^
    1 error generated.
    error: command 'cc' failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of pygit2

My make looks like the output in that issue you linked. I don't see a solution, though.

@skarekrow
Copy link
Member

skarekrow commented May 28, 2017

Yeah that's because you have the newer pygit2 installed, you can manually remove /usr/local/lib/python3.6/site-packages/iocage/lib/ioc_check.py and copy that file over to /usr/local/lib/python3.6/site-packages/iocage/lib/ioc_check.py in its place.

And yes, it seems no solution was suggested yet. I have very little Cython experience, so I'm not the best one to fix that error sadly :( Otherwise I'd send him a PR to unblock you three. Perhaps @william-gr has the ability to do so.

@26O0
Copy link
Author

26O0 commented May 28, 2017

@skarekrow, those look like the same path.
Would I remove from /usr/local and copy from iocage src back to /usr/local?

@skarekrow
Copy link
Member

skarekrow commented May 28, 2017

Yes, sorry I didn't make that more clear.

EDIT: Just to be more clear, make sure it's just the ioc_check.py file that you are removing and copying over, not the rest.

@26O0
Copy link
Author

26O0 commented May 28, 2017

make is still failing and so is pip3 install -U .

Looks like we'll need to wait and see what happens on jceel/py-libzfs#18

@skarekrow
Copy link
Member

Yeah I believe that's blocking any meaningful progress here, and the pip3 will continue to fail until I update iocage's setup.py for the latest port, which isn't up to date on HardenedBSD yet, so I haven't done it :)

I'll leave this open and see what some of the guys I pinged have to say, I would suggest in the mean time rolling back to the 0.9.7 release unless you needed one of the many fixes and additions 0.9.8 brought.

Thanks for the issue!

@26O0
Copy link
Author

26O0 commented May 28, 2017

@skarekrow, thanks for spending so much time with me tracking this down.

I'll download 0.9.7 and use that for the time being!

Thanks again, sir.

@skarekrow
Copy link
Member

@26O0 and thank you for also spending that time trying to narrow things down. It's too bad we had to leave it in this state, though thinking about it again (man it is late...) you may not be able to use 0.9.7 either since the same libzfs issue will be a blocker as well :(

Hopefully we can get this issue solved sooner than later!

@26O0
Copy link
Author

26O0 commented May 28, 2017

great! I'll await for the next trueOS build to try building iocage from git source.

@jungle-boogie
Copy link
Contributor

I'm having this problem, and I'm pretty sure I have the latest devel/py-libzfs: py27-libzfs-1.0.20170525

@skarekrow
Copy link
Member

@william-gr is the port maintainer and didn't bring forward the patch that was done as he felt there is a better way to fix it. But he couldn't reproduce the problem. So I'll ping him here and if you could @jungle-boogie please post something he can reproduce.

@william-gr
Copy link

The patch was not correct, it simply did masquerade the issue. There is a race condition in py-libzfs.

@jungle-boogie
Copy link
Contributor

hi @william-gr, so you'll update py-libzfs on freebsd ports and @kmoore134 will pick it up and patch it again?

@william-gr
Copy link

There is no fix for py-libzfs yet. I am not the original author and could not reliably reproduce it to try and fix.

@jceel
Copy link

jceel commented Jun 22, 2017

Why don't you guys open a new issue at https://github.com/jceel/py-libzfs/issues? or submit a pull request? it's the only way to make sure your local patches are correct way to solve problem.

@asomers
Copy link
Contributor

asomers commented Aug 30, 2017

I'm running into this with the latest TrueOS with iocage 0.9.9.1 and libzfs 1.0.20170814. Is there any workaround?

@skarekrow
Copy link
Member

@araujobsd any ideas ^

@araujobsd
Copy link
Contributor

I didn't check it yet, I know it is a long time issue! It is in my TODO list and I'll check it soon.

@araujobsd araujobsd reopened this Aug 31, 2017
@araujobsd araujobsd self-assigned this Aug 31, 2017
@asomers
Copy link
Contributor

asomers commented Sep 1, 2017

For now I reapplied the old patch at https://github.com/trueos/freebsd-ports/commit/00da370342012d87331eae3d74ef6784ed8172be and I can use iocage again.

@araujobsd
Copy link
Contributor

@asomers Thanks for the feedback, I will check probably next week if that patch is the right thing to fix it or at least can mitigate while we hunt the real bug.

@disasmwinnie
Copy link

disasmwinnie commented Nov 5, 2017

I get the same compiler errors like @26O0. I think py-libzfs generally doesn't work with freebsd 11.1 (or dereviates) since, the libzfs-API changed. I opened an upstream issue with some documentation: truenas/py-libzfs#1

However, I am not sure if the API change is responsible for all the issues mentioned before. I think I found the issue, but no solution. Hope somebody with knowledge about libzfs could have a lot at the problem.

@skarekrow
Copy link
Member

8d2cd72 should fix this

skarekrow referenced this issue in truenas/iocage Oct 4, 2018
* We want unix acl's on iocage's datasets

FreeNAS Ticket: #38195

* DNS/SRV/Host fixes

- Parse out the host name, you can't query SRV records from an HTTP
  address
- Don't die if SRV records aren't found, just log it
- pkg-repository(5) doesn't appear to enforce or require SRV records
- TrueOS pkg mirrors work fine without SRV records

* Use branches with plugins

This allows us to freeze the INDEX and do development without users being impacted. In addition safe guard against plugins requiring new iocage features.

FreeNAS Ticket: #39638

* Use branches with plugins

This allows us to freeze the INDEX and do development without users being impacted. In addition safe guard against plugins requiring new iocage features.

FreeNAS Ticket: #39638

* Travis

* Check host release for plugins

- Also commonize the method

FreeNAS Ticket: #39508

* Trrrrravis

* Strip subnet of IP4_ADDR when building plugin's portal URL (iocage#586)

* Check release upon create (iocage#589)

* Always Force unmount Datasets when renaming (iocage#590)

* Remove exit_on_error

This is redundant, as it's already the case.

Related to FreeNAS TIcket: #36948

* Check DNS for plugins

- Return a more useful pkg error
- Show more information about the install process
- General formatting improvements
- Tear down jail if DHCP fails
- Tear down jail if VNET fails
- Tear down jail if pkg upgrade fails in plugin installs (required for mismatched ABI errors from previous pkg)

FreeNAS Ticket: #40106

* Flatten Python module names (iocage#592)

* rename iocage.lib to iocage_lib

* rename iocage/cli to iocage_cli

* update setup.py to iocage_lib and iocage_cli

* move manpage files to top directory

* move icage/tests/ to top level directory

* add missing dev dependency mock

* gitignore .pytest_cache/

* remove deprecated iocage/ directory

* ./iocage script for local cli testing/development

* Refactor callback method, 

- Also add callback to many places in plugins
- Correctly pass callback into fetch method
- Return the command output message for plugins

FreeNAS Ticket: #36948

* Bump copyright year (better late then never?)

* Fix a couple typos

* Add a debug command

This should help with tickets that need to supply information

* Creating duplicate plugins now name them plugin_NUM

- Fix upgrading for plugins
- Fix jail creation to be basejails for plugins (They were before, but not actually removing any data)

* We want file, not http when specified

This fixes some logic.

Closes iocage#597

* Be less nice for plugin pkg's clogging up stdout

FreeNAS TIcket: #42018

* Fix Makefile names

* Make some plugin exec changes to hopefully address FreeNAS #42018

* Prevent CPU from spinning on plugin tasks

* Fix callback usage in lib/iocage

This was incorrectly calling None on API usage.

FreeNAS Ticket: #42359

* Read output one more time after is finished (iocage#601)

* Change devfs rule generation

- DHCP is much more flexible now
- Plugins are able to have devfs rules specified in their manifests
- Plugin manifests are kept around for devfs rules now, possibly more fun later

FreeNAS Ticket: #42593

* Fix a couple issues with devfs generation

* Only show one interface for the plugin IP

Most plugins that have more then one IP use VNET, so this assumes the first interface to be the default one.

FreeNAS Ticket: #42641

* Update py-libzfs

Closes issues iocage#602, iocage#505, #153

* Fix usage of git@ repos

This allows private repos to be used as plugins.

FreeNAS Ticket: #42653

* fixes BUG, return was one level high (iocage#603)

* Merge pull request #17 from freenas/ticket-41694

Delete jails in case of plugin install failure

* Initialize reference to repo after succesful porcelain.pull() (iocage#606)

* adds thickjail feature to man (iocage#604)

* Fix debug not being as useful as it should be for non-running jails

- Also append .txt to the filenames.
- Drop jexec for most of the debug to instead opt for grabbing from the filesystem directly

FreeNAS Ticket: #45563

* Correctly create aliases for shared IP jails that don't specify iface

It seems jail(8) behavior may have changed, and this is now required for jail to create the aliases. We do a best effort attempt at using the default interface if the user doesn't supply one.

The idea is that if they didn't supply one, they may have already set the alias up themselves, so iocage will do nothing in this case.

FreeNAS Ticket: #46245

* Fixed a bug in fstab

This commit fixes a bug which caused iocage to raise an exception incase an edit/removal was required by index only and destination field was passed on as null in fstab.
Ticket: #45783

* Remove duplicate variable

This would be fatal possibly.

* Let's use the right variable

Possibly shadowing before anyways, this is better.

* Updates to iocage.8: (iocage#612)

- Update entry for ip4_addr to remove text about entering DEFAULT.
- Fix up entry for vnet_interfaces.
- Manual check of iocage.8: no issues.

* Silence!

* Improved error handling

This commit adds a try catch block to a snippet where while removing a file may raise an exception as it might not exist in the first place.
Ticket: #45805

* Potential Bug fix for jail creation

This commit fixes a potential bug which possible arose due to a race condition when the system was unable to find a newly created file. The original referenced issue couldn't be reproduced but necessary steps have been taken to avoid this behavior in this commit.
Ticket: #43119

* Test variable before splitting again, honor IP only for plugin install

This would be fatal if they didn't supply an interface, in addition we don't care about the interface here, so these block's aren't useful.

FreeNAS Ticket: #41670

* Flag debug as rootcmd (iocage#613)

* Fix branch name for plugin repo (iocage#614)

* Don't use ifconfig -f inet:cidr to extract IP/Mask... (iocage#515)

* Don't use ifconfig -f inet:cidr to extract IP/Mask, this is only supported by FreeBSD 11 and newer

* efficiencyfied a redundant operation, reordered for readability, and added comments

* Moved the [2] up to original assignment of addr_split

* Fix devfs rules that have a bracket

add path 'ulpt[0-9]*' mode 666 and such.

FreeNAS Ticket: #46920

* Use a specific exception for pool activation issues

FreeNAS Ticket: #45760

* Merge pull request #37 from freenas/ticket-47085

Bug fix for MAC Addresses

* Be a better env...izen. Less pollution!

FreeNAS Ticket: #46491

* @william-gr noted we should probably have a couple nice defaults

env shouldn't be *so* empty.

* Fix wrong property in doc

* Add "allow_mlock" as a new property (iocage#617)

Introduced in FreeBSD 12.0. Enables running services that
require mlock() in a jail (e.g. MongoDB)

* Do not set allow.mlock when userland < 12.0 (iocage#619)

* Bug fix for installing packages (iocage#607)

This commit fixes a bug which caused an exception when trying to install plugins or packages with no packages specified to be installed.
Ticket: #44735

* Retry on pkg and pkg install failures

Currently we just assume it succeeds or fails, when it could be a slight transient issue.

FreeNAS Ticket: #44834

* What! No sys.exit.

Raise instead.

FreeNAS Ticket: 44834

* Remove debug, add better messages.

* It's not even Monday!

* Tighten up reusage of code for retry

This is better, suggested by William.

* Let's add the string version of the exception too

Why not! Another idea of @william-gr

* Yeah, once is enough for the pkg error

* Add rtsold support

This works much like dhcp, just easier if you have an ipv6 network. Just set the ip6_addr to 'vnet0|accept_rtadv'

FreeNAS Ticket: #40468

* keep_jail_on_failure should be a flag

Previously it required a boolean.

FreeNAS Ticket: #48416

* Fixed iocage list multiple IP4 addresses (iocage#621)

* fixed iocage list: show multiple IP4 addresses correctly

* Fixed long lines in ioc_list.py

*  Fixed bug: Jail fails to start when depends jail is already running (iocage#608) (iocage#622)

* Fixed bug: Jail fails to start when depends jail is already running (iocage#608)

* Fixed bug iocage#608: If dependent jail does not start then parent jail is not started
* Added JailRunning exception and use it when dependent jails already started
* Added force_raise flag to default callback() function to force raising exception

* Fix exec_pre|post stop

Previous behavior was borked. It now works.

Closes iocage#611
FreeNAS TIcket: #48449

* Make default interface for vnet customizable (iocage#623)

This commit adds support for customizing the default interface for vnet which should be attached on the relevant bridge. It updates the properties of the jails by adding a new property which is used when starting vnet jails.
Ticket: #40484

* Fixed bug: setting ZFS properties via 'iocage set' raised exception (iocage#624)

* Allow unhiding tun devices with a custom prop "allow_tun"

This can be either 0 or 1. This change will also make devfs rulesets individual for each jail that sets dhcp or allow_tun. But it also means you can combine them now.

FreeNAS Ticket: #40872

* Catch by @william-gr

* exec_clean now affects exec as expected.

Upstream required -l to be passed to jexec to clean the environment. Otherwise it was just for the jail initialization.

Closes: iocage#610
FreeNAS Ticket: #48581

* Fix Traceback when pkg-static install fails (iocage#627)

* Decomplicate things and just use pool/iocage as mount

Previous behavior could cause us headaches if exporting and importing other pools. In addition it's heavily overengineered.

FreeNAS Ticket: #41268

* We want the jails fstab in debug

FreeNAS Ticket: #49420

* Improve support for dots in jailname (iocage#629)

* Improve support for dots in jailname

* Improve support for dots in jailname (req. chngs)
skarekrow referenced this issue in truenas/iocage Oct 4, 2018
* We want unix acl's on iocage's datasets

FreeNAS Ticket: #38195

* DNS/SRV/Host fixes

- Parse out the host name, you can't query SRV records from an HTTP
  address
- Don't die if SRV records aren't found, just log it
- pkg-repository(5) doesn't appear to enforce or require SRV records
- TrueOS pkg mirrors work fine without SRV records

* Use branches with plugins

This allows us to freeze the INDEX and do development without users being impacted. In addition safe guard against plugins requiring new iocage features.

FreeNAS Ticket: #39638

* Use branches with plugins

This allows us to freeze the INDEX and do development without users being impacted. In addition safe guard against plugins requiring new iocage features.

FreeNAS Ticket: #39638

* Travis

* Check host release for plugins

- Also commonize the method

FreeNAS Ticket: #39508

* Trrrrravis

* Strip subnet of IP4_ADDR when building plugin's portal URL (iocage#586)

* Check release upon create (iocage#589)

* Always Force unmount Datasets when renaming (iocage#590)

* Remove exit_on_error

This is redundant, as it's already the case.

Related to FreeNAS TIcket: #36948

* Check DNS for plugins

- Return a more useful pkg error
- Show more information about the install process
- General formatting improvements
- Tear down jail if DHCP fails
- Tear down jail if VNET fails
- Tear down jail if pkg upgrade fails in plugin installs (required for mismatched ABI errors from previous pkg)

FreeNAS Ticket: #40106

* Flatten Python module names (iocage#592)

* rename iocage.lib to iocage_lib

* rename iocage/cli to iocage_cli

* update setup.py to iocage_lib and iocage_cli

* move manpage files to top directory

* move icage/tests/ to top level directory

* add missing dev dependency mock

* gitignore .pytest_cache/

* remove deprecated iocage/ directory

* ./iocage script for local cli testing/development

* Refactor callback method, 

- Also add callback to many places in plugins
- Correctly pass callback into fetch method
- Return the command output message for plugins

FreeNAS Ticket: #36948

* Bump copyright year (better late then never?)

* Fix a couple typos

* Add a debug command

This should help with tickets that need to supply information

* Creating duplicate plugins now name them plugin_NUM

- Fix upgrading for plugins
- Fix jail creation to be basejails for plugins (They were before, but not actually removing any data)

* We want file, not http when specified

This fixes some logic.

Closes iocage#597

* Be less nice for plugin pkg's clogging up stdout

FreeNAS TIcket: #42018

* Fix Makefile names

* Make some plugin exec changes to hopefully address FreeNAS #42018

* Prevent CPU from spinning on plugin tasks

* Fix callback usage in lib/iocage

This was incorrectly calling None on API usage.

FreeNAS Ticket: #42359

* Read output one more time after is finished (iocage#601)

* Change devfs rule generation

- DHCP is much more flexible now
- Plugins are able to have devfs rules specified in their manifests
- Plugin manifests are kept around for devfs rules now, possibly more fun later

FreeNAS Ticket: #42593

* Fix a couple issues with devfs generation

* Only show one interface for the plugin IP

Most plugins that have more then one IP use VNET, so this assumes the first interface to be the default one.

FreeNAS Ticket: #42641

* Update py-libzfs

Closes issues iocage#602, iocage#505, #153

* Fix usage of git@ repos

This allows private repos to be used as plugins.

FreeNAS Ticket: #42653

* fixes BUG, return was one level high (iocage#603)

* Merge pull request #17 from freenas/ticket-41694

Delete jails in case of plugin install failure

* Initialize reference to repo after succesful porcelain.pull() (iocage#606)

* adds thickjail feature to man (iocage#604)

* Fix debug not being as useful as it should be for non-running jails

- Also append .txt to the filenames.
- Drop jexec for most of the debug to instead opt for grabbing from the filesystem directly

FreeNAS Ticket: #45563

* Correctly create aliases for shared IP jails that don't specify iface

It seems jail(8) behavior may have changed, and this is now required for jail to create the aliases. We do a best effort attempt at using the default interface if the user doesn't supply one.

The idea is that if they didn't supply one, they may have already set the alias up themselves, so iocage will do nothing in this case.

FreeNAS Ticket: #46245

* Fixed a bug in fstab

This commit fixes a bug which caused iocage to raise an exception incase an edit/removal was required by index only and destination field was passed on as null in fstab.
Ticket: #45783

* Remove duplicate variable

This would be fatal possibly.

* Let's use the right variable

Possibly shadowing before anyways, this is better.

* Updates to iocage.8: (iocage#612)

- Update entry for ip4_addr to remove text about entering DEFAULT.
- Fix up entry for vnet_interfaces.
- Manual check of iocage.8: no issues.

* Silence!

* Improved error handling

This commit adds a try catch block to a snippet where while removing a file may raise an exception as it might not exist in the first place.
Ticket: #45805

* Potential Bug fix for jail creation

This commit fixes a potential bug which possible arose due to a race condition when the system was unable to find a newly created file. The original referenced issue couldn't be reproduced but necessary steps have been taken to avoid this behavior in this commit.
Ticket: #43119

* Test variable before splitting again, honor IP only for plugin install

This would be fatal if they didn't supply an interface, in addition we don't care about the interface here, so these block's aren't useful.

FreeNAS Ticket: #41670

* Flag debug as rootcmd (iocage#613)

* Fix branch name for plugin repo (iocage#614)

* Don't use ifconfig -f inet:cidr to extract IP/Mask... (iocage#515)

* Don't use ifconfig -f inet:cidr to extract IP/Mask, this is only supported by FreeBSD 11 and newer

* efficiencyfied a redundant operation, reordered for readability, and added comments

* Moved the [2] up to original assignment of addr_split

* Fix devfs rules that have a bracket

add path 'ulpt[0-9]*' mode 666 and such.

FreeNAS Ticket: #46920

* Use a specific exception for pool activation issues

FreeNAS Ticket: #45760

* Merge pull request #37 from freenas/ticket-47085

Bug fix for MAC Addresses

* Be a better env...izen. Less pollution!

FreeNAS Ticket: #46491

* @william-gr noted we should probably have a couple nice defaults

env shouldn't be *so* empty.

* Fix wrong property in doc

* Add "allow_mlock" as a new property (iocage#617)

Introduced in FreeBSD 12.0. Enables running services that
require mlock() in a jail (e.g. MongoDB)

* Do not set allow.mlock when userland < 12.0 (iocage#619)

* Bug fix for installing packages (iocage#607)

This commit fixes a bug which caused an exception when trying to install plugins or packages with no packages specified to be installed.
Ticket: #44735

* Retry on pkg and pkg install failures

Currently we just assume it succeeds or fails, when it could be a slight transient issue.

FreeNAS Ticket: #44834

* What! No sys.exit.

Raise instead.

FreeNAS Ticket: 44834

* Remove debug, add better messages.

* It's not even Monday!

* Tighten up reusage of code for retry

This is better, suggested by William.

* Let's add the string version of the exception too

Why not! Another idea of @william-gr

* Yeah, once is enough for the pkg error

* Add rtsold support

This works much like dhcp, just easier if you have an ipv6 network. Just set the ip6_addr to 'vnet0|accept_rtadv'

FreeNAS Ticket: #40468

* keep_jail_on_failure should be a flag

Previously it required a boolean.

FreeNAS Ticket: #48416

* Fixed iocage list multiple IP4 addresses (iocage#621)

* fixed iocage list: show multiple IP4 addresses correctly

* Fixed long lines in ioc_list.py

*  Fixed bug: Jail fails to start when depends jail is already running (iocage#608) (iocage#622)

* Fixed bug: Jail fails to start when depends jail is already running (iocage#608)

* Fixed bug iocage#608: If dependent jail does not start then parent jail is not started
* Added JailRunning exception and use it when dependent jails already started
* Added force_raise flag to default callback() function to force raising exception

* Fix exec_pre|post stop

Previous behavior was borked. It now works.

Closes iocage#611
FreeNAS TIcket: #48449

* Make default interface for vnet customizable (iocage#623)

This commit adds support for customizing the default interface for vnet which should be attached on the relevant bridge. It updates the properties of the jails by adding a new property which is used when starting vnet jails.
Ticket: #40484

* Fixed bug: setting ZFS properties via 'iocage set' raised exception (iocage#624)

* Allow unhiding tun devices with a custom prop "allow_tun"

This can be either 0 or 1. This change will also make devfs rulesets individual for each jail that sets dhcp or allow_tun. But it also means you can combine them now.

FreeNAS Ticket: #40872

* Catch by @william-gr

* exec_clean now affects exec as expected.

Upstream required -l to be passed to jexec to clean the environment. Otherwise it was just for the jail initialization.

Closes: iocage#610
FreeNAS Ticket: #48581

* Fix Traceback when pkg-static install fails (iocage#627)

* Decomplicate things and just use pool/iocage as mount

Previous behavior could cause us headaches if exporting and importing other pools. In addition it's heavily overengineered.

FreeNAS Ticket: #41268

* We want the jails fstab in debug

FreeNAS Ticket: #49420

* Improve support for dots in jailname (iocage#629)

* Improve support for dots in jailname

* Improve support for dots in jailname (req. chngs)

* Make default interface for vnet customizable

This commit adds support for customizing the default interface for vnet which should be attached on the relevant bridge. It updates the properties of the jails by adding a new property which is used when starting vnet jails.
Ticket: #40484

* This commit adds support for a default none value for vnet_default_interface property

* Don't use ifconfig -f inet:cidr to extract IP/Mask... (iocage#515)

* Don't use ifconfig -f inet:cidr to extract IP/Mask, this is only supported by FreeBSD 11 and newer

* efficiencyfied a redundant operation, reordered for readability, and added comments

* Moved the [2] up to original assignment of addr_split

* Improve validation for VNET MAC Fields

This commit improves validation for vnet mac props by ensuring that a valid mac address is specified each time with taking into account that the addresses aren't repeated.
Ticket: #45838

* Update py-libzfs.
skarekrow pushed a commit that referenced this issue Mar 6, 2019
- vnet0 was the only interface that renamed them to epairs, now all vnetN variants will (vnet0|ADDR,vnet1|ADDR, etc
- Add which nic inside the jail the vnet device on the host is associated with
- Only add default route to the first nic.

Closes #682
FreeNAS Ticket: #64113
skarekrow added a commit that referenced this issue Sep 12, 2020
Closes issues #602, #505, #153
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants