fix: bypass cli_progress wrapper when stdout is not a TTY#5506
Open
mktwix wants to merge 1 commit into
Open
Conversation
apply_configs / apply_users invoked over non-interactive SSH or from background jobs hang forever in cli_progress urwid, leaving sing-box configs stale after Admin API user renewals. When stdout is not a terminal, run the wrapped install/apply command directly. Fixes hiddify#5479 Related: hiddify#5505 Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
Companion fix in cli_progress package: hiddify/cli_progress#8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apply_configs/apply_usershang indefinitely when invoked without a TTY becauseshow_progress_window()always wraps the command inpython -m cli_progress(urwid UI). The subprocess may finish and regenerate configs, but the wrapper never exits and can block later applies (exit 12 lock).Impact: After Admin API user renew, panel DB is correct but sing-box protocols (Hy2/TUIC/Mieru/Naive) stay stale until manual SSH intervention.
Fix
In
show_progress_window(), detect non-TTY stdout ([ ! -t 1 ]) and run the wrapped install/apply command directly, skippingcli_progress.Interactive installs still use the progress UI.
Reproduction
Manual workaround that worked: kill
cli_progress, runcommander.py apply-users, restart sing-box.Related
Fixes #5479
Related: #5505, #5498, #4926
Companion PR: hiddify/cli_progress#TBD
Verified on production 12.3.3 across Montreal / Helsinki / Nuremberg.
Made with Cursor