Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security: handle exception on early anaconda certificate import #6114

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rvykydal
Copy link
Contributor

Present human readable error message.

The case for this fix is missing --dir option. The option will be probably made required in pykickstart but we still want to handle import exceptions in user friendly way.

Related: INSTALLER-4030

@github-actions github-actions bot added the f42 Fedora 42 label Jan 28, 2025
@rvykydal
Copy link
Contributor Author

rvykydal commented Jan 28, 2025

Instead of traceback on uncaught SecurityInstallationError a message with prompt for reboot is displayed:

Screenshot from 2025-01-28 09-25-08

Copy link
Member

@jkonecny12 jkonecny12 left a comment

Choose a reason for hiding this comment

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

Please verify my question below.

def prompt_for_reboot():
print(_("The installation cannot continue and the system will be rebooted"))
print(_("Press ENTER to continue"))
input()
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this block installation in non-interactive / cmdline mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, I'll check.

Copy link
Contributor Author

@rvykydal rvykydal Jan 28, 2025

Choose a reason for hiding this comment

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

So, to check if we are in interactive mode would be non-trivial but doable at this early stage (asking runtime module for kickstart settings and perhaps also checking cmdline options).
But given sys.exit does not reboot at this stage I think we can just remove the prompt. Then the behaviour would be the same as with kickstart parsing error.

Screenshot from 2025-01-28 16-23-04

updated the PR, @jkonecny12 what do you think?

Present human readable error message.

The case for this fix is missing --dir option.  The option will be
probably made required in pykickstart but we still want to handle
import exceptions in user friendly way.

Related: INSTALLER-4030
Resolves: rhbz#2342245
Copy link
Member

@jkonecny12 jkonecny12 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

@rvykydal
Copy link
Contributor Author

/kickstart-test reboot-initial-setup-tui

@rvykydal
Copy link
Contributor Author

/kickstart-test --testtype smoke

Copy link
Contributor

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

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

Looks good to me! :)

Just a small suggestion to maybe note where the certificate that failed to be processed is coming from. :)

sync_run_task(task_proxy)
except SecurityInstallationError as e:
log.error(e)
print(_("\nAn error occurred during certificate import:"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is so far ever going only via kickstart, right ? Then I would suggest adding that to the error message, something like:

An error occurred during certificate import from kickstart:

That should make it easier to track down & fix the issue, especially if its a third party seeing the error message and reporting it back (eq. an automated kickstart based deployment going wrong somewhere).

@KKoukiou KKoukiou added f43 and removed f42 Fedora 42 labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants