[Bug]: RucioFileCatalogClient overrides rucio's builtin configuration for extract_scope mechanism
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- backend, distributed-systems
Research direction
Start in src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py, especially the configuration at line 107, get_scope, and __getDidsFromLfn, then reproduce the issue with dirac-dms-filecatalog-cli. Done means the client no longer overrides Rucio's configured extract_scope policy and the file-catalog lookup works with the CTAO policy.
Written by the indexing model from the issue text.
Description
Search before creating an issue
- I have searched existing issues and confirmed this is not a duplicate
Bug Description
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.
Steps to Reproduce
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
Expected Behavior
No response
Actual Behavior
No response
Environment
No response
Relevant Log Output
Additional Context
No response
- Dominant language
- Python
- Stars
- 126
- Forks
- 191
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 33
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DIRACGrid/DIRAC
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100