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

Do not crash if RDP is selected after regular GUI startup failed (#2326410) #5999

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

M4rtinK
Copy link
Contributor

@M4rtinK M4rtinK commented Nov 15, 2024

The ask_rd_question() function returns not only the credentials tuple, but also the "use remote desktop" flag.

We correctly handled that in the regular case where we ask for user password if user selected RDP instead of text mode.

But we missed that in the harder to test case where RDP is suggested as an option to the user after regular locally running GUI startup fails. Oops! :P

So handle the extra value and avoid the crash. :)

Resolves: rhbz#2326410

…26410)

The ask_rd_question() function returns not only the credentials tuple,
but also the "use remote desktop" flag.

We correctly handled that in the regular case where we ask for user
password if user selected RDP instead of text mode.

But we missed that in the harder to test case where RDP is suggested
as an option to the user after regular locally running GUI startup
fails. Oops! :P

So handle the extra value and avoid the crash. :)

Resolves: rhbz#2326410
@M4rtinK
Copy link
Contributor Author

M4rtinK commented Nov 15, 2024

/kickstart-test --testtype smoke

rdp_creds = ask_rd_question(anaconda, message)
# we aren't really interested in the use_rd flag so at least mark it like this
# to avoid linters being grumpy
_use_rd, rdp_creds = ask_rd_question(anaconda, message)
Copy link
Member

Choose a reason for hiding this comment

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

Honestly to me this doesn't seem correct.

I don't think we should set the flag.use_rd, it looks to me like a side effect. Another option is to not return the value but that would be less preferable to me as the side effect is still there.

In other words, from looking on this change set it doesn't sense why we ignore this value when we ask for it on line below, however, it's not visible that the use_rd flag is set inside the ask_rd_question.

Copy link
Member

Choose a reason for hiding this comment

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

I would rather rewrite the calls in this method to something like:

def set_gui_mode_on_rdp(anaconda, use_rd):
        if not anaconda.gui_mode:
            log.info("RDP requested via RDP question, switching Anaconda to GUI mode.")
        anaconda.display_mode = constants.DisplayModes.GUI
        flags.use_rd = True

use_rd, rdp_creds = ask_rd_question(message)
set_gui_mode_on_rdp(anaconda, use_rd)

Seems cleaner to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good - yeah, it might actually make sense to set the flag there as well - its should still be marked as using RD even after Wayland crashed. Must have somehow mixed it all up with GUI/non-GUI mode. :)

Feel free to open a new PR & we can then close this one as obsolete. :)

@jkonecny12
Copy link
Member

@M4rtinK could you please tell me how to reproduce this situation?

@M4rtinK
Copy link
Contributor Author

M4rtinK commented Nov 19, 2024

@M4rtinK could you please tell me how to reproduce this situation?

That's the tricky part - I think you need to crash your Wayland session, so that the GUI-startup-failed logic kicks in. :P

On the other hand, I think you can just make run-in-new-session script used to start GNOME Kiosk throw a traceback & this should trigger the fallback code. :)

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.

2 participants