dmwm / WMCore

Core workflow management components for CMS.
Apache License 2.0
46 stars 107 forks source link

MSOutputConsumer fails with KeyError for DQMHarvest workflows #9727

Closed amaltaro closed 4 years ago

amaltaro commented 4 years ago

Impact of the bug ReqMgr2MS (MSOutputConsumer)

Describe the bug DQMHarvest workflows do not have any output datasets, which makes MSOutput to fail when preparing the output data placement.

How to reproduce it Run a DQMHarvest workflow until it completes

Expected behavior No output data placement should be performed, and the mongodb record needs to be marked as transferStatus="done" (or whatever final status we decided to use here), such that it's not picked by this thread in the next cycle.

Additional context and error message Fresh traceback:

2020-06-06 05:05:31,310:ERROR:MSOutput: Could not create DDMReq for Workflow: amaltaro_DQMHarvesting_RunWhitelist_Agent112_Validation_170413_130804_3940Error: "ERROR: Missing Mandatory Fields: ['item'] for: {'item': [], 'cache': None, 'group': 'DataOps', 'site': ['T2_*', 'T1_*_Disk'], 'n': None}"
Traceback (most recent call last):
  File "/data/srv/beHG2006h/sw/slc7_amd64_gcc630/cms/reqmgr2ms/0.2.5.pre5/lib/python2.7/site-packages/WMCore/MicroService/Unified/MSOutput.py", line 317, in makeSubscriptions
    site=workflow['destination'])
  File "/data/srv/beHG2006h/sw/slc7_amd64_gcc630/cms/reqmgr2ms/0.2.5.pre5/lib/python2.7/site-packages/WMCore/Services/DDM/DDM.py", line 106, in __init__
    raise KeyError(msg)
KeyError: "ERROR: Missing Mandatory Fields: ['item'] for: {'item': [], 'cache': None, 'group': 'DataOps', 'site': ['T2_*', 'T1_*_Disk'], 'n': None}"
2020-06-06 05:05:31,311:INFO:MSOutput: MSOutputConsumer:140182742312704@vocms0731.cern.ch: PipelineNonRelVal: Processed 'msOutDoc' with '_id': amaltaro_DQMHarvesting_RunWhitelist_Agent112_Validation_170413_130804_3940.
2020-06-06 05:05:31,311:DEBUG:MSOutput: {u'Campaign': u'Agent112_Validation',
 u'OutputDatasets': [],
 u'RequestName': u'amaltaro_DQMHarvesting_RunWhitelist_Agent112_Validation_170413_130804_3940',
 u'_id': u'amaltaro_DQMHarvesting_RunWhitelist_Agent112_Validation_170413_130804_3940',
 u'campaignOutputMap': [{u'campaignName': u'Agent112_Validation',
                         u'datasets': []}],
 u'creationTime': 1591290411,
 u'destination': None,
 u'destinationOutputMap': None,
 u'isRelVal': False,
 u'isTaken': False,
 u'isTakenBy': None,
 u'lastUpdate': 1591412731,
 u'numberOfCopies': None,
 u'transferIDs': None,
 u'transferStatus': None}
2020-06-06 05:05:31,312:INFO:MSOutput:
amaltaro commented 4 years ago

BTW, we know there are other issues that need to be created for MSOutput. Please create those before we forget them ;)