"WorkflowNormalizer" error with parser

Hi all.
I’m writing a parser for software called Lightforge. Uploading some files to our Oasis to test this parser failed with some “WorkflowNormalizer” error:

root":{
“errors”:string"normalizer failed with exception"
“event”:string"process failed"
“proc”:string"Entry"
“process”:string"process_entry"
“process_worker_id”:string"ChBgKW3vT6OZZde5-oAw2Q"
“parser”:string"parsers/lightforge"
“error”:string"‘NoneType’ object has no attribute ‘normalize’"
“normalizer”:string"WorkflowNormalizer"
“step”:string"WorkflowNormalizer"
“logger”:string"nomad.processing"
“exception”:string"Traceback (most recent call last): File “/usr/local/lib/python3.9/site-packages/nomad/processing/data.py”, line 1228, in normalizing normalizer(self._parser_results).normalize(logger=logger) File “/usr/local/lib/python3.9/site-packages/nomad/normalizing/workflow.py”, line 86, in normalize workflow.normalize(self.entry_archive, logger) AttributeError: ‘NoneType’ object has no attribute ‘normalize’"
“timestamp”:string"2023-11-15 15:34.20"
“level”:string"ERROR"
}

Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/nomad/processing/data.py”, line 1228, in normalizing
normalizer(self._parser_results).normalize(logger=logger)
File “/usr/local/lib/python3.9/site-packages/nomad/normalizing/workflow.py”, line 86, in normalize
workflow.normalize(self.entry_archive, logger)
AttributeError: ‘NoneType’ object has no attribute ‘normalize’

“root”:{
“event”:string"processing error"
“level”:string"ERROR"
“timestamp”:string"2023-11-15T15:34:14.274000+00:00"
“processing_errors”:[
0:
string"process failed"
]

In the Lightforge parser, I have not specified anything related to workflow, same as with my other parsers (which work and dont cause this error message). However, as a side note, all my other parsers add “single point” to entries automatically, dont know whether this has to do with my problem here.
Would be great if someone could help here, thanks in advance!
Best
Fabian

The workflow.py normalizer always runs on all archives that have a .run section in them. From the stacktrace, I speculate that _resolve_workflow in workflow.py returns None. This eventually causes the exception. I guess it is this part here:

        # resolve it from parser
        workflow = None
        try:
            program_name = self.entry_archive.run[-1].program.name
        except Exception:
            return

You probably don’t have a run.program section in your archive? If you put a program in there and have a calculation sub section in your run, it should produce a SinglePoint workflow.

The workflow normalisation makes some assumptions on the archive, like having a program section. Maybe that is not always desirable and we should put an escape hatch in there somehow.

Maybe i am wrong; your parser code and an example archive before normalization (nomad parse --skip-normalizers --show-archive ...) would be helpful.