Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading error message when moving a rule with a no-longer-valid source replica expression #4845

Closed
dchristidis opened this issue Sep 15, 2021 · 0 comments
Assignees
Milestone

Comments

@dchristidis
Copy link
Contributor

dchristidis commented Sep 15, 2021

Motivation

$ rucio move-rule E3D2B68CD15949769DE889A37474534C SWT2_CPB_DATADISK
2021-09-15 20:48:24,395 ERROR   Provided RSE expression is considered invalid.
Details: RSE Expression resulted in an empty set.
$ rucio update-rule --source-replica-expression None E3D2B68CD15949769DE889A37474534C
Updated Rule
$ rucio move-rule E3D2B68CD15949769DE889A37474534C SWT2_CPB_DATADISK
2a1035284c19482ba850719bb8a9fec7

Looking at the rule:

$ rucio rule-info E3D2B68CD15949769DE889A37474534C | grep ^Source
Source replica expression:  UKI-SCOTGRID-GLASGOW_DATADISK

This RSE has been decommissioned. In that respect, the error message is appropriate, but one assumes that it’s the destination RSE expression that is at fault.

Modification

Improve the error message or, better yet, consider making the appropriate correction automatically.

@dchristidis dchristidis changed the title Misleading error message when moving a rule with a source RSE expression Misleading error message when moving a rule with a source replica expression Sep 15, 2021
@dchristidis dchristidis changed the title Misleading error message when moving a rule with a source replica expression Misleading error message when moving a rule with a no-longer-valid source replica expression Sep 15, 2021
@bari12 bari12 self-assigned this Oct 1, 2021
@bari12 bari12 assigned ThePhisch and unassigned bari12 Feb 7, 2023
ThePhisch added a commit to ThePhisch/rucio that referenced this issue Feb 8, 2023
…cio#4845

Currently, a misleading error message is raised to the user upon
attempting to move a rule which has an invalid Source Replica Expression
(SRE). An invalid SRE is an RSE expression which evaluates to an empty
set, which can occur due to a variety of reasons.

The misleading error message informs the user that the provided `RSE
expression is considered invalid`, this is misleading, since the error
does not stem from the RSE expression provided to the `move_rule`
command but from the SRE attribute of the rule prior to moving/updating
it.

The solution is to introduce a new exception
`InvalidSourceReplicaExpression` and raise it within
`core/rule.py::add_rule`, should the attempt to parse the SRE with
`parse_expression` fail.

This commit also includes a test added to `test_rule.py::TestCore` which
simulates two ways in which the SRE might become invalid:
1) By deleting the only RSE the SRE points to.
2) By matching the RSE to the SRE via an RSE attribute but then deleting
   this RSE attribute from the RSE.
In both cases the SRE will evaluate to an empty set.
ThePhisch added a commit to ThePhisch/rucio that referenced this issue Feb 9, 2023
…cio#4845

Currently, a misleading error message is raised to the user upon
attempting to move a rule which has an invalid Source Replica
Expression. An invalid Source Replica Expression is an RSE expression
which evaluates to an empty set, which can occur due to a variety of
reasons.

The misleading error message informs the user that the provided `RSE
expression is considered invalid`, this is misleading, since the error
does not stem from the RSE expression provided to the `move_rule`
command but from the Source Replica Expression attribute of the rule
prior to moving/updating it.

The solution is to introduce a new exception
`InvalidSourceReplicaExpression` and raise it within
`core/rule.py::add_rule`, should the attempt to parse the Source Replica
Expression with `parse_expression` fail.

This commit also includes a test added to `test_rule.py::TestCore` which
simulates two ways in which the Source Replica Expression might become
invalid:
1) By deleting the only RSE the Source Replica Expression points to.
2) By matching the RSE to the Source Replica Expression via an RSE
   attribute but then deleting this RSE attribute from the RSE.
In both cases the Source Replica Expression will evaluate to an empty
set.

The test makes use of the `caches_mock`-fixture to override the internal
cache of `rse_expression_parser`. Since the parser caches previously
parsed expressions, access to the cache is necessary to clear the cache
after altering the RSE (either by deleting the RSE or by deleting an
attribute of the RSE).
ThePhisch added a commit to ThePhisch/rucio that referenced this issue Feb 14, 2023
…cio#4845

Currently, a misleading error message is raised to the user upon
attempting to move a rule which has an invalid Source Replica
Expression. An invalid Source Replica Expression is an RSE expression
which evaluates to an empty set, which can occur due to a variety of
reasons.

The misleading error message informs the user that the provided `RSE
expression is considered invalid`, this is misleading, since the error
does not stem from the RSE expression provided to the `move_rule`
command but from the Source Replica Expression attribute of the rule
prior to moving/updating it.

The solution is to introduce a new exception
`InvalidSourceReplicaExpression` and raise it within
`core/rule.py::add_rule`, should the attempt to parse the Source Replica
Expression with `parse_expression` fail.

This commit also includes a test added to `test_rule.py::TestCore` which
simulates two ways in which the Source Replica Expression might become
invalid:
1) By deleting the only RSE the Source Replica Expression points to.
2) By matching the RSE to the Source Replica Expression via an RSE
   attribute but then deleting this RSE attribute from the RSE.
In both cases the Source Replica Expression will evaluate to an empty
set.

The test makes use of the `caches_mock`-fixture to override the internal
cache of `rse_expression_parser`. Since the parser caches previously
parsed expressions, access to the cache is necessary to clear the cache
after altering the RSE (either by deleting the RSE or by deleting an
attribute of the RSE).
ThePhisch added a commit to ThePhisch/rucio that referenced this issue Feb 14, 2023
…cio#4845

Currently, a misleading error message is raised to the user upon
attempting to move a rule which has an invalid Source Replica
Expression. An invalid Source Replica Expression is an RSE expression
which evaluates to an empty set, which can occur due to a variety of
reasons.

The misleading error message informs the user that the provided `RSE
expression is considered invalid`, this is misleading, since the error
does not stem from the RSE expression provided to the `move_rule`
command. Instead, the failure lies in parsing the Source Replica
Expression (which may come as an attribute of the rule prior to
moving/updating it, or be provided by the user as an additional
argument). This failure is then not communicated to the user in a clear
manner.

The solution is to introduce a new exception
`InvalidSourceReplicaExpression` and raise it within
`core/rule.py::add_rule`, should the attempt to parse the Source Replica
Expression with `parse_expression` fail.

This commit also includes a test added to `test_rule.py::TestCore` which
simulates two ways in which the Source Replica Expression might become
invalid:
1) By deleting the only RSE the Source Replica Expression points to.
2) By matching the RSE to the Source Replica Expression via an RSE
   attribute but then deleting this RSE attribute from the RSE.
In both cases the Source Replica Expression will evaluate to an empty
set.

The test makes use of the `caches_mock`-fixture to override the internal
cache of `rse_expression_parser`. Since the parser caches previously
parsed expressions, access to the cache is necessary to clear the cache
after altering the RSE (either by deleting the RSE or by deleting an
attribute of the RSE).
ThePhisch added a commit to ThePhisch/rucio that referenced this issue Feb 14, 2023
…cio#4845

Currently, a misleading error message is raised to the user upon
attempting to move a rule which has an invalid Source Replica
Expression. An invalid Source Replica Expression is an RSE expression
which evaluates to an empty set, which can occur due to a variety of
reasons.

The misleading error message informs the user that the provided `RSE
expression is considered invalid`, this is misleading, since the error
does not stem from the RSE expression provided to the `move_rule`
command. Instead, the failure lies in parsing the Source Replica
Expression (which may come as an attribute of the rule prior to
moving/updating it, or be provided by the user as an additional
argument). This failure is then not communicated to the user in a clear
manner.

The solution is to introduce a new exception
`InvalidSourceReplicaExpression` and raise it within
`core/rule.py::add_rule`, should the attempt to parse the Source Replica
Expression with `parse_expression` fail.

This commit also includes a test added to `test_rule.py::TestCore` which
simulates two ways in which the Source Replica Expression might become
invalid:
1) By deleting the only RSE the Source Replica Expression points to.
2) By matching the RSE to the Source Replica Expression via an RSE
   attribute but then deleting this RSE attribute from the RSE.
In both cases the Source Replica Expression will evaluate to an empty
set.

The test makes use of the `caches_mock`-fixture to override the internal
cache of `rse_expression_parser`. Since the parser caches previously
parsed expressions, access to the cache is necessary to clear the cache
after altering the RSE (either by deleting the RSE or by deleting an
attribute of the RSE).
ThePhisch added a commit to ThePhisch/rucio that referenced this issue Feb 14, 2023
…cio#4845

Currently, a misleading error message is raised to the user upon
attempting to move a rule which has an invalid Source Replica
Expression. An invalid Source Replica Expression is an RSE expression
which evaluates to an empty set, which can occur due to a variety of
reasons.

The misleading error message informs the user that the provided `RSE
expression is considered invalid`, this is misleading, since the error
does not stem from the RSE expression provided to the `move_rule`
command. Instead, the failure lies in parsing the Source Replica
Expression (which may come as an attribute of the rule prior to
moving/updating it, or be provided by the user as an additional
argument). This failure is then not communicated to the user in a clear
manner.

The solution is to introduce a new exception
`InvalidSourceReplicaExpression` and raise it within
`core/rule.py::add_rule`, should the attempt to parse the Source Replica
Expression with `parse_expression` fail.

This commit also includes a test added to `test_rule.py::TestCore` which
simulates two ways in which the Source Replica Expression might become
invalid:
1) By deleting the only RSE the Source Replica Expression points to.
2) By matching the RSE to the Source Replica Expression via an RSE
   attribute but then deleting this RSE attribute from the RSE.
In both cases the Source Replica Expression will evaluate to an empty
set.

The test makes use of the `caches_mock`-fixture to override the internal
cache of `rse_expression_parser`. Since the parser caches previously
parsed expressions, access to the cache is necessary to clear the cache
after altering the RSE (either by deleting the RSE or by deleting an
attribute of the RSE).
ThePhisch added a commit to ThePhisch/rucio that referenced this issue Feb 16, 2023
…cio#4845

Currently, a misleading error message is raised to the user upon
attempting to move a rule which has an invalid Source Replica
Expression. An invalid Source Replica Expression is an RSE expression
which evaluates to an empty set, which can occur due to a variety of
reasons.

The error message informs the user that the provided `RSE expression is
considered invalid`, this is misleading, since the error does not stem
from the RSE expression provided to the `move_rule` command. Instead,
the failure lies in parsing the Source Replica Expression (which may
come as an attribute of the rule prior to moving/updating it, or be
provided by the user as an additional argument). This failure is then
not communicated to the user in a clear manner.

The solution is to introduce a new exception
`InvalidSourceReplicaExpression` and raise it within
`core/rule.py::add_rule`, should the attempt to parse the Source Replica
Expression with `parse_expression` fail.

This commit also includes a test added to `test_rule.py::TestCore` which
simulates two ways in which the Source Replica Expression might become
invalid:
1) By deleting the only RSE the Source Replica Expression points to.
2) By matching the RSE to the Source Replica Expression via an RSE
   attribute but then deleting this RSE attribute from the RSE.
In both cases the Source Replica Expression will evaluate to an empty
set.

The test makes use of the `caches_mock`-fixture to override the internal
cache of `rse_expression_parser`. Since the parser caches previously
parsed expressions, access to the cache is necessary to clear the cache
after altering the RSE (either by deleting the RSE or by deleting an
attribute of the RSE).
ThePhisch added a commit to ThePhisch/rucio that referenced this issue Feb 17, 2023
…cio#4845

Currently, a misleading error message is raised to the user upon
attempting to move a rule which has an invalid Source Replica
Expression. An invalid Source Replica Expression is an RSE expression
which evaluates to an empty set, which can occur due to a variety of
reasons.

The error message informs the user that the provided `RSE expression is
considered invalid`, this is misleading, since the error does not stem
from the RSE expression provided to the `move_rule` command. Instead,
the failure lies in parsing the Source Replica Expression (which may
come as an attribute of the rule prior to moving/updating it, or be
provided by the user as an additional argument). This failure is then
not communicated to the user in a clear manner.

The solution is to introduce a new exception
`InvalidSourceReplicaExpression` and raise it within
`core/rule.py::add_rule`, should the attempt to parse the Source Replica
Expression with `parse_expression` fail.

This commit also includes a test added to `test_rule.py::TestCore` which
simulates two ways in which the Source Replica Expression might become
invalid:
1) By deleting the only RSE the Source Replica Expression points to.
2) By matching the RSE to the Source Replica Expression via an RSE
   attribute but then deleting this RSE attribute from the RSE.
In both cases the Source Replica Expression will evaluate to an empty
set.

The test makes use of the `caches_mock`-fixture to override the internal
cache of `rse_expression_parser`. Since the parser caches previously
parsed expressions, access to the cache is necessary to clear the cache
after altering the RSE (either by deleting the RSE or by deleting an
attribute of the RSE).
ThePhisch added a commit to ThePhisch/rucio that referenced this issue Feb 17, 2023
…cio#4845

Currently, a misleading error message is raised to the user upon
attempting to move a rule which has an invalid Source Replica
Expression. An invalid Source Replica Expression is an RSE expression
which evaluates to an empty set, which can occur due to a variety of
reasons.

The error message informs the user that the provided `RSE expression is
considered invalid`, this is misleading, since the error does not stem
from the RSE expression provided to the `move_rule` command. Instead,
the failure lies in parsing the Source Replica Expression (which may
come as an attribute of the rule prior to moving/updating it, or be
provided by the user as an additional argument). This failure is then
not communicated to the user in a clear manner.

The solution is to introduce a new exception
`InvalidSourceReplicaExpression` and raise it within
`core/rule.py::add_rule`, should the attempt to parse the Source Replica
Expression with `parse_expression` fail.

This commit also includes a test added to `test_rule.py::TestCore` which
simulates two ways in which the Source Replica Expression might become
invalid:
1) By deleting the only RSE the Source Replica Expression points to.
2) By matching the RSE to the Source Replica Expression via an RSE
   attribute but then deleting this RSE attribute from the RSE.
In both cases the Source Replica Expression will evaluate to an empty
set.

The test makes use of the `caches_mock`-fixture to override the internal
cache of `rse_expression_parser`. Since the parser caches previously
parsed expressions, access to the cache is necessary to clear the cache
after altering the RSE (either by deleting the RSE or by deleting an
attribute of the RSE).
@bari12 bari12 closed this as completed in ea4d2c7 Feb 27, 2023
bari12 pushed a commit that referenced this issue Feb 27, 2023


Currently, a misleading error message is raised to the user upon
attempting to move a rule which has an invalid Source Replica
Expression. An invalid Source Replica Expression is an RSE expression
which evaluates to an empty set, which can occur due to a variety of
reasons.

The error message informs the user that the provided `RSE expression is
considered invalid`, this is misleading, since the error does not stem
from the RSE expression provided to the `move_rule` command. Instead,
the failure lies in parsing the Source Replica Expression (which may
come as an attribute of the rule prior to moving/updating it, or be
provided by the user as an additional argument). This failure is then
not communicated to the user in a clear manner.

The solution is to introduce a new exception
`InvalidSourceReplicaExpression` and raise it within
`core/rule.py::add_rule`, should the attempt to parse the Source Replica
Expression with `parse_expression` fail.

This commit also includes a test added to `test_rule.py::TestCore` which
simulates two ways in which the Source Replica Expression might become
invalid:
1) By deleting the only RSE the Source Replica Expression points to.
2) By matching the RSE to the Source Replica Expression via an RSE
   attribute but then deleting this RSE attribute from the RSE.
In both cases the Source Replica Expression will evaluate to an empty
set.

The test makes use of the `caches_mock`-fixture to override the internal
cache of `rse_expression_parser`. Since the parser caches previously
parsed expressions, access to the cache is necessary to clear the cache
after altering the RSE (either by deleting the RSE or by deleting an
attribute of the RSE).
@bari12 bari12 added this to the 1.30.6 milestone Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants