augur icon indicating copy to clipboard operation
augur copied to clipboard

process_scc_value_metrics seems to have trouble processing the json output

Open MoralCode opened this issue 1 week ago • 1 comments

https://github.com/sandialabs/f3m exception: MetadataException('Expecting value: line 1 column 1 (char 0) | Additional metadata: output : file or directory does not exist: /augur/facade/91065-github.com-sandialabs-f3m/f3m\n') task augur.tasks.git.scc_value_tasks.tasks.process_scc_value_metrics

Stack Trace
Traceback (most recent call last):
  File "/augur/.venv/lib/python3.11/site-packages/celery/app/trace.py", line 453, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/augur/.venv/lib/python3.11/site-packages/celery/app/trace.py", line 736, in __protected_call__
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/augur/augur/tasks/git/scc_value_tasks/tasks.py", line 13, in process_scc_value_metrics
    value_model(logger,repo_git,)
  File "/augur/augur/tasks/git/scc_value_tasks/core.py", line 25, in value_model
    required_output = parse_json_from_subprocess_call(logger,['./scc', '-f','json','--by-file', path], cwd=path_to_scc)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/augur/augur/tasks/util/worker_util.py", line 147, in parse_json_from_subprocess_call
    raise MetadataException(e, f"output : {output}")
celery.utils.serialization.UnpickleableExceptionWrapper: MetadataException('Expecting value: line 1 column 1 (char 0) | Additional metadata: output : file or directory does not exist: /augur/facade/91065-github.com-sandialabs-f3m/f3m\n')

MoralCode avatar Dec 11 '25 20:12 MoralCode

@MoralCode Suppose the repository has not been cloned yet, the facade path does not exist, or may be scc fails to run.

In these cases, would it be acceptable for the SCC value metric task to succeed by ingesting an empty result {} rather than failing the entire task ??

the current failure originates from parse_json_from_subprocess_call: as suggested in error

When the repository has not been cloned yet, the facade path is missing, or SCC is unavailable, SCC outputs plain-text error messages

then
this message is passed to the json.loads() cause the execepetion break the flow imo handle this case by returning an empty {} instead of raising an exception, so flow can continue and SCC metrics can be collected later once the repository is available.

what do you think

iGufrankhan avatar Dec 13 '25 06:12 iGufrankhan