Repository navigation
fix(preflight): allow candidate config generation with uncached subscriptions - #122
Merged
Dushnilin merged 1 commit intoOct 10, 2026
Conversation
…riptions When installing or switching sing-box variants on a system with connection sections configured with subscription URLs but no local cache yet (such as after a firmware flash with restored UCI backup), pre-flight candidate config generation failed with: 'connection section has no usable outbounds' Because generator output was discarded to /dev/null, cand_status was left at -1 and verifier reported a misleading failure: 'Pre-flight check failed: binary ... rejected config for <var>: exit status -1' 1. In generator_outbounds, auto-defer connection sections with no usable outbounds during pre-flight candidate generation (SB_PREFLIGHT_BINARY). 2. In generator_routes, guard dns_detour_section when it is deferred. 3. In verifier, capture generator output in err_file and distinguish generator failure from binary rejection in updates_log. 4. Add regression test tests/sing_box_preflight_uncached_subscriptions.sh.
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.
Что сделано
Устранена ошибка пре-флайт проверки (
Pre-flight check failed: binary ... rejected config for <var>: exit status -1), которая возникала при установке или переключении ядер sing-box на системе с сохранённым из бэкапа конфигом или добавленными подписками, кэш которых ещё не был загружен.Проблема
action='connection'и URL подписок (subscription_url). Но локальный кэш/etc/tachyon/subscription-cacheна новой системе ещё пуст.tachyon-setup.shили веб-интерфейс)verifier.ucзапускает pre-flight валидацию через вызов:deferred_sectionsпередавался пустым, а кэш нод отсутствовал, генератор падал с ошибкой:>/dev/null 2>&1, из-за чего ошибка маскировалась:cand_statusоставался-1, и установщик сообщал дезинформирующую ошибку:Решение
generator_outbounds.uc: во время pre-flight генерации (SB_PREFLIGHT_BINARY) правила маршрутизации без доступных аутбаундов (например, подписки без локального кэша) динамически помечаются какdeferred, предотвращая сбой генератора тестового конфига.generator_routes.uc: добавлена проверкаdns_detour_sectionна наличие вdeferred_sectionsперед добавлением маршрутных правил для DNS detour.verifier.uc: вывод генератора теперь перенаправляется вerr_file, а при падении генератора ошибка логируется какunable to generate configuration for <var>: <reason>вместо ложного утверждения о несовместимости бинарника со статусом-1.tests/sing_box_preflight_uncached_subscriptions.sh.Проверено
connection section has no usable outboundsи ложнымexit status -1.{ "ok": true }.unsupported action ...), а неexit status -1.tests/sing_box_preflight_uncached_subscriptions.sh— passed.