Skip to content

Error when calling metrics-aggregator.py #11

@deligianp

Description

@deligianp

Calling metrics-aggregator.py for certain use cases raises the following error. The error was raised for executions of steps of a workflow but it can also be observed on the metrics that were tracked for a simple sleep command.

Steps to reproduce

execution-metrics-collector.py metrics_dir/ sleep 2
metrics-aggregator.py metrics_dir/2025_12_03-11_51-31136/ aggregated_metrics 85.0

Reported error

Traceback (most recent call last):
  File "/home/user/TREECRIPT/lib/python3.12/site-packages/networkx/classes/digraph.py", line 937, in successors
    return iter(self._succ[n])
                ~~~~~~~~~~^^^
KeyError: '1764759078.48_31136'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/TREECRIPT/bin/metrics-aggregator.py", line 24, in <module>
    main()
  File "/home/user/TREECRIPT/lib/python3.12/site-packages/treecript/aggregator.py", line 601, in main
    metrics_aggregator(
  File "/home/user/TREECRIPT/lib/python3.12/site-packages/treecript/aggregator.py", line 493, in metrics_aggregator
    for child_id in nx.descendants(pids_tree, node_id):
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/TREECRIPT/lib/python3.12/site-packages/networkx/utils/decorators.py", line 784, in func
    return argmap._lazy_compile(__wrapper)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<class 'networkx.utils.decorators.argmap'> compilation 20", line 3, in argmap_descendants_17
  File "/home/user/TREECRIPT/lib/python3.12/site-packages/networkx/utils/backends.py", line 551, in _call_if_no_backends_installed
    return self.orig_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/TREECRIPT/lib/python3.12/site-packages/networkx/algorithms/dag.py", line 72, in descendants
    return {child for parent, child in nx.bfs_edges(G, source)}
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/TREECRIPT/lib/python3.12/site-packages/networkx/algorithms/traversal/breadth_first_search.py", line 194, in bfs_edges
    yield from generic_bfs_edges(G, source, successors, depth_limit)
  File "/home/user/TREECRIPT/lib/python3.12/site-packages/networkx/algorithms/traversal/breadth_first_search.py", line 93, in generic_bfs_edges
    next_parents_children = [(source, neighbors(source))]
                                      ^^^^^^^^^^^^^^^^^
  File "/home/user/TREECRIPT/lib/python3.12/site-packages/networkx/classes/digraph.py", line 939, in successors
    raise NetworkXError(f"The node {n} is not in the digraph.") from err
networkx.exception.NetworkXError: The node 1764759078.48_31136 is not in the digraph.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions