dmwm / PHEDEX

CMS data-placement suite
8 stars 18 forks source link

PhEDEx data service API pfn2lfn fails to validate the PFN parameter #1115

Open nataliaratnikova opened 5 years ago

nataliaratnikova commented 5 years ago

Example: https://cmsweb.cern.ch/phedex/datasvc/perl/prod/pfn2lfn?node=T0_CH_CERN_Export&protocol=srmv2&pfn=/castor/cern.ch/cms/store/PhEDEx_LoadTest07_4/LoadTest07_CERN_60

Gives output:

400 Bad Request

developer error: 'pfn' is not a known validation function\n

nataliaratnikova commented 5 years ago

This API has probably never worked as there is no validation function for the required "pfn" parameter. The fix would be to either add "pfn" to COMMON_VALIDATION hash in https://github.com/dmwm/PHEDEX/blob/master/perl_lib/PHEDEX/Web/Util.pm#L50-L92 , or remove the API from the cmsweb release, e.g. here: https://github.com/cms-sw/cmsdist/blob/comp_gcc481/PHEDEX-datasvc.spec#L40 https://github.com/cms-sw/cmsdist/blob/comp_gcc630/PHEDEX-datasvc.spec#L46

The "pfn" validation function is much more tricky than "lfn", as depending on the format of the protocol it may contain various symbols. The best we could do is to get the currently used patterns from the TFC cached in TMDB.