[Bug]: RucioFileCatalogClient overrides rucio's builtin configuration for extract_scope mechanism

Open Beginner friendly
#8,741 2 comments 0 reactions 0 assignees View on GitHub

@martynia is already working on this.

Since Sep 16, 2026.

  • #8794 by @martynia — open

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

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

Bug
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:

https://github.com/DIRACGrid/DIRAC/blob/795b39948bd50cd33127b53513bf9e9ea1007434/src/DIRAC/Resources/Catalog/RucioFileCatalogClient.py#L107

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DIRACGrid/DIRAC

All issues in DIRACGrid/DIRAC

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.