Skip to content

[Bug] "Target substrate not found" in command "calm decompile bp" #330

@nx-sbourdeaud

Description

@nx-sbourdeaud

Describe the bug
When decompiling a multi-vm blueprint from an NCM 4.2.0 instance using NCM DSL 4.1.1, getting a "Target substrate not found" error (blueprint works fine in NCM).

Branch/Container
Branch or Container where it is happening: master 4.1.1

To Reproduce
Steps to reproduce the behavior:

  1. Import attached json blueprint
  2. run calm decompile on this bp
  3. See error

Expected behavior
Working blueprint should decompile fine.

Findings/Troubleshooting Done
n/a

Available Logs/Data

#calm decompile bp vendure                                                                                                                                                                                                                                                                                       
[2025-07-17 06:27:36] [INFO] [calm.dsl.cli.bps:831] vendure found 
[2025-07-17 06:27:39] [INFO] [calm.dsl.cli.bps:728] Decompiling blueprint vendure
[2025-07-17 06:27:39] [WARNING] [calm.dsl.builtins.models.object_type:90] Additional Property (upgrade_runbook) found
[2025-07-17 06:27:39] [WARNING] [calm.dsl.builtins.models.object_type:90] Additional Property (upgrade_runbook) found
[2025-07-17 06:27:39] [WARNING] [calm.dsl.builtins.models.object_type:90] Additional Property (upgrade_runbook) found
[2025-07-17 06:27:39] [INFO] [calm.dsl.decompile.decompile_render:70] Creating blueprint directory
[2025-07-17 06:27:39] [INFO] [calm.dsl.decompile.decompile_render:72] Rendering blueprint file template
Traceback (most recent call last):
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/venv/bin/calm", line 33, in <module>
    sys.exit(load_entry_point('calm.dsl', 'console_scripts', 'calm')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/venv/lib/python3.13/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/venv/lib/python3.13/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/cli/utils.py", line 147, in invoke
    return super().invoke(ctx)
           ~~~~~~~~~~~~~~^^^^^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/venv/lib/python3.13/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/cli/utils.py", line 147, in invoke
    return super().invoke(ctx)
           ~~~~~~~~~~~~~~^^^^^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/venv/lib/python3.13/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/venv/lib/python3.13/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/venv/lib/python3.13/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/cli/bp_commands.py", line 168, in _decompile_bp
    decompile_bp(name, bp_file, with_secrets, prefix, bp_dir, passphrase, no_format)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/cli/bps.py", line 563, in decompile_bp
    decompile_bp_from_server(
    ~~~~~~~~~~~~~~~~~~~~~~~~^
        name=name,
        ^^^^^^^^^^
    ...<3 lines>...
        no_format=no_format,
        ^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/cli/bps.py", line 615, in decompile_bp_from_server
    _decompile_bp(
    ~~~~~~~~~~~~~^
        bp_payload=exported_bp_res_payload,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
        **kwargs,
        ^^^^^^^^^
    )
    ^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/cli/bps.py", line 747, in _decompile_bp
    create_bp_dir(
    ~~~~~~~~~~~~~^
        bp_cls=bp_cls,
        ^^^^^^^^^^^^^^
    ...<4 lines>...
        no_format=no_format,
        ^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/decompile/decompile_render.py", line 73, in create_bp_dir
    bp_data = render_bp_file_template(
        cls=bp_cls,
    ...<2 lines>...
        contains_encrypted_secrets=contains_encrypted_secrets,
    )
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/decompile/bp_file_helper.py", line 212, in render_bp_file_template
    dependepent_entities[k] = render_package_template(
                              ~~~~~~~~~~~~~~~~~~~~~~~^
        v, secrets_dict, endpoints=endpoints, ep_list=ep_list
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/decompile/package.py", line 51, in render_package_template
    render_action_template(
    ~~~~~~~~~~~~~~~~~~~~~~^
        cls.__install__,
        ^^^^^^^^^^^^^^^^
    ...<4 lines>...
        ep_list=ep_list,
        ^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/decompile/action.py", line 59, in render_action_template
    render_task_tree_template(
    ~~~~~~~~~~~~~~~~~~~~~~~~~^
        root_node,
        ^^^^^^^^^^
    ...<9 lines>...
        rendered_credential_list=rendered_credential_list,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/decompile/task_tree.py", line 90, in render_task_tree_template
    rendered_tasks[task.get("task_name")] = render_task_template(
                                            ~~~~~~~~~~~~~~~~~~~~^
        task.get("task_data"),
        ^^^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
        rendered_credential_list=rendered_credential_list,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/stephan.bourdea/Documents/github/solutions-hc-lab/ncm/mid-market/calm-dsl/calm/dsl/decompile/task.py", line 242, in render_task_template
    raise ValueError("Target substrate not found")
ValueError: Target substrate not found

#calm --version       
calm, version 4.1.1

** System Configuration:**

  • OS: Mac OSX Sequoia 15.5
  • Python: 3.13.3

Additional context
n/a

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions