This is becoming more and more problematic. We have historically allowed - with older versions of MAAS - importing images without requiring the current os/series requirement.
After MAAS is upgraded to 3.1/3.2 this also causes the sync operations to break:
--- <exception caught here> ---
File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1416, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 491, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/usr/lib/python3/dist-packages/provisioningserver/rpc/boot_images.py", line 153, in _import_boot_images
yield deferToThread(_run_import, sources, maas_url, **proxies)
File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
result = inContext.theWork()
File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 202, in wrapper
result = func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/provisioningserver/rpc/boot_images.py", line 117, in _run_import
imported = boot_resources.import_images(sources)
File "/usr/lib/python3/dist-packages/provisioningserver/import_images/boot_resources.py", line 166, in import_images
image_descriptions = download_all_image_descriptions(
File "/usr/lib/python3/dist-packages/provisioningserver/import_images/download_descriptions.py", line 343, in download_all_image_descriptions
repo_boot = download_image_descriptions(
File "/usr/lib/python3/dist-packages/provisioningserver/import_images/download_descriptions.py", line 333, in download_image_descriptions
dumper.sync(reader, rpath)
File "/usr/lib/python3/dist-packages/provisioningserver/import_images/download_descriptions.py", line 201, in sync
super().sync(reader, path)
File "/usr/lib/python3/dist-packages/simplestreams/mirrors/__init__.py", line 86, in sync
data = util.load_content(payload)
File "/usr/lib/python3/dist-packages/simplestreams/util.py", line 332, in load_content
return json.loads(content)
File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This is becoming more and more problematic. We have historically allowed - with older versions of MAAS - importing images without requiring the current os/series requirement.
After MAAS is upgraded to 3.1/3.2 this also causes the sync operations to break:
--- <exception caught here> --- python3/ dist-packages/ twisted/ internet/ defer.py" , line 1416, in _inlineCallbacks throwExceptionI ntoGenerator( g) python3/ dist-packages/ twisted/ python/ failure. py", line 491, in throwExceptionI ntoGenerator python3/ dist-packages/ provisioningser ver/rpc/ boot_images. py", line 153, in _import_boot_images _run_import, sources, maas_url, **proxies) python3/ dist-packages/ twisted/ python/ threadpool. py", line 250, in inContext python3/ dist-packages/ twisted/ python/ threadpool. py", line 266, in <lambda> python3/ dist-packages/ twisted/ python/ context. py", line 122, in callWithContext text(). callWithContext (ctx, func, *args, **kw) python3/ dist-packages/ twisted/ python/ context. py", line 85, in callWithContext python3/ dist-packages/ provisioningser ver/utils/ twisted. py", line 202, in wrapper python3/ dist-packages/ provisioningser ver/rpc/ boot_images. py", line 117, in _run_import import_ images( sources) python3/ dist-packages/ provisioningser ver/import_ images/ boot_resources. py", line 166, in import_images descriptions = download_ all_image_ descriptions( python3/ dist-packages/ provisioningser ver/import_ images/ download_ descriptions. py", line 343, in download_ all_image_ descriptions image_descripti ons( python3/ dist-packages/ provisioningser ver/import_ images/ download_ descriptions. py", line 333, in download_ image_descripti ons sync(reader, rpath) python3/ dist-packages/ provisioningser ver/import_ images/ download_ descriptions. py", line 201, in sync ).sync( reader, path) python3/ dist-packages/ simplestreams/ mirrors/ __init_ _.py", line 86, in sync content( payload) python3/ dist-packages/ simplestreams/ util.py" , line 332, in load_content python3. 8/json/ __init_ _.py", line 357, in loads decoder. decode( s) python3. 8/json/ decoder. py", line 337, in decode python3. 8/json/ decoder. py", line 355, in raw_decode ("Expecting value", s, err.value) from None decoder. JSONDecodeError : Expecting value: line 1 column 1 (char 0)
File "/usr/lib/
result = result.
File "/usr/lib/
return g.throw(self.type, self.value, self.tb)
File "/usr/lib/
yield deferToThread(
File "/usr/lib/
result = inContext.theWork()
File "/usr/lib/
inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
File "/usr/lib/
return self.currentCon
File "/usr/lib/
return func(*args,**kw)
File "/usr/lib/
result = func(*args, **kwargs)
File "/usr/lib/
imported = boot_resources.
File "/usr/lib/
image_
File "/usr/lib/
repo_boot = download_
File "/usr/lib/
dumper.
File "/usr/lib/
super(
File "/usr/lib/
data = util.load_
File "/usr/lib/
return json.loads(content)
File "/usr/lib/
return _default_
File "/usr/lib/
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/
raise JSONDecodeError
json.
Example images that are causing this error:
"architecture" : "amd64/generic",
"resource_ uri": "/MAAS/ api/2.0/ boot-resources/ 84/",
"architecture" : "amd64/generic",
"resource_ uri": "/MAAS/ api/2.0/ boot-resources/ 40/",
{
{
"id": 84,
"type": "Uploaded",
"name": "debiantest",
"subarches": "generic",
"title": ""
},
{
"id": 40,
"type": "Uploaded",
"name": "proxmox7-2",
"subarches": "generic",
"title": ""
},
}
In other words, if an image was marked as "custom" all areas should expect names that are not following the standard os/series schema.
This will make sure nothing breaks anywhere in the system when dealing with these custom images.
MAAS 3.2 now supports base_image="custom" which is a progress, however we need to cover the full picture here.
Please let me know if there are any questions.