Comment 3 for bug 1982866

Revision history for this message
Alan Baghumian (alanbach) wrote :

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)

Example images that are causing this error:
{
   {
       "id": 84,
       "type": "Uploaded",
       "name": "debiantest",
       "architecture": "amd64/generic",
       "resource_uri": "/MAAS/api/2.0/boot-resources/84/",
       "subarches": "generic",
       "title": ""
   },
   {
       "id": 40,
       "type": "Uploaded",
       "name": "proxmox7-2",
       "architecture": "amd64/generic",
       "resource_uri": "/MAAS/api/2.0/boot-resources/40/",
       "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.