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
Comments
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
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
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
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).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
Looking at the rule:
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.
The text was updated successfully, but these errors were encountered: