In headless/service mode, persistent login often needs a follow-up prompt (password, SSO, 2FA, device approval) that cannot be answered. Log once and cancel so the caller exits cleanly instead of looping or spamming getpass.
(step)
| 29 | |
| 30 | |
| 31 | def _fail_headless_auth(step): |
| 32 | """In headless/service mode, persistent login often needs a follow-up prompt |
| 33 | (password, SSO, 2FA, device approval) that cannot be answered. Log once and |
| 34 | cancel so the caller exits cleanly instead of looping or spamming getpass.""" |
| 35 | global _HEADLESS_AUTH_MSG_SHOWN |
| 36 | if not _HEADLESS_AUTH_MSG_SHOWN: |
| 37 | _HEADLESS_AUTH_MSG_SHOWN = True |
| 38 | logging.error( |
| 39 | 'Persistent login is not working in this non-interactive environment ' |
| 40 | '(possibly due to an IP/location change). ' |
| 41 | 'Re-run Commander/Docker setup from this network, then restart the service.' |
| 42 | ) |
| 43 | step.cancel() |
| 44 | |
| 45 | |
| 46 | class ConsoleLoginUi(login_steps.LoginUi): |
no test coverage detected