|
@@ -211,6 +211,8 @@ docker run -d --name svapi-dev -p 8080:8080 -e SMARTBOTIC_VECTORAPI_KEY=dev svap
|
|
|
**REMOVING A ROUTE DOES NOT CLOSE A PAGE THAT IS ALREADY OPEN, AND THE HALF-DEAD RESULT READS LIKE A SERVER FAULT.** Measured in a browser immediately after the reload: the HTML and `rapidoc-min.js` came from the browser's DISK CACHE so the title still rendered, while `openapi.json` went to the network and 404'd - leaving a page that looked alive and listed nothing. A cache-busting query string answered nginx's own 404, which is the real state. So verify a withdrawal with a URL the cache has never seen, and expect anyone who had the page open to meet a BROKEN docs page rather than an absent one.
|
|
**REMOVING A ROUTE DOES NOT CLOSE A PAGE THAT IS ALREADY OPEN, AND THE HALF-DEAD RESULT READS LIKE A SERVER FAULT.** Measured in a browser immediately after the reload: the HTML and `rapidoc-min.js` came from the browser's DISK CACHE so the title still rendered, while `openapi.json` went to the network and 404'd - leaving a page that looked alive and listed nothing. A cache-busting query string answered nginx's own 404, which is the real state. So verify a withdrawal with a URL the cache has never seen, and expect anyone who had the page open to meet a BROKEN docs page rather than an absent one.
|
|
|
**THE ERROR PAGES ARE BRANDED NOW, AND ONE SETTING DECIDES WHETHER THAT IS COSMETIC OR BREAKING.** `/etc/nginx/snippets/branded-errors.conf` maps 403/404/500/502/503/504 to static pages under `/var/www/smartbotics-errors/_brand/`, styled from the design tokens read off smartbotics.ai (`--gradient-primary`, `--foreground`, `--radius`), bilingual EN/HU, with a dark-mode variant. **`proxy_intercept_errors` is OFF, which is the default, and MUST STAY OFF**: it is the single setting that would replace vectorapi's own `{"error":{"code":...}}` JSON with HTML and silently break every client that parses our errors. Verified after the change that an unauthenticated `/api/v1/version` still answers the JSON envelope, because the branding is only meant to cover the errors NGINX ITSELF raises. Everything the page needs is on local disk, so the 502 page still renders when the upstream it is reporting on is down - an error page that fetched its own assets through the proxy would be blank in exactly the case it exists for. The pages are `internal` (unreachable as paths); only the logo is not, since the browser must fetch it.
|
|
**THE ERROR PAGES ARE BRANDED NOW, AND ONE SETTING DECIDES WHETHER THAT IS COSMETIC OR BREAKING.** `/etc/nginx/snippets/branded-errors.conf` maps 403/404/500/502/503/504 to static pages under `/var/www/smartbotics-errors/_brand/`, styled from the design tokens read off smartbotics.ai (`--gradient-primary`, `--foreground`, `--radius`), bilingual EN/HU, with a dark-mode variant. **`proxy_intercept_errors` is OFF, which is the default, and MUST STAY OFF**: it is the single setting that would replace vectorapi's own `{"error":{"code":...}}` JSON with HTML and silently break every client that parses our errors. Verified after the change that an unauthenticated `/api/v1/version` still answers the JSON envelope, because the branding is only meant to cover the errors NGINX ITSELF raises. Everything the page needs is on local disk, so the 502 page still renders when the upstream it is reporting on is down - an error page that fetched its own assets through the proxy would be blank in exactly the case it exists for. The pages are `internal` (unreachable as paths); only the logo is not, since the browser must fetch it.
|
|
|
**AN ERROR PAGE'S RELATIVE URL RESOLVES AGAINST THE REQUESTED PATH, NOT AGAINST THE ERROR PAGE'S OWN PATH, AND EVERY TEXT-BASED CHECK PASSES WHILE IT IS BROKEN.** The pages first carried `src="logo.png"`, which is correct relative to `/_brand/404.html` and is never what the browser resolves: nginx's internal redirect leaves the URL as the REQUEST, so the logo was fetched from `/logo.png`, or `/some/deep/logo.png`, and 404'd every time. curl said `status=404 type=text/html` and the body contained the brand name twice, so it looked finished. **It was a screenshot that found it** - the broken-image icon - which is the one check that could. A local preview had also passed, because the file happened to sit beside the HTML there, so the preview was testing a layout the server can never reproduce. Absolute `/_brand/logo.png` fixes it, and the test that proves it is a DEEP path, not the one the page was first opened at.
|
|
**AN ERROR PAGE'S RELATIVE URL RESOLVES AGAINST THE REQUESTED PATH, NOT AGAINST THE ERROR PAGE'S OWN PATH, AND EVERY TEXT-BASED CHECK PASSES WHILE IT IS BROKEN.** The pages first carried `src="logo.png"`, which is correct relative to `/_brand/404.html` and is never what the browser resolves: nginx's internal redirect leaves the URL as the REQUEST, so the logo was fetched from `/logo.png`, or `/some/deep/logo.png`, and 404'd every time. curl said `status=404 type=text/html` and the body contained the brand name twice, so it looked finished. **It was a screenshot that found it** - the broken-image icon - which is the one check that could. A local preview had also passed, because the file happened to sit beside the HTML there, so the preview was testing a layout the server can never reproduce. Absolute `/_brand/logo.png` fixes it, and the test that proves it is a DEEP path, not the one the page was first opened at.
|
|
|
|
|
+ **EVERY nginx-RAISED ERROR ON THE BOX IS BRANDED NOW, AND THE CATCH-ALL IS OURS RATHER THAN DEBIAN'S.** The snippet is included by all four server blocks: both hostnames, the port-80 redirect and the catch-all. The bare IP and any unknown hostname answer a branded page carrying the landing text, with status **404** rather than 200, because nothing is published there and a 200 would tell every monitor and crawler otherwise. Verified afterwards that qdrant still answers its own JSON on `:6334` and the whole `/rag/` surface is untouched, which is the part that mattered: that hostname fronts a service that is not ours.
|
|
|
|
|
+ **NEVER EDIT A dpkg CONFFILE TO DO IT. `/etc/nginx/sites-available/default` belongs to nginx-common**, and a modified conffile makes every later nginx upgrade stop and ask about a three-way merge - a cosmetic change turning into an interactive prompt in the middle of an unattended upgrade. I edited it, the owner caught it, and it was restored byte-for-byte (`dpkg --verify nginx-common` prints nothing, which is the check). The catch-all now lives in `/etc/nginx/sites-available/smartbotics-catchall`, which no package owns, and the packaged `default` is left as shipped and simply not symlinked into `sites-enabled`; `/var/www/html/index.nginx-debian.html` is the same story, still on disk and never served. **`dpkg -S <file>` before touching anything under `/etc`** - and note the failure is invisible at the time, since the edit works perfectly until an upgrade months later.
|
|
|
**Two traps met while doing it.** The half-written config was a BYTE COPY of the qdrant one with a single `server_name` changed, so it still carried full duplicate `qdrant-1` blocks on 443 and 80 and pointed at qdrant's port 6333 and qdrant's certificate - enabling that would have put conflicting server blocks on the live site and served a cert that covers neither name. And **the first request after `systemctl reload nginx` hit the old worker set and answered 404**, which read exactly like a broken location block; every path passed on a retry seconds later. Do not diagnose an nginx location from a request issued in the same breath as the reload.
|
|
**Two traps met while doing it.** The half-written config was a BYTE COPY of the qdrant one with a single `server_name` changed, so it still carried full duplicate `qdrant-1` blocks on 443 and 80 and pointed at qdrant's port 6333 and qdrant's certificate - enabling that would have put conflicting server blocks on the live site and served a cert that covers neither name. And **the first request after `systemctl reload nginx` hit the old worker set and answered 404**, which read exactly like a broken location block; every path passed on a retry seconds later. Do not diagnose an nginx location from a request issued in the same breath as the reload.
|
|
|
- **Prod's database binds `localhost`, not `0.0.0.0`** (`storage.bind_address`), which is why it is only reachable from vectorapi on the same box - correct, and worth knowing before wondering why a port-mapped copy refuses connections.
|
|
- **Prod's database binds `localhost`, not `0.0.0.0`** (`storage.bind_address`), which is why it is only reachable from vectorapi on the same box - correct, and worth knowing before wondering why a port-mapped copy refuses connections.
|
|
|
- **`policy-rc.d` DOES NOT HOLD THE DATABASE PACKAGE. It blocks `invoke-rc.d`, and that postinst calls `systemctl` DIRECTLY.** Measured the hard way on 2026-10-12: a `policy-rc.d` returning 101 was in place, the pinned install ran at 18:21:12, and the service restarted anyway - the 2.17.2 first-boot migration ran to completion before the install command had even returned. **A hold point three consumers had been promised simply did not exist**, and that cost TWO separate things, not one. One consumer lost the chance to say "wait, a call is live" that they had explicitly been offered. **And because the install itself triggered the migration, the outage happened at 18:21 rather than in the 18:30 slot all three had approved** - it ran NINE MINUTES EARLY, outside the approved window, which is a governance failure distinct from the missing check. A consumer put that second point in the record; my own account had blurred it into the first, which understated it.
|
|
- **`policy-rc.d` DOES NOT HOLD THE DATABASE PACKAGE. It blocks `invoke-rc.d`, and that postinst calls `systemctl` DIRECTLY.** Measured the hard way on 2026-10-12: a `policy-rc.d` returning 101 was in place, the pinned install ran at 18:21:12, and the service restarted anyway - the 2.17.2 first-boot migration ran to completion before the install command had even returned. **A hold point three consumers had been promised simply did not exist**, and that cost TWO separate things, not one. One consumer lost the chance to say "wait, a call is live" that they had explicitly been offered. **And because the install itself triggered the migration, the outage happened at 18:21 rather than in the 18:30 slot all three had approved** - it ran NINE MINUTES EARLY, outside the approved window, which is a governance failure distinct from the missing check. A consumer put that second point in the record; my own account had blurred it into the first, which understated it.
|