Project

General

Profile

Bug #24521

Fix traceback when creating jail using iocage

Added by The m0nkey_ over 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
No priority
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Trying to create a jail using iocage generates a traceback.

[root@freenas ~]# iocage create tag=test ip4_addr="em0|192.168.43.12" -r 11.0-RELEASE                                               
Traceback (most recent call last):                                                                                                  
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_json.py", line 544, in json_check_config                              
    release = conf["release"]                                                                                                       
KeyError: 'release'                                                                                                                 

During handling of the above exception, another exception occurred:                                                                 

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/core.py", line 722, in __call__                                                
    return self.main(*args, **kwargs)                                                                                               
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main                                                    
    rv = self.invoke(ctx)                                                                                                           
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke                                                 
    return _process_result(sub_ctx.command.invoke(sub_ctx))                                                                         
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke                                                  
    return ctx.invoke(self.callback, **ctx.params)                                                                                  
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke                                                  
    return callback(*args, **kwargs)                                                                                                
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/create.py", line 86, in cli                                               
    err, msg = ioc.IOCage().create(release, props, pkglist=pkglist,                                                                 
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 68, in __init__                                          
    self.jails, self._paths = self.list("uuid")                                                                                     
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 468, in list                                             
    return ioc_list.IOCList(lst_type, header, long, sort).list_datasets()                                                           
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_list.py", line 53, in list_datasets                                   
    conf = iocage.lib.ioc_json.IOCJson(jail).json_load()                                                                            
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_json.py", line 256, in json_load                                      
    conf = self.json_check_config(conf, version)                                                                                    
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_json.py", line 548, in json_check_config                              
    freebsd_version = f"{iocroot}/releases/{conf['release']}" \                                                                     
KeyError: 'release'                                                                                                                 
[root@freenas ~]#    

Related issues

Related to FreeNAS - Bug #25156: iocage KeyError Closed: Duplicate2017-07-15

History

#1 Updated by Brandon Schneider over 1 year ago

  • Status changed from Unscreened to Closed: Cannot reproduce

I can't reproduce this on the latest nightly, what version are you using?

I'd try a iocage clean -af and attempt this again.

#2 Updated by The m0nkey_ over 1 year ago

Previous attempt was a upgrade from 9.10.2-U5 to 11-STABLE.

This attempt is a fresh install in 11-STABLE.

root@freenas:~ # iocage activate tank
ZFS pool 'tank' successfully activated.
root@freenas:~ # iocage fetch
Creating tank/iocage
Creating tank/iocage/download
Creating tank/iocage/images
Creating tank/iocage/jails
Creating tank/iocage/log
Creating tank/iocage/releases
Creating tank/iocage/templates
[0] 9.3-RELEASE (EOL)
[1] 10.1-RELEASE (EOL)
[2] 10.2-RELEASE (EOL)
[3] 10.3-RELEASE
[4] 11.0-RELEASE

Which release do you want to fetch? (11.0)
Type EXIT to quit: 4
Fetching: 11.0-RELEASE

Downloading: MANIFEST: 100% 10.5Kbit/s Elapsed: 00:00 Remaining: 00:00
Downloading: base.txz: 100% 4.29Mbit/s Elapsed: 00:22 Remaining: 00:00
Downloading: lib32.txz: 100% 2.82Mbit/s Elapsed: 00:06 Remaining: 00:00
Downloading: doc.txz: 100% 1.17Mbit/s Elapsed: 00:01 Remaining: 00:00
Extracting: base.txz...
Extracting: lib32.txz...
Extracting: doc.txz...

  [..snip..]

/usr/share/zoneinfo/Pacific/Easter
/usr/share/zoneinfo/Pacific/Tongatapu
/usr/share/zoneinfo/zone.tab
src component not installed, skipped
Installing updates... done.
root@freenas:~ # iocage create tag=testjail ip4_addr="em0:192.168.32.221" -r 11.0-RELEASE
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_json.py", line 544, in json_check_config
    release = conf["release"]
KeyError: 'release'

During handling of the above exception, another exception occurred:

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/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/create.py", line 86, in cli
    err, msg = ioc.IOCage().create(release, props, pkglist=pkglist,
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 68, in __init__
    self.jails, self._paths = self.list("uuid")
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 468, in list
    return ioc_list.IOCList(lst_type, header, long, sort).list_datasets()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_list.py", line 53, in list_datasets
    conf = iocage.lib.ioc_json.IOCJson(jail).json_load()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_json.py", line 256, in json_load
    conf = self.json_check_config(conf, version)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_json.py", line 548, in json_check_config
    freebsd_version = f"{iocroot}/releases/{conf['release']}" \
KeyError: 'release'
root@freenas:~ #

#3 Updated by Dru Lavigne over 1 year ago

  • Status changed from Closed: Cannot reproduce to Unscreened

#4 Updated by Brandon Schneider over 1 year ago

  • Status changed from Unscreened to Fix In Progress

I see the issue I believe, you're supplying ip4_addr="em0:192.168.32.221" instead of ip4_addr="em0|192.168.32.221". This should be handled better, so I'll fix it upstream and that will trickle it's way in to FreeNAS when I release 0.9.9.

#5 Updated by The m0nkey_ over 1 year ago

It seems that using | or : generates the same trace back in my case.

#6 Updated by Dru Lavigne over 1 year ago

#7 Updated by John Ramsden over 1 year ago

I seem to be running into this problem, or at least a related problem.

On a clean system running

iocage fetch
I get the following:

iocage fetch
[0] 1
[0] 1
[2] .
[0] 1
[4] -
[5] R
[6] E
[7] L
[6] E
[9] A
[10] S
[6] E

Which release do you want to fetch? (11.0)
Type EXIT to quit: 11.0
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_fetch.py", line 155, in __fetch_validate_release__
    releases.index(self.release)
ValueError: substring not found

During handling of the above exception, another exception occurred:

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/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/fetch.py", line 135, in cli
    eol=eol, files=files).fetch_release()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_fetch.py", line 230, in fetch_release
    self.fetch_ftp_release(eol, _list=_list)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_fetch.py", line 412, in fetch_ftp_release
    self.release = self.__fetch_validate_release__(releases)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_fetch.py", line 157, in __fetch_validate_release__
    raise RuntimeError(err)
RuntimeError: substring not found

#8 Updated by Brandon Schneider over 1 year ago

  • Status changed from Fix In Progress to Ready For Release
  • Target version set to 11.1

All related issues are fixed in the latest nightlies.

#9 Updated by Dru Lavigne over 1 year ago

  • Subject changed from Creating jail using iocage generates traceback to Fix traceback when creating jail using iocage

#10 Updated by Dru Lavigne about 1 year ago

  • Target version changed from 11.1 to 11.1-BETA1

#11 Updated by Dru Lavigne about 1 year ago

  • Status changed from Ready For Release to Resolved

#12 Updated by Joe Maloney about 1 year ago

  • Needs QA changed from Yes to No
  • QA Status Test Passes FreeNAS added
  • QA Status deleted (Not Tested)

Also available in: Atom PDF