Forráskód Böngészése

docs: upgrading smartbotic-db-cli drags the client library under vectorapi

Measured: smartbotic-db-cli 2.18.1-1 Depends libsmartbotic-db-client
(>= 2.18.1-1), and apt will not install the CLI alone - it reports
conflicting decisions. So taking a client-side, admin-tool-only fix moves
the shared .so.2 under the running server, which is compiled against the
DB_CLIENT_VERSION its deb was built with. One SONAME across all 2.x means
that installs cleanly and segfaults on the next restart, days later, with
nothing pointing at the cause.

Run the container ABI test before prod sees it, the same procedure that
cleared 2.17.2 at 21 of 21 calls. Raised upstream too: an operator tool
and a long-running service have no reason to share a version, and either
static linking or an ABI-floor dependency would decouple them.
fszontagh 1 hónapja
szülő
commit
8eb7ca9cc4
1 módosított fájl, 1 hozzáadás és 0 törlés
  1. 1 0
      CLAUDE.md

+ 1 - 0
CLAUDE.md

@@ -231,6 +231,7 @@ docker run -d --name svapi-dev -p 8080:8080 -e SMARTBOTIC_VECTORAPI_KEY=dev svap
   **The generalisation came from a consumer who ran the same check and got the OPPOSITE answer, correctly: the question is not "is my hold still set" but "what actually protects the versions I depend on".** On their box, no hold is wanted - `unattended-upgrades` covering Debian means their Node 20 pin is unreachable anyway, since the archive cannot move nodejs off 20.x within Debian 13, and adding a hold there would only block security fixes. Their real gap was the mirror image of ours: a backports package (`o=Debian Backports`) matched by no pattern, so **the package that rots fastest is the one nothing refreshes**. Two boxes, same check, opposite correct answers - which is why the rule is to measure the policy rather than copy the remedy. A pin added in the wrong place costs security updates.
   **CHECK THE SERVER'S VERSION WITH `smartbotic-db-cli server-info`, NEVER with `db_client` FROM `/api/v1/version`.** A consumer pushed back on a claim of mine that rested on the latter, correctly: `db_client` is the version of the client library the BUILD LINKS, and a lock's scope is a SERVER property, so that field cannot establish it - the same trap this file already records from the other direction, where a 2.14 client against a 2.13 server reads 2.14.0 while the capped path runs. Verified properly: `server-info` reports `server: 2.17.2 (commit 0cd2285)` and the server's own view of the client. The general form is that **a claim about the server needs a server-side measurement, and a version string is the weakest kind of evidence available for it** - prefer the measured behaviour when you have it.
   **The signal was in plain sight and I walked past it.** `dpkg -l` prints `hi` rather than `ii` for a held package, and that appeared in the very first prod inventory of the day; I read the versions out of that output and ignored the status column. Always `--dry-run` a pinned install before a window and read what it says it will do: this one also confirmed 2 upgraded, 1 newly installed (`smartbotic-db-cli`, which is how `encryption-verify` arrives on prod), 0 removed and nothing held back.
+- **UPGRADING `smartbotic-db-cli` IS AN ABI EVENT FOR VECTORAPI, BECAUSE THE CLI IS VERSION-LOCKED TO THE SHARED CLIENT LIBRARY.** Measured 2026-10-15: `smartbotic-db-cli 2.18.1-1` Depends `libsmartbotic-db-client (>= 2.18.1-1)`, and apt refuses to install the CLI alone ("Reached two conflicting decisions"). So taking an admin-tool-only, client-side-only fix moves `libsmartbotic-db-client.so.2` **under the running server**, which is compiled against whatever `DB_CLIENT_VERSION` the deb was built with - and every 2.x client shares one SONAME, so it installs cleanly and segfaults on the NEXT RESTART, days later, with nothing pointing at the change. **Run the container ABI test first** (the real server deb plus the new client in a Debian 13 container against the target server; it cleared 2.17.2 at 21 of 21 calls and takes minutes). Reported upstream, since an operator tool and a long-running service have no reason to share a version - static linking or an ABI-floor dependency would both fix it.
 - **Abseil ABI:** `smartbotic-database`/client debs must be built against the system's current Abseil; a stale build crash-loops on `libabsl_*.so.<old>`. Rebuild the DB if it won't start.
 - **`--rebuild-base` is required when `DB_CLIENT_VERSION` moves.** The client version is baked into the Docker BASE image, so bumping the variable alone leaves the release build compiling against the old headers - it fails on the new entry points, or worse, silently links the old ones. Note `devstack/run-tests.sh` installs the client debs explicitly, so the TEST path can be on a newer client than the RELEASE path: a green suite is not evidence about the packages.
 - **`systemctl start` on an already-running unit is a no-op.** A package postinst starts the service, so any config written AFTER apt needs a `restart`, not a `start` - otherwise the process keeps the config that existed at install time and the file on disk disagrees with the running state. Compare the file mtime against `systemctl show -p ActiveEnterTimestamp` when a setting appears not to apply.