Skip to content

CASSSIDECAR-477: Remove filesytem path from Http response#366

Open
sarankk wants to merge 2 commits into
apache:trunkfrom
sarankk:remove-path
Open

CASSSIDECAR-477: Remove filesytem path from Http response#366
sarankk wants to merge 2 commits into
apache:trunkfrom
sarankk:remove-path

Conversation

@sarankk

@sarankk sarankk commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

logger.error("Upload directory not found for request={}, remoteAddress={}, " +
"instance={}", request, remoteAddress, host, cause);
context.fail(wrapHttpException(HttpResponseStatus.NOT_FOUND, cause.getMessage()));
context.fail(wrapHttpException(HttpResponseStatus.NOT_FOUND, "SSTable could not be uploaded to desired upload location. " + request));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] message can be in similar lines to above logger.error message - '"Upload directory not found ...'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree to Shailaja's suggestion. The updated error message "could not be uploaded" suggests a server error, but it is indeed 404, a client error. We should craft the message to reflect the error directly. My suggestion: "SSTable upload directory was not found".

On adding the request: SSTableImportRequestParam to the error message. I do not believe including the options like "resetLevel" in the error message provides value. Let's remove it.

@frankgh frankgh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines -72 to +73
assertThat(error.getString("message")).contains("The keyspace unknown_ks, does not exist");

assertThat(error.getString("message"))
.contains("The requested keyspace Name{unquotedName='unknown_ks', maybeQuotedName='unknown_ks'} was not found.");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the new error message better? It also seems to be unrelated to the goal – "Remove filesytem path from Http response"

logger.error("Upload directory not found for request={}, remoteAddress={}, " +
"instance={}", request, remoteAddress, host, cause);
context.fail(wrapHttpException(HttpResponseStatus.NOT_FOUND, cause.getMessage()));
context.fail(wrapHttpException(HttpResponseStatus.NOT_FOUND, "SSTable could not be uploaded to desired upload location. " + request));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree to Shailaja's suggestion. The updated error message "could not be uploaded" suggests a server error, but it is indeed 404, a client error. We should craft the message to reflect the error directly. My suggestion: "SSTable upload directory was not found".

On adding the request: SSTableImportRequestParam to the error message. I do not believe including the options like "resetLevel" in the error message provides value. Let's remove it.

if (cause instanceof FileNotFoundException || cause instanceof NoSuchFileException)
{
context.fail(wrapHttpException(HttpResponseStatus.NOT_FOUND, cause.getMessage()));
context.fail(wrapHttpException(HttpResponseStatus.NOT_FOUND, "The requested snapshot folder was not found. " + request));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

  1. Update message to "The requested snapshot was not found"
  2. Remove request: SnapshotRequestParam in the message, as the caller already have this context.

if (cause instanceof FileNotFoundException || cause instanceof NoSuchFileException)
{
context.fail(wrapHttpException(HttpResponseStatus.NOT_FOUND, cause.getMessage()));
context.fail(wrapHttpException(HttpResponseStatus.NOT_FOUND, "Snapshot could not be cleared, directory not found. " + requestParams));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

  1. Update message to "The requested snapshot was not found"
  2. Remove requestParams: SnapshotRequestParam as the caller already have this context.

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.

5 participants