Skip to content

Mars validation is performed on retrieve but not on archive #161

@pgeier

Description

@pgeier

What happened?

I use a local fdb to store experimental ERA6 data with a schema that is containing a new key "timespan".

The metkit version I was using did not contain this key in the language yaml yet.
It was possible to archive fields containing this key, but when retrieving a specific field was not possible, because the expansion and validation on the request failed (the key was not known).

My questions are:

  • Why is validation performed only on retrieval, but not when a field is being archived? The current behavior allows archiving "bad" messages but forbids to retrieve them. It should be the other way round.
  • What is the purpose of the schema if there is separate validation mechanism?
    The mars language describes the types and possible values for all the keys. Effectively the schema duplicate information and only specifiy a subset of keys that are used to index.

What are the steps to reproduce the bug?

Invent a new key, create a valid schema containing it, archive a field and try to retrieve it again.

Version

5.17.4

Platform (OS and architecture)

ATOS

Relevant log output

[mapg@ad6-198 mapg-20250721-CPP-20250811-125904-481e7474ac647ce014657e7c08618b22-woof]$ fdb where  --config=/lus/h2resw01/scratch/mapg/5220/mapg-20250721-CPP-20250811-125904-481e7474ac647ce014657e7c08618b22-woof/fdbs/fdb/etc/fdb/config.yaml  anoffset=3,class=e6,da
te=20220531,domain=g,expver=5220,levtype=o2d,month=5,param=262141,step=18,stream=lwda,time=1800,timespan=none,type=fc,year=2022
Exception: UserError: Cannot match [timespan] in [source,style,class,type,stream,product,section,range,use,expver,dataset,model,georef,repres,obsgroup,reportype,levtype,levelist,leve,level,levellist,param,date,year,month,hdate,offsetdate,fcmonth,fcperiod,time,offs
ettime,leadtime,opttime,step,anoffset,reference,number,quantile,domain,bcmodel,icmodel,country,grib,frequency,direction,diagnostic,iteration,channel,ident,instrument,method,origin,system,activity,experiment,generation,realization,resolution,obstype,latitude,longit
ude,accuracy,bitmap,format,frame,gaussian,area,grid,interpolation,packing,resol,rotation,intgrid,truncation,process,filter,target,fieldset,field]
Exception: UserError: UserError: Cannot match [timespan] in [source,style,class,type,stream,product,section,range,use,expver,dataset,model,georef,repres,obsgroup,reportype,levtype,levelist,leve,level,levellist,param,date,year,month,hdate,offsetdate,fcmonth,fcperio
d,time,offsettime,leadtime,opttime,step,anoffset,reference,number,quantile,domain,bcmodel,icmodel,country,grib,frequency,direction,diagnostic,iteration,channel,ident,instrument,method,origin,system,activity,experiment,generation,realization,resolution,obstype,lati
tude,longitude,accuracy,bitmap,format,frame,gaussian,area,grid,interpolation,packing,resol,rotation,intgrid,truncation,process,filter,target,fieldset,field] request=read,anoffset=3,class=e6,date=20220531,domain=g,expver=5220,levtype=o2d,month=5,param=262141,step=1
8,stream=lwda,time=1800,timespan=none,type=fc,year=2022, expanded=read,
** UserError: UserError: Cannot match [timespan] in [source,style,class,type,stream,product,section,range,use,expver,dataset,model,georef,repres,obsgroup,reportype,levtype,levelist,leve,level,levellist,param,date,year,month,hdate,offsetdate,fcmonth,fcperiod,time,o
ffsettime,leadtime,opttime,step,anoffset,reference,number,quantile,domain,bcmodel,icmodel,country,grib,frequency,direction,diagnostic,iteration,channel,ident,instrument,method,origin,system,activity,experiment,generation,realization,resolution,obstype,latitude,lon
gitude,accuracy,bitmap,format,frame,gaussian,area,grid,interpolation,packing,resol,rotation,intgrid,truncation,process,filter,target,fieldset,field] request=read,anoffset=3,class=e6,date=20220531,domain=g,expver=5220,levtype=o2d,month=5,param=262141,step=18,stream
=lwda,time=1800,timespan=none,type=fc,year=2022, expanded=read, Caught in  (/hpcperm/deploy/metabuilder/builds/ecfg-deploy-mbm_3141/aa/GNU.85/mars-server/mars-server/eckit/src/eckit/runtime/Tool.cc:31 start)
** Exception terminates fdb-where


FDBException: Error in function fdb_expand_request: UserError: UserError: Cannot match [timespan] in [style,class,type,stream,product,section,range,use,expver,dataset,model,georef,repres,obsgroup,reportype,levtype,levelist,leve,level,levellist,param,date,year,mont
h,hdate,offsetdate,fcmonth,fcperiod,time,offsettime,leadtime,opttime,step,anoffset,reference,number,quantile,domain,bcmodel,icmodel,country,grib,frequency,direction,diagnostic,iteration,channel,ident,instrument,method,origin,system,activity,experiment,generation,r
ealization,resolution,obstype,latitude,longitude,accuracy,bitmap,format,frame,gaussian,area,grid,interpolation,packing,resol,rotation,intgrid,truncation,process,filter,target,source,expect,fieldset,field,database,dbase,optimise,duplicates,padding] request=retrieve
,anoffset=3,type=fc,timespan=fs,date=20220531,step=0,year=2022,class=e6,domain=g,time=1800,param=162104,stream=lwda,expver=5220,month=5,levtype=ml,levelist=81, expanded=retrieve

Accompanying data

No response

Organisation

ECMWF

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions