preinst: bare jq + exit 1 blocks upgrades and opkg orphan-cleanup strips nodogsplash+jq on abort
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 50/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- infrastructure
Direzione di ricerca
Start with packaging/preinst and find the branch that runs jq to update install_time on upgrades, which is the exit 1 path. First confirm the finding still reproduces on current main, since the issue says it was not re-verified. Done means the preinst no longer aborts an upgrade over this cosmetic field, and the postinst or packaging behaviour for nodogsplash and jq is decided. An OpenWrt VM is needed to run the upgrade path.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Migrated from Amperstrand/tollgate-module-basic-go#93 as part of the fork retirement — OpenTollGate/tollgate-module-basic-go is the single source of truth; the fork issue carries the original discussion and any lab evidence. Retirement plan: #758.]
Found during QEMU v0.5.0→v0.6.0 upgrade emulation (PRTA campaign #113, bench in physical-router-test-automation@40d1b56 / scripts/upgrade-emulation/).
Summary
packaging/preinst hard-fails (exit 1) when it cannot update the cosmetic install_time field via bare jq — and when the upgrade aborts, opkg's orphan cleanup removes nodogsplash and jq (autoinstalled deps of the old package), leaving the captive portal broken after a "failed safe" upgrade.
Reproduction (OpenWrt 24.10.1 x86_64 VM, opkg 2024-10-16)
- Install v0.5.0 (deps auto-resolve: nodogsplash, jq, ...)
- Attempt
opkg install tollgate-wrt_v0.6.0…ipkin a state wherejqis absent at preinst time (in our run: a concurrent/duplicate opkg transaction's aborted cleanup had removed it):
Upgrading tollgate-wrt on root from v0.5.0 to v0.6.0-alpha2...
/tmp/opkg-XXXX/tollgate-wrt-YYYY/preinst: line 5: jq: not found
Error: Failed to update install_time using jq
Collected errors:
* pkg_run_script: package "tollgate-wrt" preinst script returned status 1.
* preinst_configure: Aborting installation of tollgate-wrt.
...
nodogsplash was autoinstalled and is now orphaned, removing.
jq was autoinstalled and is now orphaned, removing.
- Result: still v0.5.0, portal (nodogsplash) gone, jq gone.
Facts pinned by forensics
- Maintainer-script env probe (repacked ipk with env-logging preinst): opkg passes the caller's env through;
PATH=/usr/sbin:/usr/bin:/sbin:/bin, and with jq present it IS found — the abort requires jq to actually be missing at that moment (any failed earlier transaction's orphan cleanup produces exactly that state). - The initial install never hits the jq path (fresh
/etc/tollgate/install.jsonis created by theechoELSE-branch, no jq) — only upgrades with existing install.json run the jq branch. - With jq present, the identical artifact upgrades cleanly (verified end-to-end: config/wallet/identities sha-preserved, payments work).
Recommended fix (two independent layers)
- preinst should never
exit 1for aninstall_timecosmetic — warn and continue (exit 0). - Don't rely on bare
jq: use/usr/bin/jqabsolute path, or replace with a BusyBox-only JSON write (the field is a single integer;sed/awksuffices), or drop preinst entirely and let the binary own install_time.
Optional hardening: postinst could opkg-flag have_installed nodogsplash jq (or list them in a metapackage) so aborted transactions can't orphan the portal.
Evidence
physical-router-test-automation/results/upgrade-emulation/(local, not in git): install/upgrade logs, preinst env capture, sha snapshots across upgrade→rollback→upgrade.
Migrated 2026-10-09. Applicability to current upstream main (4614ac2, post-rc1) was not re-verified during migration — confirming whether the finding still reproduces upstream is this issue's first task.
- Lingua principale
- Go
- Stelle
- 12
- Fork
- 14
- Merge medio
- 1g 5h
- PR unite (30g)
- 232
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenTollGate/tollgate-module-basic-go
-
Session event emits the customer's MAC address in the p tag — spec-invalid value on every payment responseForse già presa @Amperstrand l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
OpenTollGate/tollgate-module-basic-go#949 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
OpenTollGate/tollgate-module-basic-go#833 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
OpenTollGate/tollgate-module-basic-go#813 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
OpenTollGate/tollgate-module-basic-go#804 ·
I maintainer di solito rispondono entro 1 giorno
-
go-battery needs an ndsctl on PATH: TestPurchaseSessionGuardHoldsThroughTheOutcomeUnknownWindow fails on bare hosts (passes with stub)Forse già presa @Amperstrand l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OpenTollGate/tollgate-module-basic-go#726 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OpenTollGate/tollgate-module-basic-go
Issue simili
-
bug
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
kubernetes-sigs/external-dns#6816 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
ANSI translator ignores SGR 22/24 (and other attribute-off codes): bold and underline never turn offAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Named Tuple element with a space in its name fails to parseForse già presa @spicysharkco l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ClickHouse/clickhouse-go#2073 ·
I maintainer di solito rispondono entro 1 giorno