In an installation with a properly configured rucio and rucio policy package the correct extract_scope algorithm should be used by default, however, the RucioFileCatalogClient overrides this with a value from the dirac configuration system:
I think it would be better if it relied on the rucio configuration instead, which can register the correct extract_scope algorithm via the policy package.
With the CTAO rucio policy installed, which correctly handles this case, but the default configuration is overriden to use the dirac scope extraction:
❯ dirac-dms-filecatalog-cli
Starting FileCatalog console
FC:/> ls
Traceback (most recent call last):
File "/home/maxnoe/.local/conda/envs/dpps-preprod/bin/dirac-dms-filecatalog-cli", line 7, in <module>
sys.exit(main())
~~~~^^
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/site-packages/DIRAC/Core/Base/Script.py", line 74, in __call__
return entrypointFunc._func()
~~~~~~~~~~~~~~~~~~~~^^
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/site-packages/DIRAC/DataManagementSystem/scripts/dirac_dms_filecatalog_cli.py", line 89, in main
cli.cmdloop()
~~~~~~~~~~~^^
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/cmd.py", line 146, in cmdloop
stop = self.onecmd(line)
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/cmd.py", line 224, in onecmd
return func(arg)
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/site-packages/DIRAC/DataManagementSystem/Client/FileCatalogClientCLI.py", line 1190, in do_ls
result = self.fc.isFile(path)
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/site-packages/DIRAC/Resources/Catalog/Utilities.py", line 81, in processWithCheckingArguments
result = f(*argTuple, **kwargs)
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/site-packages/DIRAC/Resources/Catalog/RucioFileCatalogClient.py", line 460, in isFile
dids.append(self.__getDidsFromLfn(lfn))
~~~~~~~~~~~~~~~~~~~~~^^^^^
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/site-packages/DIRAC/Resources/Catalog/RucioFileCatalogClient.py", line 207, in __getDidsFromLfn
scope = get_scope(lfn, scopes=self.scopes, diracAlgorithm=self.diracScopeAlg)
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/site-packages/DIRAC/Resources/Catalog/RucioFileCatalogClient.py", line 41, in get_scope
scope, _ = extract_scope(did=lfn, scopes=scopes, default_extract=diracAlgorithm)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/site-packages/rucio/common/utils.py", line 670, in extract_scope
return scope_extraction_algorithms.extract_scope(did, scopes, extract_scope_convention)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/site-packages/rucio/common/utils.py", line 582, in extract_scope
return fn(did, scopes)
File "/home/maxnoe/.local/conda/envs/dpps-preprod/lib/python3.13/site-packages/rucio/common/utils.py", line 653, in extract_scope_dirac
scope = elem[1]
~~~~^^^
IndexError: list index out of range
Search before creating an issue
Bug Description
In an installation with a properly configured rucio and rucio policy package the correct
extract_scopealgorithm should be used by default, however, theRucioFileCatalogClientoverrides this with a value from the dirac configuration system:DIRAC/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py
Line 107 in 795b399
I think it would be better if it relied on the rucio configuration instead, which can register the correct extract_scope algorithm via the policy package.
Steps to Reproduce
With the CTAO rucio policy installed, which correctly handles this case, but the default configuration is overriden to use the
diracscope extraction:Expected Behavior
No response
Actual Behavior
No response
Environment
No response
Relevant Log Output
Additional Context
No response