Skip to content

fix(run_kraken): replace bare except with proper error handling for kubecli init#1111

Open
AR21SM wants to merge 1 commit intokrkn-chaos:mainfrom
AR21SM:fix/run-kraken-exception-handling
Open

fix(run_kraken): replace bare except with proper error handling for kubecli init#1111
AR21SM wants to merge 1 commit intokrkn-chaos:mainfrom
AR21SM:fix/run-kraken-exception-handling

Conversation

@AR21SM
Copy link
Contributor

@AR21SM AR21SM commented Jan 19, 2026

fix(run_kraken): replace bare except with proper error handling for kubecli init

Type of change

  • Refactor
  • New feature
  • Bug fix
  • Optimization

Description

The bare except block at line 173 attempted to call kubecli.initialize_clients(None), but kubecli is undefined at this point since the exception occurs during its initialization. This causes a NameError crash on top of the original exception.

Related Tickets & Documents

Documentation

  • Is documentation needed for this update?

No — this is an internal bug fix with no user-facing changes.

Checklist before requesting a review

  • Ensure the changes and proposed solution have been discussed in the relevant issue
  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough unit tests with above 80% coverage

REQUIRED:

Verified module imports cleanly:

python -c "import run_kraken"
# OK - no import errors

This is a single-line fix for exception handling - no runtime test required as it only affects error path behavior.

…ubecli init

Signed-off-by: AR21SM <mahajanashishar21sm@gmail.com>
Copy link
Collaborator

@tsebastiani tsebastiani left a comment

Choose a reason for hiding this comment

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

LGTM

@tsebastiani
Copy link
Collaborator

tsebastiani commented Jan 26, 2026

@AR21SM Could you please provide a couple of screenshots of krkn falling in this use case with the input provided? Thank you very much

@AR21SM
Copy link
Contributor Author

AR21SM commented Jan 26, 2026

@AR21SM Could you please provide a couple of screenshots of krkn falling in this use case with the input provided? Thank you very much

Before: UnboundLocalError crash when kubecli is undefined
image

After: Clean error message and exit

image

@AR21SM
Copy link
Contributor Author

AR21SM commented Feb 9, 2026

@paigerube14

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.

[BUG] Runtime crashes caused by bare exception handling and unchecked list indexing

2 participants