Skip to content

fix: prevent IndexOutOfBoundsException during LocalCA startup#94

Open
tyronechrisharris wants to merge 2 commits into
feature/containerization-migration-3515012633390207391from
jules-persistent-ca-fix-16723828009039065609
Open

fix: prevent IndexOutOfBoundsException during LocalCA startup#94
tyronechrisharris wants to merge 2 commits into
feature/containerization-migration-3515012633390207391from
jules-persistent-ca-fix-16723828009039065609

Conversation

@tyronechrisharris

Copy link
Copy Markdown
Owner

Fixes a backend startup loop exception IndexOutOfBoundsException: Index 0 out of bounds for length 0 in osh-backend due to empty .app_secrets files.


PR created automatically by Jules for task 16723828009039065609 started by @tyronechrisharris

…s file

Fixes a critical startup bug in `LocalCAUtility.java` where an empty `.app_secrets` file,
such as one generated by deployment scripts via `type nul > .app_secrets`, caused an `IndexOutOfBoundsException` when attempting to access the first line of the file.
We now safely ensure that `lines` is evaluated to have content before attempting to retrieve the first element,
falling back gracefully to the environment variable or error states.
Also refactored `keystoreFile.length() == 0 || secretsFile.length() == 0` validation to ensure CA certificates and passwords regenerate synchronously if one was wiped out.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Applies the correct keystore/secrets file validation fix to prevent the `IndexOutOfBoundsException` error reported during container initialization. The fix resolves the bug when the `launch-all` deployment scripts create 0-byte `.app_secrets` and `.osh-keystore` files. Both the generation and file-read blocks are now updated.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
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.

1 participant