Skip to content

[Core][Core-worker] de-escalate the error message when worker is accessed after shutdown. - #20049

Merged
scv119 merged 2 commits into
ray-project:masterfrom
scv119:de-escalate
Nov 4, 2021
Merged

scv119 merged 2 commits into
ray-project:masterfrom
scv119:de-escalate

Conversation

@scv119

@scv119 scv119 commented Nov 4, 2021

Copy link
Copy Markdown
Contributor

Why are these changes needed?

This error is not actionable; change it to warning for better usability.

Related issue number

Checks

@rkooo567

rkooo567 commented Nov 4, 2021

Copy link
Copy Markdown
Contributor

Lint failure for some reasons?

@scv119

scv119 commented Nov 4, 2021

Copy link
Copy Markdown
Contributor Author

build failures are not related.

@scv119
scv119 merged commit 5c0e012 into ray-project:master Nov 4, 2021
dstrodtman added a commit that referenced this pull request Oct 1, 2026
…ch fails (#66624)

## What

Two changes to the postmerge `:book: doc: apply redirects` step in
`.buildkite/doc.rayci.yml`:

1. Fail the step at the Secrets Manager fetch, with a message that names
the secret and the permission it needs, when `get-secret-value` fails or
returns an empty value. Previously `export RTD_API_TOKEN="$(aws ...)"`
returned `export`'s status rather than `aws`'s. The step fell through to
`rtd-redirects apply` with an empty token, which failed with
`RTD_API_TOKEN is not set. Export your RtD API token before running.`
That message reads like a local-environment problem and hides the real
AWS error a few lines up.
2. Document the IAM permission the runner role needs, in the step
comment.

## Why: the step has never been able to read its token

Every master postmerge run of this step since it was enabled in #66024
and reworked in #66427 has failed at the secret fetch, for example
[postmerge
#20026](https://buildkite.com/ray-project/postmerge/builds/20026) and
[#20049](https://buildkite.com/ray-project/postmerge/builds/20049). The
job log shows:

```
An error occurred (AccessDeniedException) when calling the GetSecretValue operation:
User: arn:aws:sts::029272617770:assumed-role/bk-runner-queue-small-branch-Role/i-... is not authorized to perform:
secretsmanager:GetSecretValue on resource: oss-ci/rtd-api-token
```

The `oss-ci/rtd-api-token` secret exists, but the runner role can't read
it. Release-branch builds such as
[#20050](https://buildkite.com/ray-project/postmerge/builds/20050)
aren't affected, because the step's branch guard skips them before the
fetch.

## IAM grant needed (CI infra)

This PR doesn't fix the access. It makes the failure say what's wrong.
For the step to work, the CI stack needs this grant:

- **Principal:** `bk-runner-queue-small-branch-Role`, the role of the
postmerge runner queue this step lands on. The step sets no
`instance_type`, so it runs on the default small queue.
- **Action:** `secretsmanager:GetSecretValue`
- **Resource:** the `oss-ci/rtd-api-token` secret in `us-west-2`,
account `029272617770`. Scope it to that one secret ARN, not a wildcard.
The token is deliberately isolated from other steps.
- If the secret uses a customer-managed KMS key, the role also needs
`kms:Decrypt` on that key.

`fossa analyze` (`.buildkite/others.rayci.yml`) reads
`oss-ci/fossa-api-key` the same way from an `instance_type: small` step,
so the grant should follow whatever pattern covers that secret.

Until the grant lands, this step keeps failing on master postmerge
builds, now with a clear message. It doesn't block master. If the
release-candidate noise is a problem in the meantime, re-adding a
`disabled` tag to the step turns it off, as the step comment describes.

## Not a duplicate

No open PR touches the redirect apply step. This follows up on #66024
and #66427.

## Testing

- Pulled the command block out of the YAML, replaced `$$` with `$` as
Buildkite does, and ran the apply branch under `bash -elc` with a stub
`aws`:
- `AccessDeniedException`, exit 254: the step prints the new error and
exits 1 without calling `apply`.
  - Empty secret value: the step prints the new error and exits 1.
- Non-empty value: the token is exported and reaches `rtd-redirects
apply`.
- `pre-commit run --files .buildkite/doc.rayci.yml`: the generic
whitespace, end-of-file, and large-file hooks passed. No
language-specific hook applies to this file.
- No Buildkite run. The step is `skip-on-premerge`, so a PR build can't
exercise it. Its first real run is the next master postmerge build after
merge.

## AI assistance

AI assistance (Claude Code) prepared this change and ran the checks
above. The submitter reviews every changed line before merge.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ch fails (ray-project#66624)

## What

Two changes to the postmerge `:book: doc: apply redirects` step in
`.buildkite/doc.rayci.yml`:

1. Fail the step at the Secrets Manager fetch, with a message that names
the secret and the permission it needs, when `get-secret-value` fails or
returns an empty value. Previously `export RTD_API_TOKEN="$(aws ...)"`
returned `export`'s status rather than `aws`'s. The step fell through to
`rtd-redirects apply` with an empty token, which failed with
`RTD_API_TOKEN is not set. Export your RtD API token before running.`
That message reads like a local-environment problem and hides the real
AWS error a few lines up.
2. Document the IAM permission the runner role needs, in the step
comment.

## Why: the step has never been able to read its token

Every master postmerge run of this step since it was enabled in ray-project#66024
and reworked in ray-project#66427 has failed at the secret fetch, for example
[postmerge
ray-project#20026](https://buildkite.com/ray-project/postmerge/builds/20026) and
[ray-project#20049](https://buildkite.com/ray-project/postmerge/builds/20049). The
job log shows:

```
An error occurred (AccessDeniedException) when calling the GetSecretValue operation:
User: arn:aws:sts::029272617770:assumed-role/bk-runner-queue-small-branch-Role/i-... is not authorized to perform:
secretsmanager:GetSecretValue on resource: oss-ci/rtd-api-token
```

The `oss-ci/rtd-api-token` secret exists, but the runner role can't read
it. Release-branch builds such as
[ray-project#20050](https://buildkite.com/ray-project/postmerge/builds/20050)
aren't affected, because the step's branch guard skips them before the
fetch.

## IAM grant needed (CI infra)

This PR doesn't fix the access. It makes the failure say what's wrong.
For the step to work, the CI stack needs this grant:

- **Principal:** `bk-runner-queue-small-branch-Role`, the role of the
postmerge runner queue this step lands on. The step sets no
`instance_type`, so it runs on the default small queue.
- **Action:** `secretsmanager:GetSecretValue`
- **Resource:** the `oss-ci/rtd-api-token` secret in `us-west-2`,
account `029272617770`. Scope it to that one secret ARN, not a wildcard.
The token is deliberately isolated from other steps.
- If the secret uses a customer-managed KMS key, the role also needs
`kms:Decrypt` on that key.

`fossa analyze` (`.buildkite/others.rayci.yml`) reads
`oss-ci/fossa-api-key` the same way from an `instance_type: small` step,
so the grant should follow whatever pattern covers that secret.

Until the grant lands, this step keeps failing on master postmerge
builds, now with a clear message. It doesn't block master. If the
release-candidate noise is a problem in the meantime, re-adding a
`disabled` tag to the step turns it off, as the step comment describes.

## Not a duplicate

No open PR touches the redirect apply step. This follows up on ray-project#66024
and ray-project#66427.

## Testing

- Pulled the command block out of the YAML, replaced `$$` with `$` as
Buildkite does, and ran the apply branch under `bash -elc` with a stub
`aws`:
- `AccessDeniedException`, exit 254: the step prints the new error and
exits 1 without calling `apply`.
  - Empty secret value: the step prints the new error and exits 1.
- Non-empty value: the token is exported and reaches `rtd-redirects
apply`.
- `pre-commit run --files .buildkite/doc.rayci.yml`: the generic
whitespace, end-of-file, and large-file hooks passed. No
language-specific hook applies to this file.
- No Buildkite run. The step is `skip-on-premerge`, so a PR build can't
exercise it. Its first real run is the next master postmerge build after
merge.

## AI assistance

AI assistance (Claude Code) prepared this change and ran the checks
above. The submitter reviews every changed line before merge.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants