Skip to content

Add solutions to errors 10000 to 10093 in CoreError.java#3403

Open
josh-wong wants to merge 6 commits into
add-solutions-to-core-errors-allfrom
add-solutions-to-core-errors-1.1
Open

Add solutions to errors 10000 to 10093 in CoreError.java#3403
josh-wong wants to merge 6 commits into
add-solutions-to-core-errors-allfrom
add-solutions-to-core-errors-1.1

Conversation

@josh-wong
Copy link
Copy Markdown
Member

Description

This PR adds error solutions to errors 10000 to 10093 in CoreError.java. These solutions help users understand how to resolve or further investigate the errors, improving debuggability and user support.

Note

As previously discussed, since we have a lot of errors within the five classes in CoreError.java, I've included only a portion of the solutions in this PR. Later PRs will include similar portions, with the last error solution in each PR ending on a topic (in this case, before the Consensus Commit–related error messages).

Related issues and/or PRs

Note

To avoid having the batches of error solutions become a blocker if we need to release a minor or patch version, this branch targets a parent branch for the CoreError.java error solutions. After all PRs for error solutions for CoreError.java have been merged, we can merge that branch into the master branch.

Changes made

  • Added solutions to errors 10000 to 10093 in CoreError.java.
  • Applied Spotless formatting to those error solutions.

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

Since this PR covers only a portion of the error solutions, the parent PR for the CoreError.java solutions mentioned above will include a release note.

Release notes

N/A

@josh-wong josh-wong self-assigned this Mar 6, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the CoreError.java file by integrating detailed solutions for a range of user-facing errors (10000-10093). This initiative aims to significantly improve the user experience by providing clear guidance on how to resolve or investigate common issues, thereby streamlining debugging efforts and bolstering overall support. This is part of a larger effort to add solutions for all errors in CoreError.java.

Highlights

  • Error Solutions Added: Solutions for errors 10000 to 10093 were added to CoreError.java to improve debuggability and user support.
  • Code Formatting: Spotless formatting was applied to the newly added error solutions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • core/src/main/java/com/scalar/db/common/CoreError.java
    • Added comprehensive solution messages for error codes 10000 through 10093.
    • Applied consistent code formatting using Spotless to the new error solution entries.
Activity
  • The author, josh-wong, has added solutions for a specific range of error codes (10000-10093) in CoreError.java.
  • This PR is part of a phased approach to add error solutions, with subsequent PRs planned for the remaining errors.
  • The author has completed all items in the provided checklist, including commenting code, updating documentation, considering similar issues, documenting open issues, adding tests, ensuring no new warnings, and verifying dependent changes.
  • The PR targets a parent branch for CoreError.java error solutions to avoid blocking minor/patch releases.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds helpful solution messages to a range of error codes in CoreError.java. The solutions are clear and provide good guidance for users. I've found a minor inconsistency in the use of "clustering key" versus "clustering-key" between the error messages and the newly added solution texts, which I've detailed in a specific comment. Overall, this is a valuable improvement for debuggability.

Comment thread core/src/main/java/com/scalar/db/common/CoreError.java
"0042",
"Invalid ID specified. ID: %d",
"",
"Use a valid transaction state ID."),
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.

@brfrn169 I'm wondering how users can handle this error. Maybe this should not be a USER_ERROR?

"The storage does not support mutations across multiple partitions. Storage: %s; Mutations: %s",
"",
""),
"Group mutations by partition key and execute them in separate transactions, or use a storage that supports multi-partition mutations."),
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.

@brfrn169 I don't think we document the atomicity unit we apply for each storage. It is helpful for performance optimization, so documenting it might be nice. What do you think?

Comment thread core/src/main/java/com/scalar/db/common/CoreError.java Outdated
Comment thread core/src/main/java/com/scalar/db/common/CoreError.java Outdated
"",
""),
"Use only EQ, NE, IS_NULL, or IS_NOT_NULL operators for BLOB columns in Cosmos DB conditions."),
INVALID_CONSISTENCY_LEVEL(
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.

This error message is only used for CosmosDB, and since the solution is only applicable to Cosmos. I think we might as well rename the error to be Cosmos DB-specific rather than storage-agnostic.

Suggested change
INVALID_CONSISTENCY_LEVEL(
COSMOS_INVALID_CONSISTENCY_LEVEL(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just to confirm, are we OK to make this change here now? Or will changing it affect other source code?

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.

It will affect another Java file. Since it is a small change, I think it's fine to make it here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Understood, thanks! I've addressed it in a28db84.

"Storage not found. Storage: %s",
"",
"Verify the storage name is defined in your multi-storage configuration."),
JDBC_SQLITE_NAMESPACE_NAME_NOT_ACCEPTABLE(
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.

@brfrn169
The error and the one below are raised when the table or namespace names contain a $ character, which is used internally to separate the namespace from the table in the table name, such as MY_NAMESPACE$MY_TABLE
Should we mention directly in the error message that this $ is not allowed ? Otherwise, I think the error message is not very helpful.

Comment thread core/src/main/java/com/scalar/db/common/CoreError.java Outdated
josh-wong and others added 2 commits March 24, 2026 17:04
Co-authored-by: Vincent Guilpain <vincent.guilpain@scalar-labs.com>
Change `INVALID_CONSISTENCY_LEVEL` to `COSMOS_INVALID_CONSISTENCY_LEVEL`.

Co-authored-by: Vincent Guilpain <vincent.guilpain@scalar-labs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants